Exemple #1
0
def _set_layout(assets):
    asset_names = sorted(assets.keys())
    header_elements = [
        Div(
            [
                H1("Data Asset Visualiser", className="header-title"),
                P("Load assets from JSON Lines files", className="header-description"),
            ],
            className="header",
        ),
        Div(
            dcc.Dropdown(
                id="asset-filter",
                options=[{"label": a, "value": a} for a in asset_names],
                value="",
                clearable=True,
                className="dropdown",
            ),
            className="menu",
        ),
    ]

    body = Div(_generate_body(), id="charts-body", className="wrapper")

    all_elements = header_elements + [body]

    return Div(all_elements)
Exemple #2
0
def get_item_hud(hud_title='LCL FORECAST ANALYSIS', hud_1_0='', hud_1_1='') \
        -> Container:
    """
    :param hud_title: str top of HUD
    :param hud_1_0: str Byline Position 1
    :param hud_1_1: str Byline Position 2
    
    :param
    hud_1_2: str
    :return: 
    Container: 'item-hud-container'
        Row
            Container:'item-hud-title-container'
                Col
                    H1: 'hud-title'
        Container: 'item-hud-byline-container'
            Row 
                Navbar: item-hud-bar'
                    NavItem:
                        H2: 'hud-1-0'
                        H2: hud-1-1'
            Row
                Tabs: 'table-tabs-nav'
                    Tab: 'tab-all
    """
    layout = Container(
        fluid=True,
        id='item-hud-container',
        children=[
            Row(
                Container(
                    id='item-hud-title-container',
                    children=[Col(H1(id='hud-title', children=hud_title))])),
            Container(
                id='item-hud-byline-container',
                style=VISIBILITY_HIDDEN,
                children=[
                    Row([
                        Navbar(id='item-hud-bar',
                               children=[
                                   NavItem(H2(hud_1_0, id='hud-1-0')),
                                   NavItem(H2(hud_1_1, id='hud-1-1'))
                               ])
                    ]),
                    Row([
                        Tabs(
                            id='table-tabs-nav',
                            children=[Tab(tab_id='tab-all', label='All')],
                        )
                    ],
                        id='item-hub-tabs-row')
                ]),
            Div(id='datasource-1'),
            Div(id='datasource-2')
        ])
    return layout
Exemple #3
0
 def get_html(self) -> List[ComponentMeta]:
     """Initializes the header dash html
     """
     content = self.content
     return [
         Div(children=[
             H1(className="penn-medicine-header__title",
                id="title",
                children=content["title"]),
             Markdown(content["description"])
         ])
     ]
 def not_found() -> Div:
     """
     Returns the 404 page not found page
     """
     return Container([
         Row([
             Col([
                 H1('404 Page not found'),
                 internal_link('Home', href='/'),
             ])
         ])
     ])
Exemple #5
0
 def index() -> Div:
     '''
     Returns the app index page
     '''
     return Container([
         Row([
             Col([
                 H1('Welcome to the Index Page'),
                 P('You can visit a second page by'
                   ' clicking the link below'),
                 internal_link('Hello Page', href='/hello'),
             ])
         ])
     ])
Exemple #6
0
 def hello() -> Div:
     '''
     Returns the hello page
     '''
     return Container([
         Row([
             Col([
                 H1('Hello, World!'),
                 Br(),
                 Input(id='hello_input',
                       value='',
                       type='text',
                       placeholder='Enter name',
                       debounce=True),
                 Br(),
                 Div(id='hello_output'),
                 internal_link('Home', href='/'),
             ])
         ])
     ])
def main():
    app = dash.Dash()
    html_graphs = top_html_graphs()
    html_table = monthly_html_table()

    app.css.append_css({
        'external_url':
        'https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css'
    })
    app.layout = Div(children=[
        Div(H1([
            'Personal Finance ',
            html.Small('insights', style={'color': '#888'})
        ]),
            className='page-header'), html_graphs, html_table
    ],
                     style={'padding': '2%'})

    # firefox = Popen(['firefox', '--new-tab', 'http://127.0.0.1:8050'])
    app.run_server(debug=True)
