Пример #1
0
    html.Hr(className="my-2"),
    html.P("Nous avons donc déterminé la problématique suivante :"),
    html.P(
        "En analysant les caractéristiques principales d'un mail et de la personne qui le reçoit, peut on estimer "
        "le temps de réponse par rapport à la thématique abordée ?",
        className="alert-link",
    ),
    html.P(dbc.Button("Visualiser les données",
                      id="dataB",
                      href="/data",
                      color="primary",
                      block=True),
           className="lead"),
])
table_analyse_variance = dbc.Container([
    html.H3("Table d’analyse de la variance"),
    html.Hr(className="my-2"),
    html.
    P("Après analyse de nos 188 thèmes et des temps de réponses associés, grâce à la méthode de l’anova, "
      "nous obtenons une p-value proche de 1. Celle-ci nous indique que nous ne pouvons pas rejeter H0. Nous ne "
      "pouvons donc pas affirmer que le thème d’un mail influe le temps de réponse de la personne qui le reçoit "
      "(au risque alpha = 0.05). "),
])

graphiques_associes = dbc.Container([
    html.H3("Graphiques associés"),
    html.Hr(className="my-2"),
])

graphique_boxplot = dbc.Container([
    html.
Пример #2
0
def generate_prop_table(component_name, component_names, library_name):
    '''Generate a prop table for each component (both React and Python).

    :param (str) component_name: The name of the component as it is
    defined within the package.
    :param (dict[list]) component_names: A dictionary defining which
    components are React components, and which are Python
    components. The keys in the dictionary are 'react' and 'python',
    and the values for each are lists containing the names of the
    components that belong to each category.
    :param (str) library_name: The name of the library.

    :rtype (object): An html.Table containing data on the props of the component.

    '''

    regex = {
        'python':
        r'^\s*([a-zA-Z_]*)\s*\(([a-zA-Z\/]*);\s*([a-z]*)\):\s*(.*?)\s*(\(Default:\s*(.*)\)|)\s*$'
    }

    component_type = 'react' \
        if component_name in component_names['react'] else 'python'

    tableRows = [
        html.Tr([
            html.Th('Attribute'),
            html.Th('Description'),
            html.Th('Type'),
            html.Th('Default value')
        ])
    ]

    exec("import {}".format(library_name))

    if component_type == 'python':
        sep = '\n-'
        doc = eval("{}.{}".format(library_name, component_name)).__doc__

        props = doc.split(sep)

    elif component_type == 'react':

        path = os.path.join(
            os.path.dirname(os.path.abspath(eval(library_name).__file__)),
            'metadata.json')
        with open(path, 'r') as f:
            metadata = json.load(f)

        # Mol3d for some reason is a plain JS file, not a react file
        cname = '{}.react.js'.format(component_name)
        if component_name == 'Molecule3dViewer':
            cname = 'Molecule3dViewer.js'
        elif component_name == 'Molecule2dViewer':
            cname = 'Molecule2dViewer.react.js'
        docs = metadata['src/lib/components/{}'.format(cname)]

        props = docs['props']

    for prop in props:
        if component_type == 'python':
            desc_sections = prop.split('\n\n')

            partone = desc_sections[0].replace('    ', ' ')

            r = re.match(re.compile(regex[component_type]),
                         partone.replace('\n', ' '))

            if r is None:
                continue

            (prop_name, prop_type, prop_optional, prop_desc, _,
             prop_default) = r.groups()
            if prop_default is None:
                prop_default = ''
            if 'optional' in prop_optional:
                prop_optional = ''

            if len(desc_sections) > 1:
                prop_desc += ' '
                prop_desc += desc_sections[1]

        elif component_type == 'react':
            prop_name = prop
            prop_desc = props[prop]['description']
            prop_type = js_to_py_type(props[prop]['type'])

            if 'defaultValue' in props[prop].keys():
                prop_default = props[prop]['defaultValue']['value']
            else:
                prop_default = ''

        tableRows.append(
            html.Tr([
                html.Td(rc.Markdown(prop_name)),
                html.Td(rc.Markdown(prop_desc)),
                html.Td(rc.Markdown(prop_type)),
                html.Td(rc.Markdown('```python \n' + prop_default + '\n```'))
            ]))

    return html.Div([
        html.H3("{} Properties".format(component_name)),
        html.Table(tableRows)
    ])
Пример #3
0
)

alerts = html.Div(
    [
        html.H2("Alerts"),
        dbc.Alert("This is an alert", color="primary"),
        dbc.Alert("Danger!", color="danger"),
    ]
)

badges = html.Div(
    [
        html.H2("Badges"),
        html.H3(
            [
                "This is a heading with a badge!",
                dbc.Badge("New!", color="success"),
            ]
        ),
    ]
)

buttons = html.Div(
    [
        html.H2("Buttons"),
        html.Div(
            [
                dbc.Button("Primary", color="primary", className="mr-1"),
                dbc.Button("Secondary", color="secondary", className="mr-1"),
                dbc.Button("Success", color="success", className="mr-1"),
                dbc.Button("Warning", color="warning", className="mr-1"),
                dbc.Button("Danger", color="danger", className="mr-1"),
Пример #4
0
                       ]),
          ]),
 html.Div([
     dbc.Row(
         style={
             'background-color': 'white',
             'margin': '0px 0px 0px 0px'
         },
         children=[
             dbc.Col([
                 dbc.Card(
                     id='first-card',
                     style={'margin': '10px 10px 10px 10px'},
                     children=[
                         html.H3(
                             'Parameter',
                             style={'margin': '10px 10px 0px 0px'},
                         ),
                         drc.NamedRadioItems(
                             name='Modell',
                             id="radios",
                             options=[
                                 {
                                     "label": "Simplifiziertes Modell",
                                     "value": 1
                                 },
                                 {
                                     "label": "Sonnensystem",
                                     "value": 2
                                 },
                                 {
                                     "label": "Eigener Input",
Пример #5
0
import plotly.graph_objects as go
import DatosRecientes.dataframe as datos
#import dash_bootstrap_components as dbc

datos_recientes_layout = html.Div(
    [
        #Div que contiene el titulo de la pagina
        html.Div(
            [
                html.Div(id='retorno-reportes', style={'display': 'none'}),
                html.Div(
                    [
                        html.H3(
                            "Datos Recientes",
                            style={
                                'color': 'Black',
                                'font-weight': 'bold',
                                "margin-bottom": "0px"
                            },
                        ),
                        html.H5("Plataforma Monitoreo Salud Estructural",
                                style={"margin-top": "0px"}),
                    ],
                    className="one-half column",
                    id="title",
                ),
                html.Div(
                    [
                        html.A(
                            dcc.Loading(id="carga-reportes",
                                        children=[
                                            html.Button(
Пример #6
0
     ],
     style={
         "background-color": "#0F1328",
         "border - bottom - style": "solid"
     }),
 dcc.Tabs([
     dcc.Tab(
         label='Welcome',
         children=[
             html.Div(
                 [
                     html.Br(),
                     html.Br(),
                     html.H3("Welcome to",
                             style={
                                 "color": "white",
                                 "text-align": "center",
                             }),
                     html.H2("AZTECH DIGITAL SOLUTIONS",
                             style={
                                 "color": "#92E0D3",
                                 "text-align": "center",
                             }),
                     html.H4(
                         "Aztech Digital is a business analytics tool that aims at providing non-data science savvies with the opportunity to turn data-driven."
                         "If you hold a business and do not have the technical knowledge or staff to handle your daily operations and transactions, this is the place."
                         "You will find below the steps to be able to use this application successfully. If you have advanced needs or would like a customized dashboard, reach out to us at [email protected].",
                         style={
                             "color": "white",
                             "text-align": "Justify",
                             "font-family": "Montserrat",
Пример #7
0
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_table as dt
from . import config as cfg
from dash.dependencies import Input, Output

from .helper import Table, Date, Death, Case, Recovery, Rate, Report
from .static import TitleStyle, TabStyle, TabSelectedStyle, TabIframeStyle, TableHeaderStyle

external_stylesheet = cfg.css_url
app = dash.Dash(__name__, external_stylesheets=external_stylesheet)

app.layout = html.Div([
    html.H3(children='COVID-19 ဗိုင်းရပ်ဒေတာ', style=TitleStyle.title_style),
    html.Br(),
    dcc.Tabs(id="covid19-data",
             value='covid-19 ဗိုင်းရပ်ဖြစ်စဉ်',
             children=[
                 dcc.Tab(label='သေဆုံးနှုန်း',
                         value='သေဆုံးနှုန်း',
                         style=TabStyle.tab_style,
                         selected_style=TabSelectedStyle.tab_selected_style),
                 dcc.Tab(label='ကူးစက်နှုန်း',
                         value='ကူးစက်နှုန်း',
                         style=TabStyle.tab_style,
                         selected_style=TabSelectedStyle.tab_selected_style),
                 dcc.Tab(label='ပျောက်ကင်းနှုန်း',
                         value='ပျောက်ကင်းနှုန်း',
                         style=TabStyle.tab_style,
                         selected_style=TabSelectedStyle.tab_selected_style),
Пример #8
0
loggedin = html.Div(
    [
        html.Div(
            [
                html.Div(
                    [
                        html.P(id="current_date"),
                        html.P(id="current_time"),
                    ],
                    className="one-third column",
                ),
                html.Div(
                    [
                        html.Div([
                            html.H3(
                                "Ignite E-Health Initiative",
                                style={"margin-bottom": "0px"},
                            ),
                            html.H5(id="connection_status",
                                    style={"margin-top": "0px"}),
                        ])
                    ],
                    className="one-half column",
                    id="title",
                ),
                html.Div(
                    [
                        html.A(
                            html.Button("Zurück", id="back-button"),
                            href="/profile",
                        )
                    ],
Пример #9
0
def dashboard(china_df, other_country_df, trends_data):
    app = dash.Dash()
    trends_country = [
        'China', 'Japan', 'South Korea', 'Singapore', 'United States',
        'United Kingdom', 'Australia', 'Worldwide'
    ]

    colors = {
        'screen': '#D3D3D3',
        'background': '#111111',
        'text': '#7FDBFF',
        'dropdown': 'orange'
    }

    app.layout = html.Div(
        style={
            'rows': 2,
            'backgroundColor': colors['background']
        },
        children=[
            html.Div(
                style={
                    'color': colors['text'],
                    'textAlign': 'center'
                },
                children=[
                    html.H1(
                        children=
                        "Corona Virus Trends in different Parts of the World"),
                    html.Div(
                        style={'columns': 2},
                        children=[
                            html.Div([
                                html.Div(
                                    [
                                        dcc.Dropdown(id='country-trends',
                                                     options=[{
                                                         'label': i,
                                                         'value': i
                                                     } for i in trends_country
                                                              ],
                                                     value='China')
                                    ],
                                    style={
                                        'color': colors['text'],
                                        'width': '50%',
                                        'display': 'inline-block'
                                    })
                            ]),
                            html.H2(id='title1',
                                    style={
                                        'textAlign': 'center',
                                        'color': colors['text']
                                    }),
                            dcc.Graph(id='Trends',
                                      style={
                                          'textAlign': 'center',
                                          'color': colors['text'],
                                          'backgroundColor':
                                          colors['background']
                                      }),
                            html.Div([
                                html.Div([
                                    html.Div(
                                        [
                                            dcc.Dropdown(
                                                id='country-info',
                                                options=[{
                                                    'label':
                                                    i,
                                                    'value':
                                                    i
                                                } for i in ['China', 'World']],
                                                value='China')
                                        ],
                                        style={
                                            'color': colors['text'],
                                            'width': '50%',
                                            'display': 'inline-block'
                                        })
                                ]),
                                html.H2(id='title2',
                                        style={
                                            'textAlign': 'center',
                                            'color': colors['text'],
                                            'display': 'inline-block'
                                        }),
                                html.Div(style={'columns': 2},
                                         children=[
                                             dcc.Graph(id='Info-1',
                                                       style={
                                                           'textAlign':
                                                           'center',
                                                           'color':
                                                           colors['text'],
                                                           'backgroundColor':
                                                           colors['background']
                                                       }),
                                             dcc.Graph(id='Info-2',
                                                       style={
                                                           'textAlign':
                                                           'center',
                                                           'color':
                                                           colors['text'],
                                                           'backgroundColor':
                                                           colors['background']
                                                       })
                                         ])
                            ])
                        ]),
                    html.Div(style={'color': colors['text']},
                             children=[
                                 html.H3(id='Wuhan',
                                         style={
                                             'textAlign': 'center',
                                             'align': 'between',
                                             'color': colors['dropdown'],
                                             'display': 'inline-block'
                                         })
                             ])
                ])
        ])

    @app.callback(Output('title1', 'children'),
                  [Input('country-trends', 'value')])
    def title1_text(country):
        return "Trends of Covid19 - " + country

    @app.callback(Output('Trends', 'figure'),
                  [Input('country-trends', 'value')])
    def update_graphTrends(country):
        df = trends_data[country]
        y_val = 'Coronavirus: (' + country + ')'
        return {
            'data': [{
                'x': df['Day'],
                'y': df[y_val],
                'type': 'line'
            }],
            'layout': {
                'plot_bgcolor': colors['background'],
                'paper_bgcolor': colors['background'],
                'font': {
                    'color': colors['text']
                }
            }
        }

    @app.callback(Output('title2', 'children'),
                  [Input('country-info', 'value')])
    def title2_text(country):
        return "Information of Covid19 in " + country

    @app.callback(Output('Info-1', 'figure'), [Input('country-info', 'value')])
    def update_graphInfo1(country):
        if country == 'China':
            df = china_df
            x_val = df['MAINLAND CHINA'][1:-1]
            y_val = df['Cases'][1:-1]

            figure_value = {
                'data': [{
                    'x': x_val,
                    'y': y_val,
                    'type': 'bar',
                    'name': 'Cases'
                }],
                'layout': {
                    'title': 'Number of Cases',
                    'plot_bgcolor': colors['background'],
                    'paper_bgcolor': colors['background'],
                    'font': {
                        'color': colors['text']
                    }
                }
            }

        else:
            df = other_country_df
            x_val = df['OTHER PLACES'][:-1]
            y_val = df['Cases'][:-1]
            figure_value = {
                'data': [{
                    'x': x_val,
                    'y': y_val,
                    'type': 'bar',
                    'name': 'Cases'
                }],
                'layout': {
                    'title': 'Number of Cases',
                    'margin': dict(l=50, r=50, t=50, b=50),
                    'plot_bgcolor': colors['background'],
                    'paper_bgcolor': colors['background'],
                    'font': {
                        'color': colors['text']
                    }
                }
            }

        return figure_value

    @app.callback(Output('Info-2', 'figure'), [Input('country-info', 'value')])
    def update_graphInfo2(country):
        if country == 'China':
            df = china_df
            x_val = df['MAINLAND CHINA'][1:-1]
            y_val = df['Deaths'][1:-1]

            figure_value = {
                'data': [
                    {
                        'x': x_val,
                        'y': y_val,
                        'type': 'bar',
                        'name': 'Deaths'
                    },
                ],
                'layout': {
                    'title': 'Number of Deaths',
                    'plot_bgcolor': colors['background'],
                    'paper_bgcolor': colors['background'],
                    'font': {
                        'color': colors['text']
                    }
                }
            }

        else:
            df = other_country_df
            x_val = df['OTHER PLACES'][:-1]
            y_val = df['Deaths'][:-1]

            figure_value = {
                'data': [
                    {
                        'x': x_val,
                        'y': y_val,
                        'type': 'bar',
                        'name': 'Deaths'
                    },
                ],
                'layout': {
                    'title': 'Number of Deaths',
                    'margin': dict(l=50, r=50, t=50, b=50),
                    'plot_bgcolor': colors['background'],
                    'paper_bgcolor': colors['background'],
                    'font': {
                        'color': colors['text']
                    }
                }
            }

        return figure_value

    @app.callback(Output('Wuhan', 'children'),
                  [Input('country-info', 'value')])
    def title2_text(country):
        if country == 'China':
            info = china_df[0:1].values
            text = info[0][0]
            text = text + "<=>    Cases = " + info[0][1]
            text = text + "<=>    Deaths = " + info[0][2]
            text = text + "<=>     " + info[0][3]
        else:
            info = other_country_df[-1:].values
            text = "World " + info[0][0]
            text = text + "<=>    Cases = " + info[0][1]
            text = text + "<=>    Deaths = " + info[0][2]
            text = text + "<=>     " + info[0][3]
        return text

    return app
Пример #10
0
        tab_style=eq_width,
    ),
    dbc.Tab(
        qui_sommes_nous,
        label="Qui sommes-nous ?",
        tab_style=eq_width,
    ),
    dbc.Tab(
        telechargement_rapport,
        label="Télécharger le rapport",
        tab_style=eq_width,
    ),
], )

tabs_intro_title = html.Div([
    html.H3("Introduction à l'outil", style={"color": "#8ec63f"}), tabs_intro
])

button_generate = dbc.Button(
    "Générer l'analyse !",
    color="primary",
    block=True,
    id="button-generate",
    size="lg",
)

button_adjust = dbc.Button(
    "Ajuster l'analyse !",
    color="primary",
    block=True,
    id="button-adjust",
Пример #11
0
img = data.camera()
fig = px.imshow(img, binary_string=True)
fig.update_layout(dragmode="drawrect")
fig_hist = px.histogram(img.ravel())

options = [{
    'label': obj.descricao,
    'value': obj.id
} for obj in MetaImagem.objects.all()]

# Build App
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = DjangoDash('Imagem', external_stylesheets=external_stylesheets)
app.layout = html.Div([
    html.H3("Selecione a imagem"),
    dcc.Dropdown(
        id='dropdown',
        options=options,
        value=options[0]['value'],
    ),
    html.Div(
        [
            dcc.Graph(id="imagem"),
        ],
        style={
            "width": "60%",
            "display": "inline-block",
            "padding": "0 0"
        },
    ),
Пример #12
0
    html.Div([
        html.P("\
								Welcome to the control program of the Fast Neutron Laboratory's Neutron Generator. ",
               style={"margin-left": "10%"},
               className='header__text'),
        html.P("\
								You can find the manual for the control here: LTH_Neutimag\\hkromer\\Neutron_generator_documentation. ",
               style={"margin-left": "10%"},
               className='row'),
    ],
             className="one-third column"),
    html.Div([
        html.H3(
            "Navigation",
            style={
                "margin-bottom": "5%",
                "letter-spacing": "0.23rem"
            },
        ),
        html.Hr(),
        html.A('Go to Experiment editor',
               href='/apps/app_experiment',
               target="_blank",
               style={"font-size": "1.6em"}),
        html.Hr(),
        html.A('Go to Sensor readout',
               href='/apps/app_sensor_readout',
               target="_blank",
               style={"font-size": "1.6em"}),
        html.Br(),
        html.A('Go to Sensor control',
Пример #13
0
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
server = app.server
app.title=tabtitle

########### Set up the layout
app.layout = html.Div(children=[
    #html.H1(myheading,style={"margin-left": "300px","margin-top": "50px"}),
    html.Div(
    [
     html.Div(
                [
                    html.Div(
                        [
                            html.H3(
                                "美国大学生数学建模竞赛(MCM/ICM)获奖数据可视化",
                            ),
                        ]
                    )
                ],
           
            id="title",
            className="nine columns named-card",
            ),
                        
                        
        
        html.Div(
                    [
                        html.Img(
                            src=app.get_asset_url("dash-logo.png"),
Пример #14
0
def render_content(tab):
    if tab in statelist:
        return html.Div([
            dbc.Container([
                dbc.Row([
                    dbc.Col(
                        html.Div(
                            dcc.Graph(id='emissions_total',
                                      figure=fig_emissions_total))),
                    dbc.Col(
                        html.Div(
                            dcc.Graph(id='value_added_total',
                                      figure=fig_added_value_total))),
                ]),
                dbc.Row([
                    dbc.Col((html.Div(html.H3('Sector'))), width=2),
                    dbc.Col((html.Div(
                        html.H3('Annaul industry emission reduction'))),
                            width=2),
                    dbc.Col((html.Div(
                        html.H3('Industry gross added value growth'))),
                            width=2),
                ]),
                dbc.Row([
                    dbc.Col((html.Div(html.H6(''))), width=2),
                    dbc.Col(
                        (html.Div(html.H6('(Mt CO2-eq per year)'))), width=2),
                    dbc.Col(
                        (html.Div(html.H6('(% annual change in 2019 AUD)'))),
                        width=2),
                ]),
                dbc.Row([
                    dbc.Col((html.Div(html.H6('Services'))), width=2),
                    dbc.Col((html.Div(
                        dcc.Slider(id='services_emis_slider',
                                   min=-20,
                                   max=20,
                                   value=-0.32,
                                   step=0.01,
                                   marks={
                                       -20: '-20',
                                       -10: '-10',
                                       0: '0',
                                       10: '10',
                                       20: '20'
                                   }))),
                            width=2),
                    dbc.Col((html.Div(html.H6('Placeholder for slider'))),
                            width=2),
                ],
                        style={"background-color": "rgba(23,190,207,0.8)"}),
                dbc.Row([
                    dbc.Col((html.Div(html.H6('Mining'))), width=2),
                    dbc.Col((html.Div(
                        dcc.Slider(id='mining_emis_slider',
                                   min=-20,
                                   max=20,
                                   value=2.90,
                                   step=0.01,
                                   marks={
                                       -20: '-20',
                                       -10: '-10',
                                       0: '0',
                                       10: '10',
                                       20: '20'
                                   }))),
                            width=2),
                    dbc.Col((html.Div(html.H6('Placeholder for slider'))),
                            width=2),
                ],
                        style={"background-color": "rgba(127,127,127,0.8)"}),
                dbc.Row([
                    dbc.Col((html.Div(html.H6('Manufacturing'))), width=2),
                    dbc.Col((html.Div(
                        dcc.Slider(id='manufacturing_emis_slider',
                                   min=-20,
                                   max=20,
                                   value=1.83,
                                   step=0.01,
                                   marks={
                                       -20: '-20',
                                       -10: '-10',
                                       0: '0',
                                       10: '10',
                                       20: '20'
                                   }))),
                            width=2),
                    dbc.Col((html.Div(html.H6('Placeholder for slider'))),
                            width=2),
                ],
                        style={"background-color": "rgba(188,189,34,0.8)"}),
                dbc.Row([
                    dbc.Col((html.Div(html.H6('Gas, water & waste services'))),
                            width=2),
                    dbc.Col((html.Div(
                        dcc.Slider(id='gas_water_waste_emis_slider',
                                   min=-20,
                                   max=20,
                                   value=0.31,
                                   step=0.01,
                                   marks={
                                       -20: '-20',
                                       -10: '-10',
                                       0: '0',
                                       10: '10',
                                       20: '20'
                                   }))),
                            width=2),
                    dbc.Col((html.Div(html.H6('Placeholder for slider'))),
                            width=2),
                ],
                        style={"background-color": "rgba(227,119,194,0.8)"}),
                dbc.Row([
                    dbc.Col((html.Div(html.H6('Construction'))), width=2),
                    dbc.Col((html.Div(
                        dcc.Slider(id='construction_emis_slider',
                                   min=-20,
                                   max=20,
                                   value=-0.14,
                                   step=0.01,
                                   marks={
                                       -20: '-20',
                                       -10: '-10',
                                       0: '0',
                                       10: '10',
                                       20: '20'
                                   }))),
                            width=2),
                    dbc.Col((html.Div(html.H6('Placeholder for slider'))),
                            width=2),
                ],
                        style={"background-color": "rgba(140,86,75,0.8)"}),
                dbc.Row([
                    dbc.Col(
                        (html.Div(html.H6('Commercial transport'))), width=2),
                    dbc.Col((html.Div(
                        dcc.Slider(id='com_transp_emis_slider',
                                   min=-20,
                                   max=20,
                                   value=-0.71,
                                   step=0.01,
                                   marks={
                                       -20: '-20',
                                       -10: '-10',
                                       0: '0',
                                       10: '10',
                                       20: '20'
                                   }))),
                            width=2),
                    dbc.Col((html.Div(html.H6('Placeholder for slider'))),
                            width=2),
                ],
                        style={"background-color": "rgba(148,103,189,0.8)"}),
                dbc.Row([
                    dbc.Col((html.Div(html.H6('Agriculture & Forestry'))),
                            width=2),
                    dbc.Col((html.Div(
                        dcc.Slider(id='agrifor_emis_slider',
                                   min=-20,
                                   max=20,
                                   value=0.34,
                                   step=0.01,
                                   marks={
                                       -20: '-20',
                                       -10: '-10',
                                       0: '0',
                                       10: '10',
                                       20: '20'
                                   }))),
                            width=2),
                    dbc.Col(
                        (html.Div(html.H6('Placeholder for slider'))), width=2)
                ],
                        style={"background-color": "rgba(44,160,44,0.8)"}),
                dbc.Row([
                    dbc.Col((html.Div(html.H6('LULUCF'))), width=2),
                    dbc.Col((html.Div(
                        dcc.Slider(id='lulucf_emis_slider',
                                   min=-20,
                                   max=20,
                                   value=-10.3,
                                   step=0.01,
                                   marks={
                                       -20: '-20',
                                       -10: '-10',
                                       0: '0',
                                       10: '10',
                                       20: '20'
                                   }))),
                            width=2),
                    dbc.Col((html.Div(html.H6('Placeholder for slider'))),
                            width=2),
                ],
                        style={"background-color": "rgba(31,119,180,0.8)"}),
                dbc.Row([
                    dbc.Col((html.Div(html.H3('Sector'))), width=2),
                    dbc.Col((html.Div(
                        html.H3('Annaul industry emission reduction'))),
                            width=2),
                    dbc.Col(
                        (html.Div(html.H3('Electricity generation growth'))),
                        width=2),
                ]),
                dbc.Row([
                    dbc.Col((html.Div(html.H6(''))), width=2),
                    dbc.Col(
                        (html.Div(html.H6('(Mt CO2-eq per year)'))), width=2),
                    dbc.Col((html.Div(html.H6('(% per year)'))), width=2),
                ]),
                dbc.Row([
                    dbc.Col((html.Div(html.H6('Electricity generation'))),
                            width=2),
                    dbc.Col((html.Div(
                        dcc.Slider(id='electricity_emis_slider',
                                   min=-20,
                                   max=20,
                                   value=1.80,
                                   step=0.01,
                                   marks={
                                       -20: '-20',
                                       -10: '-10',
                                       0: '0',
                                       10: '10',
                                       20: '20'
                                   }))),
                            width=2),
                    dbc.Col((html.Div(html.H6('Placeholder for slider'))),
                            width=2),
                ],
                        style={"background-color": "rgba(214,39,40,0.8)"}),
                dbc.Row([
                    dbc.Col((html.Div(html.H3('Sector'))), width=2),
                    dbc.Col((html.Div(html.H3('Annaul emission reduction'))),
                            width=2),
                    dbc.Col((html.Div(html.H3(''))), width=2),
                ]),
                dbc.Row([
                    dbc.Col((html.Div(html.H6(''))), width=2),
                    dbc.Col(
                        (html.Div(html.H6('(Mt CO2-eq per year)'))), width=2),
                    dbc.Col((html.Div(html.H6(''))), width=2),
                ]),
                dbc.Row([
                    dbc.Col((html.Div(html.H6('Residential'))), width=2),
                    dbc.Col((html.Div(
                        dcc.Slider(id='residential_emis_slider',
                                   min=-20,
                                   max=20,
                                   value=0.70,
                                   step=0.01,
                                   marks={
                                       -20: '-20',
                                       -10: '-10',
                                       0: '0',
                                       10: '10',
                                       20: '20'
                                   }))),
                            width=2),
                    dbc.Col((html.Div(html.H6('Placeholder for slider'))),
                            width=2),
                ],
                        style={"background-color": "rgba(255,127,14,0.8)"}),
            ],
                          fluid=True,
                          style={"padding": "20px 60px 20px 60px"}
                          )  ### This is for padding aroudn the entire app: fill the entire screen, but keep padding top right bottom left at x pixels
        ])
    elif tab == 'docs':
        return html.Div([html.H3('Here will be some documentation')])
    elif tab == 'other':
        return html.Div([
            html.
            H3('Here will be some other reports and links to the CCEP website etc'
               )
        ])
Пример #15
0
     style={
         'width': '24.4%',
         'backgroundColor': '#cbd2d3',
         'display': 'inline-block',
         'marginRight': '.8%',
         'verticalAlign': 'top'
     },
     children=[
         html.H3(
             style={
                 'textAlign': 'center',
                 'fontWeight': 'bold',
                 'color': '#2674f6'
             },
             children=[
                 html.P(style={
                     'color':
                     '#cbd2d3',
                     'padding': '.5rem'
                 },
                        children='xxxx xx xxx xxxx xxx xxxxx'),
                 '{}'.format(daysOutbreak),
             ]),
         html.H5(style={
             'textAlign': 'center',
             'color': '#2674f6',
             'padding': '.1rem'
         },
                 children="Days Since Outbreak")
     ]),
 html.Div(
Пример #16
0
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html

mobile_about_body = [
    html.Div([
        html.Div([
            html.H2("Information about the Novel Coronavirus",
                    className="about-page-title"),
            html.Div([
                html.Div([
                    html.Div([
                        html.H3("Coronavirus", className="about-section-title")
                    ],
                             className="about-section-title-container"),
                    html.Div([
                        html.
                        P("Coronavirus disease (COVID-19) is a respiratory illness which spreads from person to person by droplets from sneezes and coughs. Symptoms can range in severity and they often include a cough, fever, and/or shortness of breath. COVID-19 is caused by a new type of coronavirus that was first identified in 2019 in Wuhan, China.",
                          className="about-section-text")
                    ],
                             className="about-section-text-container")
                ],
                         className="about-section"),
                html.Div([], className="about-section-padding"),
                html.Div([
                    html.Div([
                        html.H3("Precautions", className="about-section-title")
                    ],
                             className="about-section-title-container"),
                    html.Div([
                        html.
Пример #17
0
                                marks=year_options,
                                value=[2017, 2019])
            ],
                     style={
                         'width': '45%',
                         'display': 'inline-block',
                         'margin': 10
                     })
        ],
                 style={
                     'border': '1px lightgrey solid',
                     'margin': 10
                 }),

        # print out applied filters
        html.Div([html.H3(id='selected-filters')],
                 style={
                     'textAlign': 'center',
                     'margin': 10
                 }),

        # bar chart
        html.Div([dcc.Graph(id='bar-partners')],
                 style={
                     'border': '1px lightgrey solid',
                     'margin': 10
                 }),

        # pie charts and line chart
        html.Div(
            [
Пример #18
0
                            style={
                                "height": "60px",
                                "width": "auto",
                                "margin-bottom": "25px",
                            },
                        )
                    ],
                    className="one-third column",
                ),

                html.Div(
                    [
                        html.Div(
                            [
                                html.H3(
                                    "Empowering Education in Colombia",
                                    style={"margin-bottom": "0px"},
                                ),
                            ]
                        )
                    ],
                    className="one-half column",
                    id="title",
                    style ={'display':'block'}
                ),
                
                html.Div(
                    [
                        dcc.Tabs(id="tabs-example", value='tab-1-example', children=[
                        dcc.Tab(label='Dashboard', value='tab-1-example'),
                        dcc.Tab(label='Simulator', value='tab-2-example'),
                    ], colors={
Пример #19
0
app = dash.Dash('working-status-app', external_stylesheets=external_css)
server = app.server

app.layout = html.Div(
    [
        html.Div([
            html.H2("Gannenet: Live Working Status"),
            html.Img(
                src=
                "https://s3-us-west-1.amazonaws.com/plotly-tutorials/logo/new-branding/dash-logo-by-plotly-stripe-inverted.png"
            )
        ],
                 className='banner'),
        html.Div([
            html.H3(id='live-update-text', className='Title'),
            html.Div([dcc.Graph(id='live-update-graph')]),
            dcc.Interval(
                id='interval-component', interval=1 * 1000, n_intervals=0)
        ]),
    ],
    style={
        'padding': '0px 10px 15px 10px',
        'marginLeft': 'auto',
        'marginRight': 'auto',
        "width": "900px",
        'boxShadow': '0px 0px 5px 5px rgba(204,204,204,0.4)'
    })

# external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
Пример #20
0
    id = Column(Integer, primary_key=True)
    name = Column(String(20))
    family = Column(String(20))
    age = Column(Integer)
    salary = Column(Integer)

Base.metadata.create_all(engine)


app = dash.Dash(__name__)

myInputs=('First Name', 'Last Name', 'Age', 'Salary')

app.layout = html.Div([
    html.Div([
        html.H3('This is a Simple Dash App to be Connected with PostgreSQL Database',
        style={'color': 'red', 'fontSize': '25px', 'fontFamily': 'arial', })

    ], style={'backgroundColor': '#e8e6e6', 'margin':'0px 50px', 'textAlign': 'center', 'border': '2px blue solid'}),
    html.Div([
        dcc.Input(
            id='i-name',
            type='text',
            placeholder='First Name',
            style={'textAlign': 'center', 'height': '40px', 'marginTop': '50px', 'fontSize': '16px'}
        ),
        dcc.Input(
            id='i-family',
            type='text',
            placeholder='Last Name',
            style={'textAlign': 'center', 'height': '40px', 'marginTop': '50px', 'fontSize': '16px'}
        ),
Пример #21
0
def render_content(tab):
    if tab == 'သေဆုံးနှုန်း':
        return html.Div([
            html.H3("သေဆုံးနှုန်း"),
            dcc.Graph(id='graph-death-tabs',
                      figure={
                          'data': [
                              {
                                  'x': Date.date_list,
                                  'y': Death.death('log')[0],
                                  'type': 'bar',
                                  'name': 'နေ့စဉ်သေဆုံနှုန်း'
                              },
                              {
                                  'x': Date.date_list,
                                  'y': Death.death('log')[1],
                                  'type': 'bar',
                                  'name': 'စုစုပေါင်းသေဆုံနှုန်း'
                              },
                          ],
                          'layout': {
                              'title': 'သေဆုံးမှုဖြစ်စဉ်ပြဂရပ်'
                          }
                      })
        ])

    if tab == 'ပျောက်ကင်းနှုန်း':
        return html.Div([
            html.H3("covid-19 ကူးစက်မှုမှသက်သာလာသည့်လူဦးရေ"),
            dcc.Graph(id='graph-cured-tabs',
                      figure={
                          'data': [
                              {
                                  'x': Date.date_list,
                                  'y': Recovery.recovery('linear'),
                                  'type': 'line',
                                  'name': 'နေ့စဉ်ရောဂါပျောက်ကင်းနှုန်း'
                              },
                          ],
                          'layout': {
                              'title': 'နေ့စဉ်ရောဂါပျောက်ကင်းသည့်ဦးရေ'
                          }
                      })
        ])

    if tab == 'လက်ရှိဖြစ်ပွားမှု':
        return html.Div([
            html.H3("covid-19 လက်ရှိကူးစက်ထားသည့်ဖြစ်စဉ်"),
            dcc.Graph(id='graph-active-tabs',
                      figure={
                          'data': [
                              {
                                  'x': Date.date_report,
                                  'y': Report.report('active')[0],
                                  'type': 'bar',
                                  'name': 'လက်ရှိ covid 19 ကူးစက်ထားသည်ပမာဏ'
                              },
                              {
                                  'x': Date.date_report,
                                  'y': Report.report('active')[1],
                                  'type': 'bar',
                                  'name': 'ကူးစက်ရောဂါဖြစ်ပွားနေသည့်ပမာဏ'
                              },
                              {
                                  'x': Date.date_report,
                                  'y': Report.report('active')[2],
                                  'type': 'bar',
                                  'name': 'စိုးရိမ်ရသည့်အခြေအနေ'
                              },
                          ],
                          'layout': {
                              'title': 'လက်ရှိရောဂါကူးစက်မှုအခြေအနေ'
                          }
                      })
        ])

    if tab == 'အချိုး':
        return html.Div([
            html.H3("ကူးစက်သေဆုံးနှုန်းကိုနှိင်းယှဉ်ပြသခြင်း"),
            dcc.Graph(id='graph-comparison-tabs',
                      figure={
                          'data': [
                              {
                                  'x': Date.date_list,
                                  'y': Rate.rate('linear')[0],
                                  'type': 'bar',
                                  'name': 'နေ့စဉ်ကူးစက်နှုန်း'
                              },
                              {
                                  'x': Date.date_list,
                                  'y': Rate.rate('linear')[1],
                                  'type': 'bar',
                                  'name': 'နေ့စဉ်သေဆုံနှုန်း'
                              },
                          ],
                          'layout': {
                              'title': 'ကူးစက်သေဆုံးဖြစ်စဉ်ပြဂရပ်'
                          }
                      })
        ])

    if tab == 'နိုင်ငံ':
        PAGE_SIZE = 10
        return html.Div([
            html.H3("covid-19 ပျုံ့နှံ့နေသည့်နိုင်ငံများ"),
            dt.DataTable(
                id='country-table',
                columns=[{
                    "name": i,
                    "id": i
                } for i in Table.table_countries.columns],
                page_current=0,
                page_size=PAGE_SIZE,
                style_data_conditional=[{
                    'if': {
                        'row_index': 'odd'
                    },
                    'backgroundColor': 'rgb(248,248,248)'
                }, {
                    'if': {
                        'column_id': 'စုစုပေါင်းသေဆုံးမှု'
                    },
                    'fontWeight': 'bold'
                }, {
                    'if': {
                        'column_id': 'ရောဂါပျောက်ကင်းမှု'
                    },
                    'fontWeight': 'bold'
                }],
                style_header=TableHeaderStyle.header_style,
                data=Table.table_countries.to_dict('records'),
            ),
            html.Br(),
            dcc.Checklist(id='datatable-use-page-count',
                          options=[{
                              'label': 'Use page_count',
                              'value': 'True'
                          }],
                          value=['True']), 'Page count: ',
            dcc.Input(id='datatable-page-count',
                      type='number',
                      min=1,
                      max=9,
                      value=1)
        ])

    if tab == 'မြေပုံ':
        return html.Iframe(src=cfg.url, style=TabIframeStyle.iframe_style)

    return html.Div([
        html.H3("ကူးစက်နှုန်း"),
        dcc.Graph(id='graph-cases-tabs',
                  figure={
                      'data': [
                          {
                              'x': Date.date_list,
                              'y': Case.case('log')[0],
                              'type': 'line',
                              'name': 'နေ့စဉ်ကူးစက်နှုန်း'
                          },
                          {
                              'x': Date.date_list,
                              'y': Case.case('log')[1],
                              'type': 'line',
                              'name': 'စုစုပေါင်းကူးစက်နှုန်း'
                          },
                      ],
                      'layout': {
                          'title': 'ဗိုင်းရပ်ကူးစက်နှုန်းပြဂရပ်'
                      }
                  })
    ])
# Layout
app.layout = html.Div(children=[
    html.H1(children='Python Dash',
            style={
                'textAlign': 'center',
                'color': '#ef3e18'
            }),
    html.Div('Web dashboard for Data Visualization using Python',
             style={'textAlign': 'center'}),
    html.Div('2016 Rio Olympics', style={'textAlign': 'center'}),
    html.Div('Weather for July 2014 - June 2015',
             style={'textAlign': 'center'}),
    html.Br(),
    html.Br(),
    html.Hr(style={'color': '#7FDBFF'}),
    html.H3('Olympic bar chart', style={'color': '#df1e56'}),
    html.Div(
        'This bar chart represents the total medals won by the top 20 countries in the 2016 Olympics.'
    ),
    dcc.Graph(id='graph1',
              figure={
                  'data':
                  olympic_barchart_data,
                  'layout':
                  go.Layout(
                      title='2016 Olympics Top 20 Countries by Total Medals',
                      xaxis={'title': 'Country'},
                      yaxis={'title': 'Medals'})
              }),
    html.Hr(style={'color': '#7FDBFF'}),
    html.H3('Olympic stack bar chart', style={'color': '#df1e56'}),
Пример #23
0
                           opacity=0.5,
                           height=800,
                           width=580)

frontpage_map_style = {
    'position': 'fixed',
    'top': 0,
    'left': 0,
    'bottom': 0,
    'width': '64rem',
    'padding': '2rem 1rem',
    'background-color': '#f8f9fa',
}

frontpage_map = html.Div([
    html.H3('Mineral Exploration Map'),  # header name
    dcc.Graph(
        id="map",
        figure=fig,  # thisis where choropleth mapbox figure is inserted
        style={
            "width": "100%",
            "display": "inline-block"
        })
])

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)

app.layout = html.Div([
    dcc.Tabs([
Пример #24
0
# perform the basic imports
import dash
import dash_core_components as dcc
import dash_html_components as html
# launch the application
app = dash.Dash()
# Create a Div to contain basic headers, an input box, and our graph
app.layout = html.Div([
    html.H1('Stock Ticker Dashboard'),
    html.H3('Enter a stock symbol:'),
    dcc.Input(
        id='my_ticker_symbol',
        value='TSLA'  # sets a default value 
    ),
    dcc.Graph(id='my_graph', figure={'data': [{
        'x': [1, 2],
        'y': [3, 1]
    }]})
])
# Add the server clause
if __name__ == '__main__':
    app.run_server()
Пример #25
0
import dash_auth
import dash_core_components as dcc
import dash_html_components as html
import plotly

# Keep this out of source code repository - save in a file or a database
VALID_USERNAME_PASSWORD_PAIRS = [['hello', 'world']]

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
auth = dash_auth.BasicAuth(app, VALID_USERNAME_PASSWORD_PAIRS)

app.layout = html.Div([
    html.H1('Welcome to the app'),
    html.H3('You are successfully authorized'),
    dcc.Dropdown(id='dropdown',
                 options=[{
                     'label': i,
                     'value': i
                 } for i in ['A', 'B']],
                 value='A'),
    dcc.Graph(id='graph')
],
                      className='container')


@app.callback(dash.dependencies.Output('graph', 'figure'),
              [dash.dependencies.Input('dropdown', 'value')])
def update_graph(dropdown_value):
    return {
Пример #26
0
                   y=df_store_ev['Stores Number'],
                   mode='lines',
                   line={'color': '#338267'},
                   fill='tozeroy')
    ],
    'layout':
    go.Layout(paper_bgcolor='rgba(0,0,0,0)',
              height=430,
              margin=dict(l=70, r=40, t=30, b=80),
              yaxis={'title': 'Nb. of Stores'},
              xaxis=go.layout.XAxis(
                  tickmode='array',
                  tickvals=df_store_ev['Date'],
                  ticktext=df_store_ev['Date'],
                  rangeslider=dict(
                      visible=True,
                      bgcolor='#F2F2F2',
                  ),
                  type='date',
                  showgrid=False,
              ))
}

layout = html.Div([
    html.H3(
        ["Total Number of Stores ",
         html.Span("", className="h3-comp-title")],
        className="text-center mt-3"),
    dcc.Graph(id="graphs-section-2", figure=fig)
])
Пример #27
0
def generate_component_example(component_name,
                               library_name,
                               library_short,
                               description='',
                               params=None,
                               style=None,
                               default_id=True,
                               datafile=None,
                               library_imports=None,
                               setup_code='',
                               component_wrap=None,
                               image_info=None):
    '''Generate an example for a component, with hyperlinks to the
    appropriate component-specific pages.

    :param (str) component_name: The name of the component as it is
    defined within the package.
    :param (str) library_name: The full name of the library (e.g.,
    dash_bio).
    :param (str) library_short: The short name of the library, used in an
    import statement (i.e., import library_name as library_short).
    :param (str) description: A short string describing the component.
    :param (dict) params: A dictionary that contains the parameters
    assigned to the component that is to be displayed as a live
    example; the keys correspond to the parameter names.
    :param (dict) style: A dictionary that contains any style
    options. The keys correspond to the style parameter names.
    :param (bool) default_id: Whether or not to assign a default ID to
    the component in the example code.
    :param (string) datafile: The name of the data file, if any, used
    for the component. This file should be present in the folder
    specified by the variable DATA_LOCATION_PREFIX.
    :param (list[list]) library_imports: A list for which each element
    is a list with two elements: the first element should be the full
    name of the library, and the second element should be the short
    name of the library. Contains all of the libraries necessary for
    running the example code (e.g., pandas).
    :param (str) setup_code: Any additional code required before
    rendering the component (e.g., parsing a data file).
    :param (str) component_wrap: A string that will wrap the component
    (e.g., if the component needs to be an argument for a dcc.Graph).
    The location of the component code is represented by an
    underscore (_).
    :param (dict) image_info: The URL and, if applicable, the height
    and width of the image of the component.
    :rtype (list[obj]): A list containing the entire section for the
    component in question, including the code block, component demo,
    description, and hyperlinks to the component-specific page.
    '''

    # location of all sample data
    DATA_LOCATION_PREFIX = '''https://raw.githubusercontent.com/plotly/\
dash-bio-docs-files/master/'''

    if library_imports is None:
        library_imports = []

    # parameters for initial declaration of component
    paramstring = '\n  '

    if default_id is True:
        paramstring += 'id=\'my-{}-{}\', '.format(library_short,
                                                  component_name.lower())

    if params is not None:
        for key in params.keys():
            paramstring += '{}={}, '.format(key, params[key])

    # style options
    if style is not None:
        styleString = 'style={\n  '
        for key in style.keys():
            styleString += '  \'{}\': \'{}\', '.format(key, str(style[key]))

        # remove comma and space following the last style option
        styleString = styleString[:-2]

        styleString += '\n  }, '
        paramstring += styleString

    # loading data if necessary
    if datafile is not None:
        library_imports.append(['urllib.request', 'urlreq'])
        # only decode for python 3
        decode_string = ''
        if sys.version_info >= (3, 0):
            decode_string = '.decode(\"utf-8\")'

        # add data location
        setup_code = '''\ndata = urlreq.urlopen(\n \"{}\" + \n \"{}\"\n).read(){}\n\n'''.format(
            DATA_LOCATION_PREFIX, datafile['name'], decode_string) + setup_code

        # declare data in component initialization if necessary
        if 'parameter' in datafile.keys():
            paramstring += '{}=data, '.format(datafile['parameter'])

    # pretty-print param string (spaces for indentation)
    paramstring = paramstring.replace(', ', ',\n  ')

    # remove the characters following the final parameter
    # (',\n  '), and add unindented newline at end
    if (len(paramstring) > 4):
        paramstring = paramstring[:-4] + '\n'
    # if no params were supplied, remove all newlines
    else:
        paramstring = ''

    # format component string
    component_string = '{}.{}({})'.format(library_short, component_name,
                                          paramstring)
    # wrap component if necessary
    if component_wrap is not None:
        component_string = component_wrap.replace('_', component_string)

    # add imports
    imports_string = ''
    for library in library_imports:
        if library[0] != library[1]:
            imports_string += 'import {} as {}\n'.format(
                library[0], library[1])
        else:
            imports_string += 'import {}\n'.format(library[0])

    # change urllib package if necessary (due to Python version)
    imports_string = imports_string.replace('urllib.request',
                                            'six.moves.urllib.request')

    # full code
    example_string = '''import {} as {}
{}
{}
component = {}
'''.format(library_name, library_short, imports_string, setup_code,
           component_string)

    # load the iframe if that is where the app is
    if image_info is not None:
        component_demo = imageComponentBlock(example_string, **image_info)
    else:
        component_demo = rc.ComponentBlock(example_string)

    # full component section
    return [
        html.Hr(),
        html.H3(
            dcc.Link(component_name,
                     href=tools.relpath('/{}/{}'.format(
                         library_name.replace('_', '-'),
                         component_name.lower())),
                     id=component_name.replace(' ', '-').lower())),
        rc.Markdown(description), component_demo,
        html.Br(),
        dcc.Link('More {} Examples and Reference'.format(component_name),
                 href=tools.relpath('/{}/{}'.format(
                     library_name.replace('_', '-'), component_name.lower())))
    ]
Пример #28
0
# _*_ coding: utf-8 _*_
"""
app4实例
"""

import dash_table
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
from Dash.apps.app4data import *

# 创建layout
layout = dbc.Container(children=[
    html.H3("DataTable Sizing", className="mt-2"),
    html.Div(children=dash_table.DataTable(data=df_election.to_dict('rows'),
                                           columns=[{
                                               'id': c,
                                               'name': c
                                           } for c in df_election.columns]),
             className="mt-2"),
    dash_table.DataTable(
        style_table={'width': '100%'},
        style_data={'whiteSpace': 'normal'},
        content_style='grow',
        css=[{
            'selector':
            '.dash-cell div.dash-cell-value',
            'rule':
            'display: inline; white-space: inherit; overflow: inherit; text-overflow: inherit;'
        }],
        data=df_election.to_dict('rows'),
Пример #29
0
)  

tank_4 =  daq.Tank(
  id='my-daq-tank',
  min=0,
  max=10,
  value=5,
  color={"ranges":{"green":[0,5],"yellow":[5,9],"red":[9,10]}},
  label="TANK-4",
  showCurrentValue=True,
  units='gallons',
  style={'marginLeft': '50px','color':'white'}

)  
col_1 =  dbc.Col([
    html.H3("GAS CONTAINER PRESSURES",style={"textAlign":"center"}),
                dbc.Row([
                    dbc.Col([
                        meter_1
                    ]),
                     html.Br(),
                    dbc.Col([
                        meter_2
                    ]),
             
                ]),
                 html.Br(),
                 dbc.Row([
                    dbc.Col([
                        meter_3
                    ]),
Пример #30
0
    "Monet - Camille Monet On Her Deathbed":
    "Monet - Camille Monet On Her Deathbed",
    "Monet - Haystack": "Monet - Haystack",
    "Picasso - The Dream": "Picasso - The Dream",
    "Qi Baishi - Lotus Flowers and Wild Duck":
    "Qi Baishi - Lotus Flowers and Wild Duck",
    "Rousseau - Myself": "Rousseau - Myself",
    "van Gogh - Starry Night": "van Gogh - Starry Night"
}

app.layout = html.Div(
    [
        html.H1('ArtNet: Artistic Style Transfer Network',
                style={'textAlign': 'center'}),
        html.H3(
            'Mengying Bi (mybi), Cathy Jia (cathyjia), Geoffrey Li (geoffli)',
            style={'textAlign': 'center'}),
        html.Hr(),

        # drag or upload input image
        html.Div(children=[
            dcc.Upload(id='input-image',
                       children=html.Div(
                           ['Drag and Drop or ',
                            html.Button('Select a File')]),
                       style={
                           'width': '100%',
                           'height': '60px',
                           'lineHeight': '60px',
                           'borderWidth': '1px',
                           'borderStyle': 'dashed',