step=.01,
                 value=[0., 1.],
                 marks={
                     0.: '0%',
                     .25: '25%',
                     .50: '50%',
                     .75: '75%',
                     1.0: '100%'
                 },
             ),
             dbc.FormText('% of maximum value in data set')
         ]),
         dbc.Checklist(id=f'{APP_ID}_toggle_edges',
                       options=[{
                           "label": "Show Element Edges",
                           "value": 1
                       }],
                       switch=True,
                       value=[1])
     ],
     width=4),
 dbc.Col([
     html.Div(
         html.Div(style={
             "width": "100%",
             "height": "100%"
         },
                  children=[
                      dash_vtk.View(
                          id=f'{APP_ID}_geom_rep',
                          children=None,
Ejemplo n.º 2
0
from app import app

header = html.H3('Base Excitation', className=" mt-2, text-center")
about_Text = html.P([
    "This Base Excitation solver takes in your parameters and then produces a motion transmissibility curve. You can then choose a frequency to view the time history plot at that specific frequency."
    "Try it out by changing the input parameters and pressing submit to view your solution at the bottom of the page. To submit feedback for this module please click ",
    html.A("here", href="https://forms.gle/BJNKYjpcznCAjuqv8",
           target="_blank"), "."
])

damp_switch = dbc.FormGroup([
    dbc.Checklist(
        options=[{
            "label": "Use Damping Coefficient",
            "value": 1
        }],
        value=[],
        id="damping-switch-BE",
        switch=True,
    ),
])
''' The Following are the all the popover components. 
They consist of the blue ? button, The popover itself with the header and the validation message 
telling the user why/why not the current input is valid'''

mass_popover = html.Div([
    dbc.Button(
        "?",
        id="mass-popover-target-BE",
        color="info",
    ),
Ejemplo n.º 3
0
        id="gene_search",
        type="text",
        value="GATA1",
        style={'width': '50%'},
    ),
    html.P(id='output'),
])

antibody_selection = html.Div([
    # dbc.Row(
    dbc.Label('Select two antibodies to display'),
    dbc.Checklist(
        options=[{
            "label": i,
            "value": i
        } for i in antibody_list],
        id="antibody_selection",
        value=[antibody_list[0], antibody_list[1]],
        labelStyle={'display': 'inline-block'},
    ),
    # ),
])

app.layout = dbc.Container(
    [
        html.H2("scRNA-seq data visualization (cite-seq version)"),
        html.Hr(style={"margin-bottom": "0px"}),
        dbc.Row(  # select gene and antibody
            [
                dbc.Col(gene_input, md=5),
                dbc.Col(antibody_selection, md=7),
Ejemplo n.º 4
0
    def init_components(self):
        """
        Initialize components (graph, table, filter, settings, ...) and insert it inside
        components containers which are created by init_skeleton
        """

        self.components['settings']['input_rows'] = create_input_modal(
            id='rows',
            label="Number of rows for subset",
            tooltip="Set max number of lines for subset (datatable).Filter will be apply on this subset."
        )

        self.components['settings']['input_points'] = create_input_modal(
            id='points',
            label="Number of points for plot",
            tooltip="Set max number of points in feature contribution plots"
        )

        self.components['settings']['input_features'] = create_input_modal(
            id='features',
            label="Number of features to plot",
            tooltip="Set max number of features to plot in features importance and local explanation plots.",
        )

        self.components['settings']['input_violin'] = create_input_modal(
            id='violin',
            label="Max number of labels for violin plot",
            tooltip="Set max number of labels to display a violin plot for feature contribution plot (otherwise a "
                    "scatter plot is displayed)."
        )

        self.components['settings']['name'] = dbc.FormGroup(
            [
                dbc.Checklist(
                    options=[{"label": "Use domain name for features name.", "value": 1}], value=[], inline=True,
                    id="name",
                    style={"margin-left": "20px"}
                ),
                dbc.Tooltip("Replace technical feature names by domain names if exists.",
                            target='name', placement='bottom'),
            ], row=True,
        )

        self.components['settings']['modal'] = dbc.Modal(
            [
                dbc.ModalHeader("Settings"),
                dbc.ModalBody(
                    dbc.Form(
                        [
                            self.components['settings']['input_rows'],
                            self.components['settings']['input_points'],
                            self.components['settings']['input_features'],
                            self.components['settings']['input_violin'],
                            self.components['settings']['name']
                        ]
                    )
                ),
                dbc.ModalFooter(
                    dbc.Button("Apply", id="apply", className="ml-auto")
                ),
            ],
            id="modal"
        )

        self.components['menu'] = dbc.Row(
            [
                dbc.Col(
                    [
                        html.H4(
                            [dbc.Badge("Regression", id='regression_badge', style={"margin-right": "5px"}),
                             dbc.Badge("Classification", id='classification_badge')
                             ],
                            style={"margin": "0px"}
                        ),
                    ],
                    width="auto", align="center",
                ),
                dbc.Col(
                    dbc.Collapse(
                        dbc.FormGroup(
                            [
                                dbc.Label("Class to analyse", style={'color': 'white', 'margin': '0px 5px'}),
                                dcc.Dropdown(
                                    id="select_label",
                                    options=[], value=None,
                                    clearable=False, searchable=False,
                                    style={"verticalAlign": "middle", "zIndex": '1010', "min-width": '200px'}
                                )
                            ],
                            row=True, style={"margin": "0px 0px 0px 5px", "align-items": "center"}
                        ),
                        is_open=True, id='select_collapse'
                    ),
                    width="auto", align="center", style={'padding': 'none'}
                ),
                dbc.Col(
                    html.Div(
                        [
                            html.Img(id='settings', title='settings', alt='Settings',
                                     src=self.app.get_asset_url('settings.png'),
                                     height='40px',
                                     style={'cursor': 'pointer'}),
                            self.components['settings']['modal'],
                        ]
                    ),
                    align="center", width="50px", style={'padding': '0px 0px 0px 20px'}
                )
            ],
            form=True, no_gutters=True, justify="end"
        )

        self.adjust_menu()

        self.components['table']['dataset'] = dash_table.DataTable(
            id='dataset',
            data=self.round_dataframe.to_dict('records'),
            tooltip_data=[
                {
                    column: {'value': str(value), 'type': 'text'}
                    for column, value in row.items()
                } for row in self.dataframe.to_dict('rows')
            ], tooltip_duration=2000,

            columns=[{"name": '_index_', "id": '_index_'}, {"name": '_predict_', "id": '_predict_'}] +
                    [{"name": i, "id": i} for i in self.explainer.x_pred],
            editable=False, row_deletable=False,
            style_as_list_view=True,
            virtualization=True,
            page_action='none',
            fixed_rows={'headers': True, 'data': 0},
            fixed_columns={'headers': True, 'data': 0},
            filter_action='custom', filter_query='',
            sort_action='custom', sort_mode='multi', sort_by=[],
            active_cell={'row': 0, 'column': 0, 'column_id': '_index_'},
            style_table={'overflowY': 'auto', 'overflowX': 'auto'},
            style_header={'height': '30px'},
            style_cell={
                'minWidth': '70px', 'width': '120px', 'maxWidth': '200px',
            },
        )

        self.components['graph']['global_feature_importance'] = MyGraph(
            figure=go.Figure(), id='global_feature_importance'
        )

        self.components['graph']['feature_selector'] = MyGraph(
            figure=go.Figure(), id='feature_selector'
        )

        self.components['graph']['detail_feature'] = MyGraph(
            figure=go.Figure(), id='detail_feature'
        )

        self.components['filter']['index'] = dbc.FormGroup(
            [
                dbc.Label("Index ", align="center", width=4),
                dbc.Col(
                    dbc.Input(
                        id="index_id", type="text", bs_size="md", placeholder="Id must exist",
                        debounce=True, persistence=True, style={'textAlign': 'right'}
                    ),
                    style={'padding': "0px"}
                ),
                dbc.Col(
                    html.Img(id='validation', alt='Validate', title='Validate index',
                             src=self.app.get_asset_url('reload.png'),
                             height='30px', style={'cursor': 'pointer'},
                             ),
                    style={'padding': "0px"}, align="center", width="40px"
                )
            ],
            row=True
        )

        self.components['filter']['threshold'] = dbc.FormGroup(
            [
                dbc.Label("Threshold", html_for="slider", id='threshold_label'),
                dcc.Slider(
                    min=0, max=self.max_threshold, value=0, step=0.1,
                    marks={f'{round(self.max_threshold * mark / 4)}': f'{round(self.max_threshold * mark / 4)}'
                           for mark in range(5)},
                    id="threshold_id",
                )
            ],
            className='filter_dashed'
        )

        self.components['filter']['max_contrib'] = dbc.FormGroup(
            [
                dbc.Label(
                    "Features to display : ", id='max_contrib_label'),
                dcc.Slider(
                    min=1, max=min(self.settings['features'], len(self.dataframe.columns) - 2),
                    step=1, value=min(self.settings['features'], len(self.dataframe.columns) - 2),
                    id="max_contrib_id",
                )
            ],
            className='filter_dashed'
        )

        self.components['filter']['positive_contrib'] = dbc.FormGroup(
            [
                dbc.Label("Contributions to display : "),
                dbc.Row(
                    [
                        dbc.Col(
                            dbc.Checklist(
                                options=[{"label": "Positive", "value": 1}], value=[1], inline=True,
                                id="check_id_positive"
                            ), width=6
                        ),
                        dbc.Col(
                            dbc.Checklist(
                                options=[{"label": "Negative", "value": 1}], value=[1], inline=True,
                                id="check_id_negative"
                            ), width=6, style={'padding': "0px"}, align="center"
                        ),
                    ], no_gutters=True, justify="center", form=True
                )
            ],
            className='filter_dashed'
        )

        self.components['filter']['masked_contrib'] = dbc.FormGroup(
            [
                dbc.Label(
                    "Feature(s) to mask :"),
                dcc.Dropdown(options=[{'label': key, 'value': value} for key, value in sorted(
                    self.explainer.inv_features_dict.items(), key=lambda item: item[0])],
                    value='', multi=True, searchable=True,
                    id="masked_contrib_id"
                ),
            ],
            className='filter_dashed'
        )
Ejemplo n.º 5
0
                    },
                    id='R-slider'),
     ])
 ],
          className='mt-3'),
 dbc.Card([
     dbc.CardHeader('Proximidade'),
     dbc.CardBody([
         html.Button(id='toggle-all'),
         html.Div(
             [
                 dbc.Checklist(
                     options=[{
                         'label': attr,
                         'value': attr
                     } for attr in ALL_SOM_ATTRS
                              ],
                     id='som-attrs-checkboxes',
                     values=[],
                 )
             ],
             className='mb-3',
             style={
                 'overflowY': 'scroll',
                 'height': '20vh'
             }),
         dcc.Slider(value=0.5,
                    step=0.01,
                    min=0,
                    max=1,
                    marks={
Ejemplo n.º 6
0
],
                                 id=id_tree_specific_params)

_output_form = dbc.FormGroup([
    dbc.Label("Additional output generation",
              html_for=id_output_configuration,
              width=3,
              className="poapangenome_label"),
    dbc.Col([
        dbc.Checklist(
            id=id_output_configuration,
            options=[
                {
                    'label':
                    'FASTA (all sequences and consensuses in fasta format)',
                    'value': 'fasta'
                },
                {
                    'label': 'PO (poagraph in PO format)',
                    'value': 'po'
                },
            ],
            values=['fasta', 'po'])
    ],
            width=6),
],
                             row=True)

_poapangenome_form = dbc.Form([
    _data_type_form, _metadata_upload_form, _multialignment_upload_form,
    _missing_data_form, _blosum_upload_form, _consensus_algorithm_form,
    _poa_hbmin_form, _tree_params_form, _output_form
Ejemplo n.º 7
0
def get_signup_modal():
    """User signup modal
    """
    # New user Form
    signup_form = [

        html.Div(id='signup-alert'),

        dbc.FormGroup([
            dbc.Checklist(id='user-options',
                          options=[{'label':_('Active'), 'value':'active'}],
                          value=['active'],
                         ),
        ]),

        dbc.FormGroup([
            dbc.Label(_('Name'), html_for='name'),
            dbc.Input(type='text', id='name',
                      placeholder=_('First and Last Name')),
        ]),

        dbc.FormGroup([
            dbc.Label(_('Email'), html_for='email'),
            dbc.Input(type='email', id='email', placeholder=_('Enter email')),
        ]),

        dbc.FormGroup([
            dbc.Label(_('Password'), html_for='password1'),
            dbc.Input(type='password',
                      id='password1',
                      placeholder=_('Enter password'),
                     ),
        ]),

        dbc.FormGroup([
            dbc.Label(_('Password (Confirm)'), html_for='password2'),
            dbc.Input(type='password',
                      id='password2',
                      placeholder=_('Confirm password'),
                     ),
        ]),

    ]
    # modal
    return html.Div(
        [
            dbc.Modal(
                [
                    dbc.ModalHeader([_('Add user'), ]),
                    dbc.ModalBody(signup_form),
                    dbc.ModalFooter([
                        dbc.Button(_('Close'), id='close', className='ml-auto'),
                        dbc.Button(_('Clear Fields'), id='clear',
                                   className='ml-1'),
                        dbc.Button(_('Create new user'),
                                   id='signup-button',
                                   color='primary',
                                   className='ml-1'
                                  ),

                    ]),
                ],
                id='modal',
            ),
        ]
    )
Ejemplo n.º 8
0
                 clearable=False,
             ),
         ]),
         md=6,
     ),
     dbc.Col(
         dbc.FormGroup([
             dbc.Label("Plot options"),
             dbc.Checklist(
                 options=[
                     {
                         "label": "Logarithmic scale",
                         "value": "log_scale",
                     },
                     {
                         "label": "Per population size",
                         "value": "per_pop_size",
                     },
                 ],
                 value=["per_pop_size"],
                 id="infected-plot-options",
                 switch=True,
             ),
         ]),
         md=6,
     ),
 ]),
 dbc.Row([dbc.Col(dcc.Graph(id="infected-in-total-figure"), md=12)]),
 dbc.Row([dbc.Col(dcc.Graph(id="infected-per-day-figure"), md=12)]),
 html.H2("Interactive map showing world status", className="mt-4 mb-4"),
 dbc.Row(dbc.Col(dcc.Graph(id="infected-map"), md=12, className="mb-4")),
Ejemplo n.º 9
0
            id='file-picker',
        ),
    ])
], color='secondary', inverse=True)