Exemple #8
0
 def html_instruction_list(self) -> typing.List:
     return [
         H1("BET ETF Calculator"),
         Ul(
             [
                 Li("Andrei Răduță"),
                 Li("*****@*****.**"),
                 Li(
                     Link(
                         children="https://github.com/andreiraduta11/bet-etf",
                         href="https://github.com/andreiraduta11/bet-etf",
                     )
                 ),
             ]
         ),
         H2("Instructions:"),
         Ol(
             [
                 Li("Set the size of the list of symbols."),
                 Li("Set the sum you are going to invest."),
                 Li("Set the specific transaction fee for your grid."),
                 Li(
                     [
                         "Set your current holdings for each symbol ",
                         I("(no information is stored)."),
                     ]
                 ),
                 Li(
                     (
                         "The buying price is the last price (at the specified "
                         "time). Feel free to change it."
                     )
                 ),
                 Li("Place your orders. The order values should be the same."),
             ]
         ),
         I(id="symbols_time"),
     ]
Exemple #9
0
 def __init__(self):
     super(GK_GUI, self).__init__()
     self.app = dash.Dash()
     self.serve_static()
     print(__file__)
     self.vars = {}
     self.get_data()
     self.app.layout = Div(children=[
         H1(children='GEKKO results', style={'text-align': 'center'}),
         Div(className='col-sm-3',
             children=[
                 H3("options['INFO']"),
                 Div(children=[
                     self.make_options_table(self.options['INFO'],
                                             ["Option", "Value"])
                 ]),
                 H3("options['APM']"),
                 Div(children=[
                     self.make_options_table(self.options['APM'],
                                             ["Option", "Value"])
                 ])
             ]),
         Div(className='col-sm-9', children=[self.make_tabs()])
     ])
Exemple #10
0
def create_app():
    app = Flask(__name__)

    dash_app = Dash(__name__,
                    server=app,
                    url_base_pathname='/dash/',
                    external_stylesheets=[{
                        "href":
                        "https://fonts.googleapis.com/css2?"
                        "family=Lato:wght@400;700&display=swap",
                        "rel":
                        "stylesheet",
                    }])

    dash_app.layout = Div(children=[
        Div(children=[
            P(children='📈', className='header-emoji'),
            H1(children='Dash-PTS', className='header-title'),
            P(
                children='''
                        A Free and Open Source project-tracking systems tool:
                        ''',
                className='header-description',
            ),
            P(
                children='https://github.com/dunossauro/dash-pts',
                className='header-description',
            ),
        ],
            className='header'),
        Div(
            children=[
                Div(children=[
                    Div(children='Department', className='menu-title'),
                    Dropdown(id='department-name',
                             options=[{
                                 'label': i,
                                 'value': i
                             } for i in ['Sales', 'R&D', 'Support']],
                             value='R&D',
                             className='dropdown')
                ], ),
                Div(children=[
                    Div(children='Team', className='menu-title'),
                    Dropdown(
                        id='team-name',
                        options=[{
                            'label': i,
                            'value': i
                        } for i in ['Data Science', 'Mobile', 'WEB', 'QA']],
                        value='Mobile',
                        className='dropdown')
                ], ),
            ],
            className='menu',
        ),
        Div(
            children=[
                Graph(
                    id='burn-down',
                    className='card',
                    config={'displayModeBar': False},
                ),
                Graph(
                    id='velocity',
                    className='card',
                    config={'displayModeBar': False},
                )
            ],
            className='wrapper',
        )
    ], )

    @app.route('/dash')
    def index():
        return dash_app.index()

    @dash_app.callback([
        Output(component_id='burn-down', component_property='figure'),
        Output(component_id='velocity', component_property='figure'),
    ], [
        Input(component_id='team-name', component_property='value'),
        Input(component_id='department-name', component_property='value'),
    ])
    def generate_graphs(team_name, department_name):
        return (burn_down(
            sprint='',
            initial_data=datetime(2021, 4, 5),
            final_data=datetime(2021, 4, 16),
            total_points=50,
            sprint_data=[50, 45, 41, 37, 39, 39, 39, 35, 27, 13],
        ),
                velocity({
                    'names': ['Sprint ' + str(x) for x in range(1, 7)],
                    'commitment': [50, 47, 61, 53, 50, 51],
                    'completed': [52, 43, 58, 58, 49, 39],
                }))

    return app