filter_card = dbc.Card([
    dbc.CardHeader('Control'),
    dbc.CardBody([
        dbc.Row(
            [
                dbc.Checklist(
                    options=[
                        {'label': 'Add outline to scatters',
                         'value': True},
                    ],
                    value=[],
                    id='outline-switch',
                    switch=True,
                ),
                dbc.Checklist(
                    options=[
                        {'label': 'Overlay all frames',
                         'value': True},
                    ],
                    value=[],
                    id='overlay-switch',
                    switch=True,
                ),
                dbc.Checklist(
                    options=[
Ejemplo n.º 10
0
def tab_overview():
    return [
        # Explanation and details
        dbc.Row(
            dbc.Col(children=[
                html.Div(
                    id="description-card",
                    children=[
                        html.H3("General overview of the spreadsheet"),
                        dbc.Card(
                            """Drag to select on the top graphs, the table will update based on this selection. """
                            """Clicking on the table headers will sort, while typing in the first row will search. """
                            """Searching for numbers and dates takes ranges: ">3" means above average of 3. """,
                            body=True,
                            id="intro"),
                    ],
                ),
            ]),
            className="mb-4 mt-4",
        ),
        # Dataset details
        dbc.Row(
            dbc.Col(
                dbc.Row([
                    dbc.Col(
                        dbc.Card([
                            dbc.CardBody([
                                html.H4("Card title",
                                        id="card-album-number",
                                        className="card-title"),
                                html.P("Number of albums",
                                       className="card-text"),
                            ]),
                        ]), ),
                    dbc.Col(
                        dbc.Card([
                            dbc.CardBody([
                                html.H4("Card title",
                                        id="card-artist-number",
                                        className="card-title"),
                                html.P("Number of artists",
                                       className="card-text"),
                            ]),
                        ]), ),
                    dbc.Col(
                        dbc.Card([
                            dbc.CardBody([
                                html.H4("Card title",
                                        id="card-overall-avg",
                                        className="card-title"),
                                html.P(children=[
                                    "Vote average  ",
                                    dbc.Checklist(options=[
                                        {
                                            "label": "Use wAVG?",
                                            "value": False
                                        },
                                    ],
                                                  id="average-select",
                                                  switch=True,
                                                  inline=True,
                                                  style={"display": "inline"}),
                                ],
                                       className="card-text"),
                            ]),
                        ]), ),
                ]), ), ),
        dbc.Row(
            [
                dbc.Col(
                    dcc.Graph(id="overview_year",
                              figure={'layout': graph_custom}),
                    md=6,
                ),
                dbc.Col(
                    dcc.Graph(id="overview_stats",
                              figure={'layout': graph_custom}),
                    md=6,
                ),
            ],
            className="mb-4 mt-4",
        ),
        dbc.Row(
            [
                dbc.Col(
                    dt.DataTable(
                        id='overview_year_tbl',
                        columns=[
                            {
                                'id': "Released",
                                'name': 'Released'
                            },
                            {
                                'id': "Artist",
                                'name': 'Artist'
                            },
                            {
                                'id': "Album",
                                'name': 'Album'
                            },
                            {
                                'id': "AVG",
                                'name': 'Average'
                            },
                            {
                                'id': "Votes",
                                'name': '#Votes'
                            },
                        ],
                        style_header={'backgroundColor': palette['black']},
                        style_cell={
                            'backgroundColor': 'rgb(50, 50, 50)',
                            'color': palette['white'],
                            'border': '1px solid black'
                        },
                        style_filter={
                            'backgroundColor': palette['lblue'],
                            'color': palette['white']
                        },
                        page_size=12,
                        sort_action='native',
                        filter_action='native',
                        style_as_list_view=True,
                    ), ),
            ],
            className="mb-4 mt-4",
        )
    ]
Ejemplo n.º 11
0
            "label": "Option 2",
            "value": 2
        },
    ],
                   value=1)
],
                           className="bg-light")

checklist = dbc.FormGroup(children=[
    dbc.Label("Choose a bunch"),
    dbc.Checklist(options=[
        {
            "label": "Option 1",
            "value": 1
        },
        {
            "label": "Option 2",
            "value": 2
        },
    ],
                  values=[1, 2]),
],
                          className="bg-light")

# ---------------------------------------------------------------------------------------
radioitems_inline = dbc.FormGroup(children=[
    dbc.Label("Choose one"),
    dbc.RadioItems(options=[
        {
            "label": "Option 1",
            "value": 1
            },
        ],
        value=1,
        id="radioitems-input",
    ),
])

checklist = dbc.FormGroup([
    dbc.Label("Choose a bunch"),
    dbc.Checklist(
        options=[
            {
                "label": "Option 1",
                "value": 1
            },
            {
                "label": "Option 2",
                "value": 2
            },
        ],
        value=[],
        id="checklist-input",
    ),
])

inputs = html.Div([
    dbc.Form([radioitems, checklist]),
    html.P(id="radioitems-checklist-output"),
])


@app.callback(
Ejemplo n.º 13
0
    def run(self):
        if not os.path.exists(UPLOAD_DIRECTORY):
            os.makedirs(UPLOAD_DIRECTORY)

        server = Flask(__name__)
        app = dash.Dash(server=server)

        @server.route("/download/<path:path>")
        def download(path):
            """Serve a file from the upload directory."""
            return send_from_directory(UPLOAD_DIRECTORY, path, as_attachment=True)

        external_stylesheets = [dbc.themes.BOOTSTRAP]
        app = dash.Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])

        app.layout = html.Div([
                html.Div([dbc.ButtonGroup([dbc.Button("ENGLISH"), dbc.Button("PERSIAN")],),
                          ], style={'float': 'right'}),

            html.Div([
                html.Span([
                    dbc.Badge("NATURAL LANGUAGE PROCESSING", color="info", className="mr-1"),
                    dbc.Badge("MACHINE LEARNING", color="primary", className="mr-1"),
                    dbc.Badge("PACKAGING", color="success", className="mr-1"),
                    dbc.Badge("Pip", color="danger", className="mr-1"),
                    dbc.Checklist(
                        options=[{'label': 'dark', "value": 1}],
                        value=[],
                        id="switches-input",
                        switch=True,
                    ),
                ]),
                html.H1('PPARSER PACKAGE', id='package_des', style={'textAlign': 'center', 'color': colors['green']}),

            ], style={'color': colors['white']}),

            html.Div([
                html.Div([dcc.Upload(id='upload-data',
                                     children=html.Div(['Drag and Drop or ',
                                                        html.A('Select Files')],
                                                       style={'textAlign': 'center', 'color': colors['green']}),
                                     style={
                                         'width': '30%',
                                         'height': '50px',
                                         'lineHeight': '60px',
                                         'borderWidth': '1px',
                                         'borderStyle': 'dashed',
                                         'borderRadius': '60px',
                                         'margin': '0 auto',
                                         'color': colors['green']
                                        },
                                     # Allow multiple files to be uploaded
                                     multiple=True
                                     ),
                    html.Div(id='output-data-upload'),
                          ], style={'margin': '10px'}),
                html.Div([
                        dbc.Button("Submit", id='SUBMIT', color="success", active=False, className="mr-1"),
                    ], style={'textAlign': 'center'}
                ),
            ]),

            html.Div([dbc.FormGroup(
            [
                dbc.Label("Packages"),
                dbc.RadioItems(
                    options=[
                        {"label": "HAZM", "value": 'HAZM'},
                        {"label": "PARSIVAR", "value": 'PARSIVAR'},
                        {'label': 'STANZA', 'value': 'STANZA'}
                    ],
                    value='STANZA',
                    id='package',
                    labelCheckedStyle={"color": "red"},
                    inline=True,
                ),
            ]
        )]),

            html.Div([
                html.Label('Operations'),
                dbc.Checklist(id="Operation",
                              options=[
                                  {'label': 'Word tokenize', 'value': 'W_TOKENIZE'},
                                  {'label': 'Sent tokenize', 'value': 'S_TOKENIZE'},
                                  {'label': 'Normalize', 'value': 'NORMALIZE'},
                                  {'label': 'Lemma', 'value': 'LEMMATIZE'},
                                  {'label': 'Stem', 'value': 'STEM'},
                              ],
                              labelCheckedStyle={"color": "red"}, value=['W_TOKENIZE'])
            ]),

            html.Div([
                html.Div([html.Div([dcc.Interval(id="progress-interval", n_intervals=0, interval=500),
                          dbc.Progress(id="progress", color='success')], style={
                                         'width': '50%',
                                         'height': '50px',
                                         'lineHeight': '60px',
                                         'margin': '0 auto',
                                        },
                                   ),
                          html.Div(dbc.Spinner(color="success"))], style={'textAlign': 'center', 'margin': '10px'}),
            ]),

            html.Div([
                    html.H2(['ABOUT PACKAGES'], style={'color': colors['green']}),
                    dbc.CardGroup(
                        [
                            dbc.Card(
                                dbc.CardBody(
                                    [
                                        html.H5("HAZM", className="card-title", style={'color': colors['green']}),
                                        html.P(
                                            'HAZM is an open-source package designed for pre-processing Persian text.'
                                            'In its website you can find many useful examples of its usage.',
                                            className="card-text",
                                        ),
                                        dbc.Button(
                                            "Learn More", color="danger", className="mt-auto",
                                            href='http://www.sobhe.ir/hazm/'
                                        ),
                                    ]
                                ), color="success", outline=True,
                            ),
                            dbc.Card(
                                dbc.CardBody(
                                    [
                                        html.H5("STANZA", className="card-title", style={'color': colors['green']}),
                                        html.P(
                                            'STANZA is a famous open-source package presented by Standford university.'
                                            'It is very powerful because of its flexibilities. Multilingual, run on'
                                            'GPU are just a few examples of its power. You can check it '
                                            'out through the button.',
                                            className="card-text",
                                        ),
                                        dbc.Button(
                                            "Learn More", color="danger", className="mt-auto",
                                            href='https://github.com/stanfordnlp/stanza/'
                                        ),
                                    ]
                                ), color="success", outline=True,
                            ),
                            dbc.Card(
                                dbc.CardBody(
                                    [
                                        html.H5("PARSIVAR", className="card-title", style={'color': colors['green']}),
                                        html.P('PARSIVAR is a well-known per-processing package for Persian language.'
                                               'It used as a per-processor tool in many projects in Farsi.'
                                               'You can check its all possible operations by clicking Learn More button.',
                                               className="card-text",
                                               ),
                                        dbc.Button(
                                            "Learn More", color="danger", className="mt-auto",
                                            href='https://github.com/ICTRC/Parsivar'
                                        ),
                                    ]
                                ), color="success", outline=True,
                            ),
                        ]
                    ),

                    html.Div([
                        html.H2(dbc.Jumbotron(
                            [
                                html.H4("WHAT IS PPARSER?", className="display-3", style={'color': colors['green']}),
                                html.Hr(className="my-2"),
                                html.P('PParser is an integrated package for pre-processing purposes.'),
                                html.Div(
                                    html.Div([
                                        dbc.Button("Learn More", id="open-body-scroll", color='success'),
                                        dbc.Modal(
                                            [
                                                dbc.ModalHeader("PPARSER", style={'color': colors['green']}),
                                                dbc.ModalBody('PPARSER is an integrated package. It aims to '
                                                              'save the time of developers by '
                                                              'automatization of pre-processing. '
                                                              'It uses many famous packages to reach its goal. '
                                                              'Moreover, PParser supports two '
                                                              'languages English and Persian so far. '
                                                              'With PParser all thing you '
                                                              'need to do is select the language of '
                                                              'the text you want to pre-process it and then '
                                                              'you should select the operation you intend to '
                                                              'do let say word_tokenize and that is it!'
                                                              'PParser does all steps it needs for pre-processing. '),
                                                dbc.ModalFooter(
                                                    dbc.Button(
                                                        "Close", id="close-body-scroll", className="ml-auto"
                                                    )
                                                ),
                                            ],
                                            id="modal-body-scroll",
                                            scrollable=True,
                                        ),
                                    ]),
                                ),
                            ]
                        ), style={'backgroundColor': colors['green']}),
                    ]),

                dbc.Toast(
                    [html.H6('The preprocessed file has been saved in {}'.format(UPLOAD_DIRECTORY + 'output.json'), className="mb-0")],
                    header='Info', id='RESULT', icon="success", duration=8000, style={"position": "fixed", "top": 200,
                                                                                      "right": 200, "width": 2000, 'color': colors['green']}
                )

            ], style={'textAlign': 'center'}),
        ], style={'backgroundColor': colors['test']})

        @app.callback(
            [Output("progress", "value"), Output("progress", "children")],
            [Input("progress-interval", "n_intervals")],
        )
        def update_progress(n):
            # check progress of some background process, in this example we'll just
            # use n_intervals constrained to be in 0-100
            progress = min(n % 110, 100)
            # only add text after 5% progress to ensure text isn't squashed too much
            return progress, f"{progress} %" if progress >= 5 else ""

        def toggle_modal(n1, n2, is_open):
            if n1 or n2:
                return not is_open
            return is_open

        app.callback(
            Output("modal-body-scroll", "children"),
            [
                Input("open-body-scroll", "n_clicks"),
                Input("close-body-scroll", "n_clicks"),
            ],
            [State("modal-body-scroll", "is_open")],)(toggle_modal)

        def save_file(name, content):
            """Decode and store a file uploaded with Plotly Dash."""
            content_type, content_string = content.split(',')
            decoded = base64.b64decode(content_string)
            return decoded.decode('utf-8')

        @app.callback(
            Output('RESULT', 'is_open'),
            [Input(component_id='SUBMIT', component_property='n_clicks')],
            state=[State("upload-data", "filename"), State("upload-data", "contents"),
                   State('package', 'value'), State('Operation', 'value')])
        def update_output(n_clicks, filename, contents, package, operation):
            if filename is not None and contents is not None:
                for name, data in zip(filename, contents):
                    contents = save_file(name, data)
                    pre_process_data(package, operation, contents)
                    return True
            else:
                return False

        def pre_process_data(package, operations, data):
            Pipeline(lang='Persian', package=package, processors=operations, text=data)
        app.run_server(debug=True)
Ejemplo n.º 14
0
def make_layout():
    chart_title = "data updates server-side every 5 seconds"
    return html.Div(
        children=[
            dcc.Interval(
            id='interval-component',
            interval=2000, # in milliseconds
            n_intervals=0
            ),
            dcc.Store(id='cache', storage_type='memory',data={}),
            html.Div(
                className='row telicent-header',
                children=[
                    html.Div(
                        className='col-md-4 logo-div',
                        children=[
                            html.P("MONITOR", className="app-title"),
                        ]
                    ),
                    html.Div(
                        className='col-md-4 app-title',
                        children=[
                            html.Img(src=app.get_asset_url('limegreen-logo.svg'),width="50px",className="logo"),
                            
                        ]
                    ),
                    html.Div(
                        className='col-md-4 app-controls',
                        children=[
                            html.Span("menu", id="menu-button",className="material-icons icon-button", title="menu"),
                        ]
                    )
                ]
            ),
            html.Div(id="app-body",className="row", style={"marginTop":"15px"},children=            [
                html.Div(id="controls-pane",className="col-md-2",children=[
                    html.Div(id="side",children=[
                        dbc.Checklist(
                            options=[],
                            value=[],
                            id="switches-input",
                            switch=True,
                            style={"marginTop":"100px"}
                        )
                    ],style={"fontSize":"0.6em"})
                ]
                ),
                html.Div(id="main-pane",className="col-md-10",children=[
                    dcc.Graph(id="bar-chart"),

                ]
                ),
            ]
            ),
            html.Div(id="spaedos",className="row",children=[
                html.Div(id="left-of-gauges",className="col-md-3",children=[

                ]),
                html.Div(id="gauges-col",className="col-md-9", children=[
                    html.Div(id="gauges",className="row",children= [
                        daq.Gauge(
                            id='msg-rate-gauge',
                            label="Message Rate /S",
                            value=0,
                            max=20,
                        ),
                        daq.Gauge(
                            id='trip-rate-gauge',
                            label="Triple Rate /S",
                            value=0,
                            max=3000
                        ),
                        daq.Gauge(
                            id='obj-rate-gauge',
                            label="Object Rate /S",
                            value=0,
                            max=1400
                        )
                    ])
                ])
                
            ])

        ], className="", style={"backgroundColor":"rgb(17,17,17)"}
            
    )
Ejemplo n.º 15
0
def update_stream_checklist(stream, ):
    general = [
        {'label': "(6 Credits) CMPT 204 OR CMPT 229 OR CMPT 250 OR CMPT 280 OR CMPT 291", 'value': 10},
        {
            'label': "(6 Credits) CMPT 305 OR CMPT 306 OR CMPT 315 OR CMPT 330 OR "
                     "CMPT 355 OR CMPT 360 OR CMPT 361 OR CMPT 370 OR CMPT 380 OR CMPT 391",
            'value': 11},
        {'label': "(15 to 33 Credits)", 'value': 12},

    ]

    database = [
        {'label': "CMPT 250 ", 'value': 10},
        {'label': "CMPT 270", 'value': 11},
        {'label': "CMPT 291", 'value': 12},
        {'label': "(12 Credits) CMPT 315 OR CMPT 351 OR CMPT 391 OR CMPT 450 OR CMPT 491", 'value': 13},
        {'label': "(6 to 24 Credits)", 'value': 14},
    ]

    system_info = [
        {'label': "CMPT 229 ", 'value': 10},
        {'label': "CMPT 280", 'value': 11},
        {'label': "CMPT 360", 'value': 12},
        {'label': "CMPT 361", 'value': 13},
        {'label': "CMPT 380", 'value': 14},
        {'label': "CMPT 464", 'value': 15},
        {'label': "CMPT 480", 'value': 16},
        {'label': "(6 to 24 Credits)", 'value': 17},
    ]

    gaming = [
        {'label': 'CMPT 230', 'value': 10},
        {'label': 'CMPT 291', 'value': 11},
        {'label': 'CRWR 295', 'value': 12},
        {'label': 'CMPT 330', 'value': 13},
        {'label': 'CMPT 370', 'value': 14},
        {'label': '(3 Credits) CMPT 250 OR CMPT 280 OR CMPT 355', 'value': 15},
        {'label': "9 to 27 More Credits In CMPT", 'value': 16},
    ]

    stream_to_put = []
    stream_title = "Gaming"
    # print(stream)

    if stream == "general-stream":
        stream_to_put = general
        stream_title = "General"
    elif stream == "database-stream":
        stream_to_put = database
        stream_title = "Databases and Interactive Visualization"
    elif stream == "sys-info-stream":
        stream_to_put = system_info
        stream_title = "Systems and Information Security"
    else:  # default gaming stream
        stream_to_put = gaming
        stream_title = "Gaming"

    return dbc.Col([
        html.H6(f'{stream_title} Stream', style={'margin': '10px 0'}),
        dbc.Checklist(
            id='checklist-input-2',
            options=stream_to_put,  # put stream here
            value=[],
        )
    ])
Ejemplo n.º 16
0
         dbc.Tab(label='Zachorowania',
                 tab_id="zachorowaniaTab"),
         dbc.Tab(label='Prewencja',
                 tab_id="prewencjaTab"),
         dbc.Tab(label='Województwa',
                 tab_id="wojewodztwaTab")
     ],
              id='plotTabs',
              active_tab='zachorowaniaTab',
              style={'width': '100%'}),
     html.P(''),
     html.Div(id='checkBoxDivId',
              children=dbc.Checklist(
                  id='checkBoxId',
                  options=[{
                      'label': 'Lubię logarytmy',
                      'value': 1
                  }],
                  value=[],
                  inline=True)),
     html.Div(id="plotTabsContent"),
 ],
         md=6),
 dbc.Col([
     dbc.Tabs([
         dbc.Tab(label='Potwierdzenia',
                 tab_id="heatmapInfectionTab"),
         dbc.Tab(label='Aktywne',
                 tab_id="heatmapActiveTab"),
         dbc.Tab(label='Zgony',
                 tab_id="heatmapDeathTab"),
         dbc.Tab(label='Wyzdrowienia',
Ejemplo n.º 17
0
             '2034': '2034',
             '2050': '2050'
         },
         handleLabel={
             "showCurrentValue": True,
             "label": "VALUE"
         },
         included=False,
     ),
             sm=5),
     dbc.Col(dbc.Checklist(
         id="switches",
         options=[
             {
                 "label": "Option 1",
                 "value": True
             },
         ],
         value=[],
         switch=True,
     ),
             sm=2),
 ]),
 dbc.Row(dbc.Col(PowerGraphs, sm=8, align="center", width={"offset": 2
                                                           })),
 dbc.Row(
     dbc.Col(html.Div([dbc.Jumbotron(html.P("this is a Pie Chart"))]),
             sm=8,
             align="center",
             width={"offset": 2})),
 dbc.Row(dbc.Col(PieGraphs, sm=6, align="center", width={"offset": 2})),