Exemple #11
0
dates = prices_df.date.unique()
shops = prices_df.shop.unique()
shops = np.append(shops, ["All"])



#TODO:
#Dropdown limit

today = date.today().strftime("%Y-%m-%d")
prices_today = prices_df[prices_df['date']==today]
fig = px.bar(prices_today, x='name', y='price',title="Product Prices")

bars_page = [
    Container([
      H1('Bar plot'),
      H4('Select Date'),
      dcc.Dropdown(
        id='dateDropdown',
        options=[{'label': i, 'value': i} for i in dates],
        value=[i for i in dates]),
        
      H4('Select shop'),
      dcc.Dropdown(
        id='shopDropdown',
        options=[{'label': i, 'value': i} for i in shops],
        value=[i for i in shops]),

    H4('Select type of product'),
      dcc.Dropdown(
        id='productDropdown',
Exemple #12
0
from dash_html_components import Div, H1

from modules.utils import colors


layout_error_404 = Div([
    H1(
        children='404 - Page not found',
        style={
            'textAlign': 'center',
            'color': colors['text']
        }
    )
])
Exemple #13
0
config = {'edits': {'shapePosition': True}}

graphdcc = dcc.Graph(id='tested_graph',
                     figure=wind_figure(dflb,
                                        times=[('2018-12-12', '2018-12-13')]),
                     style={
                         "width": "98%",
                         'height': '98%'
                     },
                     config=config)

div0 = TileDiv([Span("Page de test des tracés", className='app-title')],
               className="header")
div1 = TileDiv([graphdcc], nrows=8, className='chart_div')
div2 = TileDiv(
    [H1("Relayout data"), P(id='relayout-data')],
    nrows=4,
    className='chart_div')
div3 = TileDiv([P('some text')], className='chart_div')

apptest.layout = Div(generate_layout(div0, div1, div2, div3))


@apptest.callback(Output('relayout-data', 'children'),
                  [Input('tested_graph', 'relayoutData')])
def display_selected_data(relayoutData):
    return json.dumps(relayoutData, indent=2)


# @apptest.callback(
# Output('tested_graph','figure'),
Exemple #14
0
from dash.dependencies import Input as DInput
from dash.dependencies import Output as DOutput
from dotmap import DotMap as dot
import pandas as pd
import dash_table
import datetime as date
import dash_core_components as dcc

__prices_file = 'csv/prices.csv'

prices_df = pd.read_csv(__prices_file)
productOptions = prices_df.kind.unique()

table_page = [
    Container([
        H1('Table'),
        H4('Select type of product'),
        dcc.Dropdown(id='productDropdown',
                     options=[{
                         'label': i,
                         'value': i
                     } for i in productOptions],
                     value=[i for i in productOptions]),
        dash_table.DataTable(columns=[{
            'name': 'Name',
            'id': 'name',
            'type': 'text'
        }, {
            'name': 'Kind',
            'id': 'kind',
            'type': 'text'
from dash_html_components import Div, Img, Button, H2, H1, P, Hr, A, Span, Label
from templates.wordcloud import wordloud_controls
import dash_core_components as dcc
from dash.dependencies import Input, Output, State
from app import app
from templates.wordcloud import make_word_cloud, footer
from templates.amazonIframe import amazonMusicProduct
import lorem

body = Div([
    Div([
        Div([
            H1("Copy & Paste Word Cloud Generator", className='display-4'),
            Hr(),
            P('This is the copy & paste word cloud generator. Simply copy and paste the text into the box below.'
              ),
        ],
            className='container')
    ],
        className="jumbotron jumbotron-fluid"),
    Div([
        Div([
            Div('Text Field Wordcloud', className='card-header'),
            dcc.Loading(Div([
                H2('', className='card-title'),
                Div([Img(src='', className='card-img-top', width='100%')],
                    style={'height': 500}),
            ],
                            className='card-body',
                            id='text-field-wordcloud'),
                        style={
Exemple #16
0
    return df_download

df_download = create_df_download(df_base)

minmax = get_minmax_from_df(df_download)


layout = Div([
    # a storage to save the signal to update the tables and graphs
    Store(id='download--store--signal'),

    # title and subtitle
    Div([
        # title
        H1(children='catalog-dash'),
        # subtitle
        H3(children='Download table analysis')
    ], style={'textAlign': 'center', 'color': colors['text']}),

    # top tables - information table, date picker range and limit
    Div([
        # left table - information table
        Div([
            # title
            P(
                children='Table: Information',
                style={'color': colors['text']}
            ),
            # table information
            DataTable(
Exemple #17
0
                   xaxis_type='category')

markdown_text = """
Ez a projekt egy kurzuszáró munka a Rajk Szakkollégium Alkalmazott Adatközpontú Algoritmustervezés kurzusára. 
A projekt lényege, hogy [Github Actions](https://github.com/lentnerbalazs/Vig_Lentner) segítségével naponta kétszer letöltjük 12 magyar hírportál főoldalán található 
cikkeket, majd a szövegekből kinyerjük az oldalak egymásra mutató hivatkozásait. A hivatkozásokból hálózatot építünk 
a cikkek szövegeiből pedig egyszerű leíró statisztikákat készítünk hírportál szerinti bontásban. A megjelenítés Dash 
felületen egy Heroku applikáción keresztül történik.
"""

# layout
app.layout = html.Div(children=[
    H1(
        children=" Hivatkozási hálózat ",
        style={
            "color": "black",
            "backgroundColor": "ffffff",
            "text-align": "center",
        },
    ),
    html.Div(
        children=[
            html.P(
                children=[
                    H3(children="Miről szól a projekt?"),
                    html.Element(dcc.Markdown(children=markdown_text), ),
                ],
                className="six columns",
            ),
            html.Div(
                html.Iframe(
                    srcDoc=open("citation_net_VL_AAA_final.html").read(),
Exemple #18
0
import logging

import dash_table as dt
from dash_bootstrap_components import Button, Col, Container, NavItem, Navbar, Row, Tab, Tabs
from dash_html_components import A, Div, H1, H2, H3

from app1.dashapp.callbacks.callbacks import VISIBILITY_HIDDEN
from app1.dashapp.layout.navs import search_collapse
from app1.dicts import *

logger = logging.getLogger('view')
header = H1('THIS')


def layout(view):
    """
    Layout with the following hierachy
    
    my-content-window
    :param view: app1.viewmodel.DashView 
    :return: dash.Dash().layout
    """
    df = view.df
    busgrps = view.dicts[BUSGRP_ID__BUSGRP_LDESC]

    this_layout = get_main_layout(
        main_window_col_10=get_main_window(),
        side_menu_col_2=get_side_menu(),
        top_navbar=get_top_navbar(busgrps),
    )
    # bottom_navbar = None
from dash_html_components import Div, Img, Button, H2, H1, P, Hr, A, Span, Label
from templates.wordcloud import wordloud_controls
import dash_core_components as dcc
from dash.dependencies import Input, Output, State
from app import app
from templates.wordcloud import make_word_cloud, footer

body = Div([
    Div([
        Div([
            H1("Text Upload Word Cloud Generator", className='display-4'),
            Hr(),
            P('This is the text upload word cloud generator. Simply upload a UTF-8 encoded .txt file.'
              ),
        ],
            className='container')
    ],
        className="jumbotron jumbotron-fluid"),
    Div([
        Div([
            Div('Text Upload Wordcloud', className='card-header'),
            dcc.Loading(Div([
                H2('', className='card-title'),
                Div([Img(src='', className='card-img-top', width='100%')],
                    style={'height': 500}),
            ],
                            className='card-body',
                            id='text-upload-wordcloud'),
                        style={
                            'paddingTop': 200,
                            'paddingBottom': 200
Exemple #20
0
def get_layout(app):
    row_0 = Div([
        H2("Upload to Database (excel file)", style={'textAlign': 'left'}),
        Upload(
            id='upload-data',
            children=Div(['Drag and Drop or ',
                          A('Select Files')]),
            style={
                'width': '100%',
                'height': '60px',
                'lineHeight': '60px',
                'borderWidth': '1px',
                'borderStyle': 'dashed',
                'borderRadius': '5px',
                'textAlign': 'center',
                'margin': '10px'
            },
            # Allow multiple files to be uploaded
            multiple=False),
        Loading(
            id="loading",
            children=[Div(id='output-data-upload')],
            type="default",
        ),
    ])
    row_1 = Div([
        Div([
            H2("Text input", style={'textAlign': 'left'}),
            RadioItems(id='radio1',
                       options=[{
                           'label': 'Partial match',
                           'value': 'PMATCH'
                       }, {
                           'label': 'Exact match',
                           'value': 'EMATCH'
                       }],
                       value='EMATCH',
                       labelStyle={
                           'display': 'inline-block',
                       }),
            Input(id="input1", type="text", placeholder="Query"),
            Br(),
            Button('Start text search', id='button')
        ],
            className='col-6'),
        Div([
            H2("Search field", style={'textAlign': 'left'}),
            RadioItems(id='radio2',
                       options=[{
                           'label': 'Chemical name',
                           'value': 'NAME'
                       }, {
                           'label': 'CAS Number',
                           'value': 'CAS'
                       }, {
                           'label': 'IASO Barcode No.',
                           'value': 'BAR'
                       }],
                       value='NAME',
                       labelStyle={
                           'display': 'inline-block',
                       }),
        ],
            className='col-6')
    ],
                className='row')
    row_2 = Div([
        Div([
            H2("Graphical search type", style={'textAlign': 'left'}),
            RadioItems(id='radio3',
                       options=[{
                           'label': 'Similarity ',
                           'value': 'SIM'
                       }, {
                           'label': 'Substructural ',
                           'value': 'SUB'
                       }, {
                           'label': 'Exact ',
                           'value': 'EX'
                       }],
                       value='SIM',
                       labelStyle={
                           'display': 'inline-block',
                       }),
            DashMarvinJS(id='editor',
                         marvin_url=app.get_asset_url('mjs/editor.html'),
                         marvin_width='100%')
        ],
            className='col-6'),
        Div([
            H2("Search results", style={'textAlign': 'left'}),
            DataTable(
                id='table',
                columns=fields1,
                fixed_rows={
                    'headers': True,
                    'data': 0
                },
                row_selectable='single',
                style_data={
                    'whiteSpace': 'normal',
                    'height': 'auto',
                    'width': 'auto'
                },
                style_table={
                    'overflowY': 'hidden',
                    'overflowX': 'hidden',
                    'margin-left': '0px'
                },
                style_cell={
                    'textAlign': 'left',
                    'padding': '5px',
                    'height': 'auto',
                    'padding-left': '17px',
                    'whiteSpace': 'normal',
                    'minWidth': '10px',
                    'maxWidth': '150px'
                },
                style_as_list_view=True,
                style_cell_conditional=[
                    {
                        'if': {
                            'column_id': 'Picture'
                        },
                        'width': '60%'
                    },
                    {
                        'if': {
                            'column_id': 'Brutto formula'
                        },
                        'width': '10%'
                    },
                    {
                        'if': {
                            'column_id': 'Chemical name'
                        },
                        'width': '15%'
                    },
                    {
                        'if': {
                            'column_id': 'CAS No.'
                        },
                        'width': '10%'
                    },
                ],
            )
        ],
            className='col-6')
    ],
                className='row')
    row_3 = DataTable(
        id='table2',
        columns=fields2,
        fixed_rows={
            'headers': True,
            'data': 0
        },
        #row_selectable='single',
        editable=True,
        row_deletable=True,
        style_data={
            'whiteSpace': 'normal',
            'height': 'auto'
        },
        style_table={
            'maxHeight': '500px',
            'overflowY': 'hidden',
            'overflowX': 'hidden',
            'margin-left': '0px'
        },
        style_cell={
            'textAlign': 'left',
            'padding': '10px',
            'padding-left': '20px',
            'height': 'auto',
            'whiteSpace': 'normal',
            'minWidth': '120px',
            'width': '150px'
        },
        #style_cell_conditional=[
        #    {'if': {'column_id': 'Quantity'},
        #     'width': '150px'},
        #   {'if': {'column_id': 'Quantity unit'},
        #     'width': '150px'},
        #],
        style_as_list_view=True)
    row_4 = Div([
        Button('Add Row', id='addrow', n_clicks=0),
        Button('Submit changes', id='submit', n_clicks=0),
        ConfirmDialog(
            id='confirm',
            message=
            'All changes will be applied from now! Are you sure you want to continue?',
        )
    ])

    layout = Div([
        H1("Chemicals Storage", style={'textAlign': 'center'}), row_0,
        Hr(), row_1,
        Hr(), row_2,
        Hr(), row_3,
        Hr(), row_4
    ])
    return layout
__prices_file = 'csv/prices.csv'

prices_df = pd.read_csv(__prices_file)
names = prices_df["name"].unique()
names = names[1:20]

shops = prices_df.shop.unique()

selected = dot({'shop': None, 'kind': None})
#TODO:
#Dropdown limit
#Shop dropdown?
#Line
evolution_page = [
    Container([
        H1('Evolution'),
        H4('Select product'),
        P("Shop"),
        dcc.Dropdown(id='shopEvo',
                     options=[{
                         'label': i,
                         'value': i
                     } for i in shops],
                     value=[i for i in shops],
                     placeholder="Shop"),
        P("Kind"),
        dcc.Dropdown(id='productEvo', ),
        Button("Load Products", id="LoadNamesEvo", n_clicks=0),
        P("Product name"),
        dcc.Dropdown(id='evolutionDropdown', ),
        dcc.Graph(id="evolutionGraph")
Exemple #22
0
from app import app
from dash_bootstrap_components import Container
from dash_html_components import H1
from dash.dependencies import Input as DInput
from dash.dependencies import Output as DOutput
from dotmap import DotMap as dot
import pandas as pd

import dash_core_components as dcc

__prices_file = 'csv/prices.csv'

prices_df = pd.read_csv(__prices_file)
dates = prices_df.name.unique()
home_page = [
    Container([
        H1('Home'),
        dcc.Dropdown(id='dateDropdown',
                     options=[{
                         'label': i,
                         'value': i
                     } for i in dates],
                     value=[i for i in dates]),
    ],
              id='app-main-home')
]
Exemple #23
0
from dash_core_components import Link
from dash_html_components import Br, Div, H1, H3

from app import url_base_pathname
from modules.utils import colors

layout = Div([
    # title
    H1(children='catalog-dash',
       style={
           'textAlign': 'center',
           'color': colors['text']
       }),
    # subtitle
    H3(children='Index',
       style={
           'textAlign': 'center',
           'color': colors['text']
       }),
    Link('Scene', href='{}/scene'.format(url_base_pathname)),
    Br(),
    Link('Download', href='{}/download'.format(url_base_pathname))
])
Exemple #24
0
    'kind':         None
})
selectedTwo   = dot({
    'shop':         None,
    'kind':         None
})

__prices_file = 'csv/prices.csv'

prices_df = pd.read_csv(__prices_file)
names = prices_df["name"].unique()
shops = prices_df.shop.unique()

comp_page = [
    Container([
    H1('Comparator'),
    #First Product
    H4('Select first product'),
    P("Shop"),
    dcc.Dropdown(
        id='shopCompOne',
        options=[{'label': i, 'value': i} for i in shops],
        value=[i for i in shops],
        placeholder="Shop"),
    P("Kind"),
      dcc.Dropdown(
        id='productCompOne',
        ),
    Button("Load Products", id="LoadNamesCompOne", n_clicks=0),
    P("Product name"),
    dcc.Dropdown(
Exemple #25
0
# correl plot
fig = px.scatter(
    players,
    x="rating",
    y="closeness centrality",
    trendline="ols",
    hover_name="playerName",
)
fig.update_layout(title_text="Closeness centrality and rating of players")

#layout
app.layout = html.Div(children=[
    H1(
        children=f"{match_title} pass network",
        style={
            "color": "black",
            "backgroundColor": "ffffff",
            "text-align": "center",
        },
    ),
    html.Div(
        children=[
            html.Div(
                children=[
                    H3(children="mi ez a cucc?"),
                    html.Element(
                        children="babababababababababbabaaabababababababababab",
                    ),
                ],
                className="six columns",
            ),
            html.Div(
        ),
    ],
    brand="Stock Data",
    brand_href="#",
    sticky="top",
)

body = boots.Container(
    [
        boots.Row(
            [
                boots.Col(
                    [
                        H1(
                            'Search Stocks',
                            className='',
                            id=''
                          ),
                        Span(
                            'Examples: COKE, TSLA, MSFT, CYH.'
                        ),
                        core.Input(
                            id='ticker_input',
                            value='MSFT',
                            className='input'
                        )
                    ],
                    className='col-4 mb-4'
                ),
                boots.Col(
                    [
from dash.dependencies import Input, Output
from random import randint

app = Dash(__name__)

N = 20

database = {
    'index': list(range(N)),
    'maiores': [randint(1, 1000) for _ in range(N)],
    'menores': [randint(1, 1000) for _ in range(N)],
    'bebes': [randint(1, 1000) for _ in range(N)],
}

app.layout = Div(children=[
    H1('Evento X'),
    H3('idade das pessoas que foram ao evento'),
    Checklist(id='meu_check_list',
              options=[{
                  'label': 'Menores de Idade',
                  'value': 'menores'
              }, {
                  'label': 'Bebes',
                  'value': 'bebes'
              }, {
                  'label': 'Maiores de idade',
                  'value': 'maiores'
              }],
              value=['bebes']),
    Dropdown(id='meu_dropdown',
             options=[
from dash_html_components import Div, Img, Button, H2, H1, P, Hr, A, Span, Label
from templates.wordcloud import wordloud_controls
import dash_core_components as dcc
from dash.dependencies import Input, Output, State
from templates.wordcloud import make_word_cloud, footer
from templates.amazonIframe import amazonPrimeVideoProduct
from app import app
import wikipedia

body = Div([
    Div([
        Div([
            H1("Wikipedia Word Cloud Generator", className='display-4'),
            Hr(),
            P('This is the Wikipedia word cloud generator. Simply Enter the Article Name (exactly as seen on the wiki page) and click generate. Alternatively\
               grab a random wikipedia article with the click of a button.')
        ],
            className='lead container')
    ],
        className="jumbotron jumbotron-fluid"),
    Div(
        [
            # amazonPrimeVideoProduct,
            Div([
                Div('Wikipedia Wordcloud', className='card-header'),
                dcc.Loading(Div([
                    H2('', className='card-title'),
                    Div([Img(src='', className='card-img-top', width='100%')],
                        style={'height': 500}),
                ],
                                className='card-body',
Exemple #29
0
from dash_core_components import Link
from dash_html_components import Br, Div, H1, H3

from app import url_base_pathname
from modules.utils import colors


layout = Div([
    # title
    H1(
        children='publisher-dash',
        style={
            'textAlign': 'center',
            'color': colors['text']
        }
    ),
    # subtitle
    H3(
        children='Index',
        style={
            'textAlign': 'center',
            'color': colors['text']
        }
    ),
    # Link('Scene', href=f'{url_base_pathname}/scene'),
    Br(),
    Link('Publisher', href=f'{url_base_pathname}/publisher')
])
Exemple #30
0
            Div([
                H5(title, className='card-title'),
                P(text, className='card-text')
            ], className='card-body'),
            Div([
                dcc.Link(btn_text, href=btn_href, className='btn btn-primary', style={'color': 'white'})
            ], className='card-footer')
        ], className='card')

    return body

body = Div([
    Div([
        Div([
            Div([
                H1("Word Cloud World", className='display-4 text-center'),
                Img(src="/static/world.png", width="300", height="300", alt="",
                    style={'display': 'block', 'margin': '0 auto'})
            ], className=''),
            P("Welcome!", className="lead text-center"),
            Hr()
        ], className='container')
    ], className="jumbotron jumbotron-fluid", style={'background-image': '/static/world.png'}),
    Div([
        P("""Welcome to Word Cloud World! Word clouds are a creative way to visually represent textual data.
             They allow you to see the most significant or frequent words used in any body of text.
             Here at Word Cloud World we have created automated apps to visualise Wikipedia articles or Song lyrics.
             You can also create your own word cloud by cutting and pasting text or by uploading a textfile!
             You can customize your word cloud by changing its colour, shape and size.
        """),
        H5('Some Inspiration'),