Ejemplo n.º 18
0
                 value='black'
                 ),
             width=8)
         ], row=True),
     dbc.FormGroup([
         dbc.Label("Exponent", width=4),
         dbc.Col(
             dbc.Input(id="artha-exponent", type="number", min=0, max=15, step=1, value=3),
             width=8)
         ], row=True),
     dbc.FormGroup([
         dbc.Label("Open-ended", width=4),
         dbc.Col(
             dbc.Checklist(
                 id="artha-openended",
                 options=[
                     {'label': '', 'value': 'open-ended'}],
                 switch=True),
             width=8)
         ], row=True),
     ]),
 dbc.Col([
     dbc.FormGroup([
         dbc.Label("Artha Options"),
         dbc.Checklist(
             options=[
                 {'label': 'Luck (1 Fate)', 'value': 'luck'},
                 {'label': 'Boon (1-3 Persona)', 'value': 'boon'},
                 {'label': 'Divine Inspiration (1 Deed)', 'value': 'divine-inspiration'},
                 {'label': 'Saving Grace (1 Deed) / Call-On', 'value': 'saving-grace'},
                 {'label': 'Aristeia (5 Fate, 3 Persona, 1 Deed)', 'value': 'aristeia'},],
Ejemplo n.º 19
0
def get_user_edit_modal():
    """User edit modal
    """
    # user edit modal
    user_edit_form = [

        html.Div(id='user-edit-alert'),

        dbc.FormGroup([
            dbc.Checklist(id='user-options-edit',
                          options=[{'label':_('Active'), 'value':'active'}],
                          value=[],
                         ),
        ]),

        dbc.FormGroup(
            [
            dbc.Label(_('UID'), html_for='uid-edit'),
            dbc.Col(html.Div(id='uid-edit'),
                width=10, className='align-middle',
            ),
            ],
            row=True,
            className='m-0',
        ),

        dbc.FormGroup([
            dbc.Label(_('Name'), html_for='name-edit'),
            dbc.Input(type='text', id='name-edit',
                      placeholder=_('First and Last Name')),
        ]),

        dbc.FormGroup([
            dbc.Label(_('Email'), html_for='email-edit'),
            dbc.Input(type='email',
                      placeholder=_('Enter email'),
                      disabled=True,
                      id='email-edit',
                     ),
        ]),

        dbc.FormGroup([
            dbc.Label(_('Password'), html_for='password1-edit'),
            dbc.Input(type='password',
                      id='password1-edit',
                      placeholder=_('Enter password'),
                     ),
        ]),

        dbc.FormGroup([
            dbc.Label(_('Password (Confirm)'), html_for='password2-edit'),
            dbc.Input(type='password',
                      id='password2-edit',
                      placeholder=_('Confirm password'),
                     ),
        ]),

    ]

    return html.Div(
        [
            dbc.Modal(
                [
                    dbc.ModalHeader([_('Edit User')]),
                    dbc.ModalBody(user_edit_form),
                    dbc.ModalFooter([
                        dbc.Button(_('Close'),
                                   className='ml-auto',
                                   size='sm',
                                   id='close-edit',
                                  ),
                        dbc.Button(_('Save'),
                                   id='save-edit',
                                   color='primary',
                                   size='sm',
                                   className='ml-1',
                                  ),
                    ]),
                ],
                is_open=False,
                id='user-edit-modal',
            )
        ]
    )
Ejemplo n.º 20
0
 html.H4(" * Date 입력"),
 dcc.DatePickerSingle(
     id='date-picker',
     date='2021-05-13',
     display_format='YYYY-MM-DD',
 ),
 html.Br(),
 html.H4(" * Sector, TICKER 입력"),
 dcc.Dropdown(
     id='dropdown-sector',
     options=[{'label': s, 'value': s} for s in ['Telecom_Service', 'IT']],
     value='Telecom_Service',
     clearable=False),
 dbc.Checklist(
     id='checklist-ticker',
     options=[],
     labelStyle={'display': 'inline-block'},
     inline=True
    ),
 html.H4(" * TICKER 데이터"),
 dash_table.DataTable(
     id='datatable',
     data=df.to_dict('records'),
     columns=[
         {
             "name": i,
             "id": i,
             "deletable": True,
             "selectable": True,
             "hideable": True,
         }
         if i == "High" or i == "Low" or i == "Open" or i == "Adj Close"
Ejemplo n.º 21
0
    for month, month_df in year_df.groupby(pd.Grouper(freq="M")):
        button_id = f"{month.month_name()}-{year.year}"
        button_ids.append(button_id)
        elements.append(
            dbc.Button(month.month_name(), color="light", id=button_id))

switches = dbc.FormGroup([
    dbc.Label("By transaction type"),
    dbc.Checklist(
        options=[
            {
                "label": "Hide transfers",
                "value": "hide_transfers"
            },
            {
                "label": "Hide uncategorised",
                "value": "hide_uncategorised"
            },
        ],
        value=["hide_transfers", "hide_uncategorised"],
        id="switches-input",
        switch=True,
    ),
])

sidebar = html.Div(
    [
        html.H1("Clover"),
        html.P("A budgeting app that keeps it simple", className="lead"),
        dbc.Nav(
            [
Ejemplo n.º 22
0
 html.H5(children='Dissimilarity Function'),
 dcc.Dropdown(id='dropdown_fun_desigualdad',
              options=[{
                  'label': 'Quantization Error',
                  'value': 'qe'
              }, {
                  'label': 'Mean Quantization Error',
                  'value': 'mqe'
              }],
              value='qe',
              searchable=False),
 html.H5(children='Seed:'),
 html.Div([
     dbc.Checklist(options=[{
         "label": "Select Seed",
         "value": 1
     }],
                   value=[],
                   id="check_semilla")
 ]),
 html.Div(id='div_semilla',
          children=[
              dcc.Input(id="seed_gsom",
                        type="number",
                        value="0",
                        step=1,
                        min=0,
                        max=(2**32 - 1))
          ],
          style={
              "visibility": "hidden",
              'display': 'none'
Ejemplo n.º 23
0
def get_app(server=None):
    if server:
        app = dash.Dash(
            __name__,
            server=server,
            url_base_pathname='/imbalanceddata/',
            external_stylesheets=[dbc.themes.BOOTSTRAP]
        )
    else:
        app = dash.Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])
    app.title = "จำนวนข้อมูลที่ไม่สมดุลกัน"

    ## load data
    data = load_breast_cancer()
    X = data['data'][:, :2]
    y = data['target']

    fn = ['รัศมีเฉลี่ย', 'ความขรุขระ']
    cn = ['มะเร็ง/เนื้อร้าย', 'เนื้องอก']

    idx = np.random.choice(np.where(y == 0)[0], size=int(
        np.sum(y == 1)*0.1), replace=False)

    noise = np.random.normal(0, 0.1, (idx.size*10, 2))
    noise[:,1] = noise[:,1] * 2
    noise[:idx.size, :] = 0

    x_train = np.concatenate((X[y == 1], X[idx]))
    y_train = np.concatenate((y[y == 1], y[idx]))

    plot_step = 0.1
    x_min, x_max = X[:, 0].min() - 1, X[:, 0].max() + 1
    y_min, y_max = X[:, 1].min() - 1, X[:, 1].max() + 1
    xx, yy = np.meshgrid(np.arange(x_min, x_max, plot_step),
                         np.arange(y_min, y_max, plot_step))

    def get_fig(x_train, y_train, show_dec_bound=False):
        clf = tree.DecisionTreeClassifier(
            random_state=0, max_depth=4, min_samples_split=10)
        clf = clf.fit(x_train, y_train)
        tree.plot_tree(clf)

        Z = clf.predict(np.c_[xx.ravel(), yy.ravel()])
        Z = Z.reshape(xx.shape)

        fig_layout = go.Layout(
            uirevision=True,
            margin=dict(b=0, l=0, r=0, t=40),
            xaxis=dict(range=[x_min, x_max]),
            xaxis_title=fn[0],
            yaxis=dict(range=[y_min, y_max]),
            yaxis_title=fn[1],
        )
        if show_dec_bound:
            fig = go.Figure(data=go.Heatmap(
                z=Z, 
                x=np.arange(x_min, x_max, plot_step),
                y=np.arange(y_min, y_max, plot_step),
                colorscale=[[0, '#ef553b'], [1, '#636efa']],
                opacity=0.2,
                colorbar=dict(),
                showscale=False
            ), layout=fig_layout)
        else:
            fig = go.Figure(layout=fig_layout)

        colors = ['239, 85, 59', '99, 110, 250']
        symbols = ['circle', 'square']
        for i, (color, symbol) in enumerate(zip(colors, symbols)):
            idx = np.where(y_train == i)
            fig.add_trace(go.Scatter(x=x_train[idx, 0].squeeze(), y=x_train[idx, 1].squeeze(),
                                     mode='markers',
                                     name=cn[i],
                                    #  marker_size=12,
                                     marker_color='rgb('+color+')',))
                                    #  marker_symbol=symbol,
                                    #  marker_line_color='rgb('+color+')', 
                                    #  marker_line_width=2))
        return fig

    fig = get_fig(x_train, y_train)

    ## Control
    under_spl_marks = {i: ''.format(i) for i in range(10, 101, 10)}
    under_spl_marks[10] = '10%'
    under_spl_marks[100] = '100%'
    over_spl_marks = {i: ''.format(i) for i in range(100, 1001, 100)}
    over_spl_marks[100] = '100%'
    over_spl_marks[1000] = '1000%'

    controls = dbc.Card([
        dbc.FormGroup([
            html.H5(["Under-Sampling", dbc.Badge("100%", className="ml-1", color="primary", id='under-spl-label')]),
            dcc.Slider(
                id='under-spl-slider-id',
                min=10,
                max=100,
                step=None,
                marks=under_spl_marks,
                value=100
            ),
        ]),
        dbc.FormGroup([
            html.H5(["Over-Sampling", dbc.Badge("100%", className="ml-1", color="primary", id='over-spl-label')]),
            dcc.Slider(
                id='over-spl-slider-id',
                dots=True,
                min=100,
                max=1000,
                step=None,
                marks=over_spl_marks,
                value=100,
            ),
        ]),
        dbc.FormGroup([
            # dbc.Label("Parameter"),
            html.H5(["Parameter"]),
            dbc.Checklist(
                options=[
                    {"label": "แสดงขอบเขตการจำแนก", "value": 1},
                ],
                value=[],
                id="show-dec-bound-id",
                inline=True,
                switch=True,
            ),
        ]),
    ],
        body=True,
    )

    ## Main layout
    app.layout = dbc.Container(
        [
            html.H1("จำนวนข้อมูลที่ไม่สมดุลกัน (Imbalanced Data)"),
            html.Div(children='''
                ในแบบฝึกหัดนี้ ให้นักเรียนลองใช้เทคนิค 1) การสุ่มข้อมูลจากกลุ่มหลักให้มีน้อยลง (Under-Sampling) และ 2) 
                การสร้างข้อมูลของกลุ่มย่อยให้มีมากขึ้น (Over-Sampling) แล้วลองสังเกต Decision Tree ผลลัพธ์ ที่ได้
            '''),
            html.Hr(),
            dbc.Row(
                [
                    dbc.Col(controls, md=4),
                    dbc.Col(dcc.Graph(id="graph-id", figure=fig), md=8),
                ],
                align="center",
            ),
        ],
        fluid=True,
    )


    def under_sampling(x_train, y_train, ratio):
        num = int(np.sum(y_train == 1)*ratio/100.0)
        idx = np.where(y_train == 1)[0][:num]

        x_new = np.concatenate((x_train[y_train == 0], x_train[idx]))
        y_new = np.concatenate((y_train[y_train == 0], y_train[idx]))
        return x_new, y_new

    def over_sampling(x_train, y_train, ratio, noise=noise):
        n = np.sum(y_train == 0)
        num = int(n*ratio/100.0)
        pos = np.arange(num) % n

        idx = np.where(y_train == 0)[0][pos]
        x_new = np.concatenate(
            (x_train[idx]+noise[:pos.shape[0]], x_train[y_train == 1]))
        y_new = np.concatenate((y_train[idx], y_train[y_train == 1]))
        return x_new, y_new

    def update_under_div(under_ratio, over_ratio, show_decision_boundary):
        x_under, y_under = under_sampling(x_train, y_train, under_ratio)
        x_new, y_new = over_sampling(x_under, y_under, over_ratio)
        fig = get_fig(x_new, y_new, len(show_decision_boundary))
        return f'{under_ratio}%', f'{over_ratio}%', fig

    app.callback([Output('under-spl-label', 'children'),
                  Output('over-spl-label', 'children'),
                  Output('graph-id', 'figure')],
                 [Input("under-spl-slider-id", "value"),
                  Input('over-spl-slider-id', 'value'),
                  Input('show-dec-bound-id', 'value')])(
        update_under_div
    )

    return app
Ejemplo n.º 24
0
flts = filtros.reuni_filtros(contratoB)

modal = [
    dbc.ModalHeader("Filtros Aplicados na Página"),
    dbc.ModalBody([
        html.Div([
            html.H5('TIPO DE CONTRATO'),
            html.Div([
                    html.Button(id="btn-tipo-contrato", className="dropbtn"),
                    dbc.FormGroup(
                        [
                            dbc.Checklist(
                                options=[
                                    {"label": "Todos", "value": 'TD'},
                                ],
                                value=['TD'],
                                id="checklist-tipo-contrato-todos",
                            ),
                            filtros.cria_checklist(flts['TIPO DE CONTRATO'],"checklist-tipo-contrato-valores"),
                        ], id="check-list-tipo-contrato", className="dropdown-content2"
                    ),
                ],className="dropdown2")
        ], className="modal-item"),
        
        html.Div([
            html.H5('SUBMERCADO'),
            html.Div([
                    html.Button('Todos', id="btn-submercado", className="dropbtn"),
                    dbc.FormGroup(
                        [
Ejemplo n.º 25
0
)

# Checklist for pipeline
check_pipeline = dbc.FormGroup([
    dbc.Label("Pipeline"),
    dbc.Checklist(
        options=[
            {
                "label": "Dataset downloaded",
                "value": 'dataset',
                "disabled": True
            },
            {
                "label": "Features extracted",
                "value": 'features',
                "disabled": True
            },
            {
                "label": "Model created",
                "value": 'model',
                "disabled": True
            },
        ],
        value=[],
        id="check_pipeline",
    ),
])

# Define Tab Model (1)
tab_model = html.Div([
    alert, msg_features,
Ejemplo n.º 26
0
            multi=True
        ),
        html.Br(),

        html.P('Cases', style={
            'textAlign': 'center'
        }),
        dbc.Card([dbc.Checklist(
            id='check_list_cases',
            options=[{
                'label': 'Deaths',
                'value': 'value1'
            },
                {
                    'label': 'Recovered',
                    'value': 'value2'
            },
                {
                    'label': 'Active Cases',
                    'value': 'value3'
            }
            ],
            value=['value1', 'value2'],
            inline=True
        )]),
        html.Br(),
        html.H2('Bar Graph', style=TEXT_STYLE),
        html.Hr(),
        html.P('Pick a County', style={
            'textAlign': 'center'
        }),
        dcc.Dropdown(
Ejemplo n.º 27
0
               children='Actualizar',
               color='primary',
               block=True)
])

controls2 = dbc.FormGroup([
    html.P('Check Box', style={'textAlign': 'center'}),
    html.Hr(),
    dbc.Card([
        dbc.Checklist(id='check_list',
                      options=[{
                          'label': 'Value One',
                          'value': 'value1'
                      }, {
                          'label': 'Value Two',
                          'value': 'value2'
                      }, {
                          'label': 'Value Three',
                          'value': 'value3'
                      }],
                      value=['value1', 'value2'],
                      inline=True)
    ]),
    html.Br(),
    html.P('Radio Items', style={'textAlign': 'center'}),
    dbc.Card([
        dbc.RadioItems(id='radio_items',
                       options=[{
                           'label': 'Value One',
                           'value': 'value1'
                       }, {
Ejemplo n.º 28
0
        placeholder="Choose a Stream",
        searchable=False,
    ),

    dbc.FormGroup(
        id='checklist',
        children=
        [
            # Declaring Computer Science
            dbc.Row(dbc.Col([
                html.H6('Declaring Computer Science', style={'margin': '10px 0'}),
                dbc.Checklist(
                    options=[
                        {'label': 'CMPT 101', 'value': 1},
                        {'label': 'MATH 114', 'value': 2},
                        {'label': 'MATH 120 OR MATH 125', 'value': 3},
                        {'label': 'STAT 151', 'value': 4},
                    ],
                    value=[],
                    id='checklist-input-0',
                )
            ])),

            # Computer Science Major
            dbc.Row(dbc.Col([
                html.H6('Computer Science Major', style={'margin': '10px 0'}),
                dbc.Checklist(
                    id='checklist-input-1',
                    options=[
                        {'label': 'CMPT 103', 'value': 5},
                        {'label': 'CMPT 200', 'value': 6},
                        {'label': 'CMPT 201', 'value': 7},
Ejemplo n.º 29
0
    ]
)


checklist_items = dbc.Card(
    [
        html.H2(make_subheading("dbc.Checklist", "input/"),),
        dbc.CardBody(
            [
                dbc.Row(
                    [
                        dbc.Col(
                            dbc.Checklist(
                                id="gallery_checklist1",
                                options=[
                                    {"label": "Option {}".format(i), "value": i}
                                    for i in range(3)
                                ],
                                value=[1, 2],
                            )
                        ),
                        dbc.Col(
                            dbc.Checklist(
                                id="gallery_checklist2",
                                options=[
                                    {"label": "Option {}".format(i), "value": i}
                                    for i in range(3)
                                ],
                                value=[1, 2],
                                switch=True,
                            )
                        ),
Ejemplo n.º 30
0
        className="mb-1",
    ),
    dbc.Row(
        [
            dbc.Label("Start date", className="col-3 p-0"),
            dbc.Input(type="date", id="start_date", className="col-3 p-0 "),
            dbc.Label("End date", className="col-3 "),
            dbc.Input(type="date", id="end_date", className="col-3 p-0"),
        ],
        className="mb-1",
    ),
    dbc.Row([
        dbc.Checklist(
            id="checkList",
            options=[{
                "label": "execute Code ?",
                "value": True
            }],
            className="col-3 mr-1",
        ),
        dbc.Button(
            "Run",
            id="run_code",
            className=" btn btn-success float float-right mr-2 ",
        ),
        dbc.Button(
            "Save file",
            id="save_btn",
            className=" btn btn-primary float float-right mr-0",
        ),
    ]),
])