Beispiel #1
0
    def options_layout(self, inital_args_kwargs):

        options = html.Div([
            html.Div([
                Label("Rotation axis"),
                dcc.Input(
                    value="[1, 0, 0]",
                    id=self.id("gb_rotation_axis"),
                    type="text",
                    className="input",
                ),
            ]),
            html.Br(),
            html.Div([
                Label("Choose Σ"),
                dcc.Dropdown(
                    id=self.id("gb_sigma_options"),
                    options=[],
                    placeholder="...",
                ),
            ]),
            html.Br(),
            html.Div([
                Label("Choose rotation angle"),
                dcc.Dropdown(
                    id=self.id("gb_rotation_options"),
                    options=[],
                    placeholder="...",
                ),
            ]),
            html.Br(),
            html.Div([
                Label("Grain width"),
                dcc.Slider(
                    id=self.id("gb_expand_times"),
                    min=1,
                    max=6,
                    step=1,
                    value=2,
                    marks={
                        2: "2",
                        4: "4",
                        6: "6"
                    },
                ),
            ]),
            html.Br(),
            html.Div([
                Label("Distance between grains in Å"),
                dcc.Input(
                    value="0.0",
                    id=self.id("gb_vacuum_thickness"),
                    type="text",
                    className="input",
                ),
            ]),
            html.Br(),
            html.Div([
                Label("Plane"),
                dcc.Input(
                    value="None",
                    id=self.id("gb_plane"),
                    type="text",
                    className="input",
                ),
            ]),
        ])

        return options
Beispiel #2
0
url = "https://api.weatherbit.io/v2.0/current"
api_key = ""

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

app.layout = html.Div([
    html.Div([
        html.H1("Прогноз погоды"),
        html.Br()
    ],className='header'),

    html.Div([
        html.H4("Меня интересует погода в:"),
        dcc.Input(id="city-input", value="Москва", type="text"),
        html.Button(id='submit-button', n_clicks=0, children='Submit'),
        html.Br()
    ], className='user-input'),

    html.Div([
        html.Div([
            html.Img(id='weather-icon'),
            html.Div(id="weather-description")
        ], className='grid-item'),
        html.Div([
            html.Img(src=app.get_asset_url("thermometer.png")),
            html.Div(id="temperature")
        ], className='grid-item'),
        html.Div([
            html.Img(src=app.get_asset_url("humidity.png")),
    ),
 html.
 H3('Weapon stats were pulled from in game menus and use a python based computer vision script to determine the +/- of attachments'
    ),
 html.
 H3('Data is compiled and charted out for you to min/max everything.'
    ),
 html.Br(),
 html.H3('Good Hunting'),
 html.Br(),
 html.Hr(),
 html.Br(),
 html.H2("WHAT'S YOUR GAMERTAG?"),
 dcc.Input(
     id="gamertag",
     type='text',
     value='John Wick',
     style={'textAlign': 'center'},
 ),
 html.Br(),
 html.Br(),
 html.H2("NAME YOUR BUILD"),
 dcc.Input(
     id="guncode",
     type='text',
     value='YeetCannon5000',
     style={'textAlign': 'center'},
 ),
 html.Br(),
 html.Br(),
 html.Div(style={
     'textAlign': 'center',
Beispiel #4
0
             html.H1("Find TeeTimes", className="display-3"),
             html.P(
                 "View all available TeeTimes - For Golfbroes",
                 className="lead",
             ),
         ],
         fluid=True,
     ),
 ],
               fluid=True,
               style={'margin-bottom': '0px'},
               className="mb-3"),
 dbc.Row([
     dbc.Col(
         dcc.Input(id="Username",
                   type='text',
                   placeholder="Username",
                   className="mb-3"), ),
     dbc.Col([
         dcc.Input(id="Password",
                   type='password',
                   placeholder="Password",
                   className="mb-3"),
     ]),
     dbc.Col([
         dcc.DatePickerSingle(id='date-picker',
                              min_date_allowed=TODAYS_DATE,
                              max_date_allowed=MAX_DATE,
                              initial_visible_month=TODAYS_DATE,
                              date=TODAYS_DATE,
                              display_format='DD/MM/YYYY',
                              className="mb-3"),
Beispiel #5
0
def create_app_ui():
    # Create the UI of the Webpage here
    main_layout = html.Div(
        style={
            #'textAlign':'center',
            'backgroundColor': '#F9E79F'
            #'background-image': 'url(https://cdn.pixabay.com/photo/2016/11/29/01/13/background-1866485_1280.jpg)'
        },
        children=[
            html.H1('Terrorism Analysis with Insights',
                    id='Main_title',
                    style={
                        'textAlign': 'center',
                        'backgroundColor': '#D1F2EB',
                    }),
            html.H4('by Prateek Paul',
                    id='Sub_title',
                    style={'textAlign': 'center'}),
            dcc.Tabs(
                id="Tabs",
                value="Map",
                style={
                    'font-weight': 'bold',
                },
                children=[
                    dcc.Tab(
                        label="Map tool",
                        id="Map tool",
                        value="Map",
                        children=[
                            dcc.Tabs(id="subtabs",
                                     value="WorldMap",
                                     children=[
                                         dcc.Tab(
                                             label="World Map tool",
                                             id="World",
                                             value="WorldMap",
                                         ),
                                         dcc.Tab(label="India Map tool",
                                                 id="India",
                                                 value="IndiaMap")
                                     ],
                                     colors={
                                         "border": "red",
                                         "primary": "gold",
                                         "background": "cornsilk"
                                     }),
                            html.Br(),
                            dcc.Dropdown(
                                id='month',
                                options=month_list,
                                placeholder='Select Month',
                                multi=True,
                                style={
                                    'width': '600px',
                                    'padding': '10px',
                                    'display': 'inline-block'
                                },
                            ),
                            #html.Br(),
                            dcc.Dropdown(
                                id='date',
                                placeholder='Select Day',
                                multi=True,
                                style={
                                    'width': '600px',
                                    'padding': '10px',
                                    'display': 'inline-block'
                                },
                            ),
                            html.Br(),
                            dcc.Dropdown(
                                id='region-dropdown',
                                options=region_list,
                                placeholder='Select Region',
                                multi=True,
                                style={
                                    'width': '390px',
                                    'padding': '10px',
                                    'display': 'inline-block'
                                },
                            ),
                            #html.Br(),
                            dcc.Dropdown(
                                id='country-dropdown',
                                options=[{
                                    'label': 'All',
                                    'value': 'All'
                                }],
                                placeholder='Select Country',
                                multi=True,
                                style={
                                    'width': '390px',
                                    'padding': '10px',
                                    'display': 'inline-block'
                                },
                            ),
                            #html.Br(),
                            dcc.Dropdown(
                                id='state-dropdown',
                                options=[{
                                    'label': 'All',
                                    'value': 'All'
                                }],
                                placeholder='Select State or Province',
                                multi=True,
                                style={
                                    'width': '390px',
                                    'padding': '10px',
                                    'display': 'inline-block'
                                },
                            ),
                            html.Br(),
                            dcc.Dropdown(
                                id='city-dropdown',
                                options=[{
                                    'label': 'All',
                                    'value': 'All'
                                }],
                                placeholder='Select City',
                                multi=True,
                                style={
                                    'width': '600px',
                                    'padding': '10px',
                                    'display': 'inline-block'
                                },
                            ),
                            #html.Br(),
                            dcc.Dropdown(
                                id='attacktype-dropdown',
                                options=
                                attack_type_list,  #[{'label': 'All', 'value': 'All'}],
                                placeholder='Select Attack Type',
                                multi=True,
                                style={
                                    'width': '600px',
                                    'padding': '10px',
                                    'display': 'inline-block'
                                },
                            ),
                            html.Br(),
                            html.H5('Select the Year', id='year_title'),
                            dcc.RangeSlider(
                                id='year-slider',
                                min=min(year_list),
                                max=max(year_list),
                                value=[min(year_list),
                                       max(year_list)],
                                marks=year_dict,
                                step=None),
                            html.Br()
                        ]),
                    dcc.Tab(
                        label="Chart Tool",
                        id="chart tool",
                        value="Chart",
                        children=[
                            dcc.Tabs(
                                id="subtabs2",
                                value="WorldChart",
                                children=[
                                    dcc.Tab(
                                        label="World Chart tool",
                                        id="WorldC",
                                        value="WorldChart"),  #, children = [
                                    dcc.Tab(label="India Chart tool",
                                            id="IndiaC",
                                            value="IndiaChart")
                                ],
                                colors={
                                    "border": "red",
                                    "primary": "gold",
                                    "background": "cornsilk"
                                }),
                            html.Br(),
                            html.Br(),
                            dcc.Dropdown(
                                id="Chart_Dropdown",
                                options=chart_dropdown_values,
                                placeholder="Select option",
                                value="region_txt",
                                style={
                                    'width': '90%',
                                    'padding': '5px',
                                    #'display':'inline-block'
                                },
                            ),
                            #html.Br(),
                            #html.Br(),
                            html.Hr(),
                            dcc.Input(
                                id="search",
                                placeholder="Search Filter",
                                style={
                                    'width': '60%',
                                    'padding': '10px',
                                    #'display':'inline-block'
                                },
                            ),
                            html.Hr(),
                            html.Br(),
                            dcc.RangeSlider(
                                id='cyear_slider',
                                min=min(year_list),
                                max=max(year_list),
                                value=[min(year_list),
                                       max(year_list)],
                                marks=year_dict,
                                step=None),
                            html.Br()
                        ]),
                ]),
            html.Div(id="graph-object", children="Graph will be shown here"),
            html.
            H6('A Big Thanks to Forsk Coding School for helping and guiding me in this project',
               id='End_title',
               style={'textAlign': 'center'}),
        ])

    return main_layout
def cross_over_drop_down(input, parents_prob, cross_over_points):
    if input is None:
        return [
            html.Span('Cross over Algorithms'),
            dcc.Dropdown(id='cross-over-dropdown',
                         options=cross_over_options,
                         value=None),
            html.Span('Probability of which parents', style={'display': 'None'}),
            dcc.Input(id='parents-probability', value=parents_prob, style={'display': 'None'}),
            html.Span('Points', style={'display': 'None'}),
            dcc.Input(id='cross-over-points-number', value=cross_over_points, style={'display': 'None'}),
        ]
    elif input == 0:
        return [
            html.Span('Cross over Algorithms'),
            dcc.Dropdown(id='cross-over-dropdown',
                         options=cross_over_options,
                         value=0),
            html.Span('Probability of which parents', style={'display': 'None'}),
            dcc.Input(id='parents-probability', value=parents_prob, style={'display': 'None'}),
            html.Span('Points', style={'display': 'None'}),
            dcc.Input(id='cross-over-points-number', value=cross_over_points, style={'display': 'None'}),
        ]
    elif input == 1:
        return [
            html.Span('Cross over Algorithms'),
            dcc.Dropdown(id='cross-over-dropdown',
                         options=cross_over_options,
                         value=1),
            html.Span('Probability of which parents'),
            dcc.Input(id='parents-probability', value=parents_prob),
            html.Span('Number of Points'),
            dcc.Input(id='cross-over-points-number', value=cross_over_points),
        ]
    elif input == 2:
        return [
            html.Span('Cross over Algorithms'),
            dcc.Dropdown(id='cross-over-dropdown',
                         options=cross_over_options,
                         value=2),
            html.Span('Probability of which parents'),
            dcc.Input(id='parents-probability', value=parents_prob),
            html.Span('Number of Points', style={'display': 'None'}),
            dcc.Input(id='cross-over-points-number', value=cross_over_points, style={'display': 'None'}),
        ]
    elif input == 3:
        return [
            html.Span('Cross over Algorithms'),
            dcc.Dropdown(id='cross-over-dropdown',
                         options=cross_over_options,
                         value=3),
            html.Span('Probability of which parents', style={'display': 'None'}),
            dcc.Input(id='parents-probability', value=parents_prob, style={'display': 'None'}),
            html.Span('Number of Points', style={'display': 'None'}),
            dcc.Input(id='cross-over-points-number', value=cross_over_points, style={'display': 'None'}),
        ]
    elif input == 4:
        return [
            html.Span('Cross over Algorithms'),
            dcc.Dropdown(id='cross-over-dropdown',
                         options=cross_over_options,
                         value=4),
            html.Span('Probability of which parents', style={'display': 'None'}),
            dcc.Input(id='parents-probability', value=parents_prob, style={'display': 'None'}),
            html.Span('Number of Points', style={'display': 'None'}),
            dcc.Input(id='cross-over-points-number', value=cross_over_points, style={'display': 'None'}),
        ]
    elif input == 5:
        return [
            html.Span('Cross over Algorithms'),
            dcc.Dropdown(id='cross-over-dropdown',
                         options=cross_over_options,
                         value=5),
            html.Span('Probability of which parents', style={'display': 'None'}),
            dcc.Input(id='parents-probability', value=parents_prob, style={'display': 'None'}),
            html.Span('Number of Points', style={'display': 'None'}),
            dcc.Input(id='cross-over-points-number', value=cross_over_points, style={'display': 'None'}),
        ]
    elif input == 6:
        return [
            html.Span('Cross over Algorithms'),
            dcc.Dropdown(id='cross-over-dropdown',
                         options=cross_over_options,
                         value=6),
            html.Span('Probability of which parents', style={'display': 'None'}),
            dcc.Input(id='parents-probability', value=parents_prob, style={'display': 'None'}),
            html.Span('Number of Points', style={'display': 'None'}),
            dcc.Input(id='cross-over-points-number', value=cross_over_points, style={'display': 'None'}),
        ]
    elif input == 7:
        return [
            html.Span('Cross over Algorithms'),
            dcc.Dropdown(id='cross-over-dropdown',
                         options=cross_over_options,
                         value=7),
            html.Span('Probability of which parents', style={'display': 'None'}),
            dcc.Input(id='parents-probability', value=parents_prob, style={'display': 'None'}),
            html.Span('Number of Points', style={'display': 'None'}),
            dcc.Input(id='cross-over-points-number', value=cross_over_points, style={'display': 'None'}),
        ]
    elif input == 8:
        return [
            html.Span('Cross over Algorithms'),
            dcc.Dropdown(id='cross-over-dropdown',
                         options=cross_over_options,
                         value=8),
            html.Span('Probability of which parents', style={'display': 'None'}),
            dcc.Input(id='parents-probability', value=parents_prob, style={'display': 'None'}),
            html.Span('Number of Points'),
            dcc.Input(id='cross-over-points-number', value=cross_over_points),
        ]
    elif input == 9:
        return [
            html.Span('Cross over Algorithms'),
            dcc.Dropdown(id='cross-over-dropdown',
                         options=cross_over_options,
                         value=9),
            html.Span('Probability of which parents', style={'display': 'None'}),
            dcc.Input(id='parents-probability', value=parents_prob, style={'display': 'None'}),
            html.Span('Number of Points', style={'display': 'None'}),
            dcc.Input(id='cross-over-points-number', value=cross_over_points, style={'display': 'None'}),
        ]
    elif input == 10:
        return [
            html.Span('Cross over Algorithms'),
            dcc.Dropdown(id='cross-over-dropdown',
                         options=cross_over_options,
                         value=10),
            html.Span('Probability of which parents', style={'display': 'None'}),
            dcc.Input(id='parents-probability', value=parents_prob, style={'display': 'None'}),
            html.Span('Number of Points', style={'display': 'None'}),
            dcc.Input(id='cross-over-points-number', value=cross_over_points, style={'display': 'None'}),
        ]
    elif input == 11:
        return [
            html.Span('Cross over Algorithms'),
            dcc.Dropdown(id='cross-over-dropdown',
                         options=cross_over_options,
                         value=11),
            html.Span('Probability of which parents'),
            dcc.Input(id='parents-probability', value=parents_prob),
            html.Span('Number of Points', style={'display': 'None'}),
            dcc.Input(id='cross-over-points-number', value=cross_over_points, style={'display': 'None'}),
        ]
Beispiel #7
0
    )


# external_stylesheets = [dbc.themes.BOOTSTRAP]
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__,
                external_stylesheets=external_stylesheets,
                url_base_pathname='/nanoexplorer/')
app.config.suppress_callback_exceptions = True

app.layout = html.Div([
    html.B("Dataset pattern: "),
    dcc.Input(
        id="input-pattern",
        type="text",
        debounce=True,
        style={"min-width": "40%"},
        value="/TTTT*/*NanoAODv7*/NANOAODSIM",
    ),
    html.Hr(),
    html.B("Matching datasets:"),
    html.Div(id='table-datasets-container'),
    html.Hr(),
    html.B("Files:"),
    html.Div(id='table-files-container'),
    html.Hr(),
    html.B("Branches:"),
    html.Div(id='table-branches-container'),
    html.Div(id="graphs"),
])
Beispiel #8
0
dcc.RangeSlider(
    marks={i: 'Label {}'.format(i) for i in range(-5, 7)},
    min=-5,
    max=6,
    value=[-3, 4]
)''',
                          style=styles.code_container),
        html.Br(),
        dcc.Link('More RangeSlider Examples and Reference',
                 href=tools.relpath("/dash-core-components/rangeslider")),
        html.Hr(),
        html.H2(
            dcc.Link('Input',
                     href=tools.relpath('/dash-core-components/input'))),
        rc.ComponentBlock('''import dash_core_components as dcc

dcc.Input(
    placeholder='Enter a value...',
    type='text',
    value=''
)''',
                          style=styles.code_container),
        html.Br(),
        dcc.Link('More Input Examples and Reference',
                 href=tools.relpath("/dash-core-components/input")),
        html.Hr(),
        html.H2(
            dcc.Link('Textarea',
                     href=tools.relpath('/dash-core-components/textarea'))),
        rc.ComponentBlock('''import dash_core_components as dcc
Beispiel #9
0
                         'background-color': 'white'
                     }),
         href='http://127.0.0.1:8080/home',
     )),
 html.Div(
     children='Data Visualization',
     style={
         'color': 'black',
         #'border': '2px green solid',
         'padding': '20px',
         'font-size': 'large',
         'textAlign': 'center'
     }),
 html.P(html.Label('Start Time:')),
 dcc.Input(id='start-time-input',
           type='datetime-local',
           value=dt.strftime(min_date, '%Y-%m-%dT%H:%M'),
           className='form-control'),
 html.P(html.Label('End Time:')),
 dcc.Input(id='end-time-input',
           type='datetime-local',
           min=dt(1995, 8, 5),
           max=dt(2017, 9, 19),
           value=dt.strftime(max_date, '%Y-%m-%dT%H:%M'),
           className='form-control'),
 html.P(html.Button(id='submit-button', n_clicks=0, children='OK')),
 html.P(html.Label('Channel selection :')),
 dcc.Dropdown(id='drop_id',
              options=[{
                  'label': 'Channel 1',
                  'value': 'ch1'
              }, {
        dcc.Graph(id='hashrate-graph', figure={}),
        dcc.Graph(
            id='revratio-graph',
            figure={},
        ),
        # dcc.Graph(
        #     id='intervals-graph',
        #     figure={},
        # ),
        dcc.Graph(
            id='conftimes-graph',
            figure={},
        ),
        html.Div(id='profits', children=[]),
        html.Div(children=(html.H4("Advanced configuration"))),
        html.Div(children=(dcc.Input(
            id='Seed', value=seed, type="number", name="Randomness seed"),
                           html.H6("Randomness seed")),
                 style={'display': 'flex'}),
        html.Div(children=(dcc.Input(id='blocks',
                                     value=params['num_blocks'],
                                     type="number",
                                     step=100,
                                     min=100,
                                     max=50000,
                                     required=True,
                                     persistence=True),
                           html.H6("Number of blocks to simulate")),
                 style={'display': 'flex'}),

        # html.Div(children=(dcc.Input(id='', value=params[''], type="number",
        #                        step=100, min=100, max=50000, required=True, persistence=True),
Beispiel #11
0
# -*- coding: utf-8 -*-
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State

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

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

app.layout = html.Div([
    dcc.Input(id='input-1-state', type='text', value='Montréal'),
    dcc.Input(id='input-2-state', type='text', value='Canada'),
    html.Button(id='submit-button-state', n_clicks=0, children='Submit'),
    html.Div(id='output-state')
])


@app.callback(
    Output('output-state',
           'children'), [Input('submit-button-state', 'n_clicks')],
    [State('input-1-state', 'value'),
     State('input-2-state', 'value')])
def update_output(n_clicks, input1, input2):
    return u'''
        The Button has been pressed {} times,
        Input 1 is "{}",
        and Input 2 is "{}"
    '''.format(n_clicks, input1, input2)

Beispiel #12
0
def Contact():

    # Form details
    formspree_url="https://formspree.io/xqkdkggg"
    mailing_list="*****@*****.**"


    nav = Navbar()
    footer = Footer()

    name_input = dbc.FormGroup(
        [
            dbc.Row(
            [
                dbc.Col(html.Label("Topic", htmlFor="name-row"),width="auto"),
                dbc.Col(
                    dcc.Input(
                        type="text",
                        id="name-row",
                        name="name",
                        className="form-control",
                        placeholder="Enter the topic of your message",
                        style={"width":"50%"},
                    ),
                    width=True
                ),
            ],
            )
        ],
    )

    email_input = dbc.FormGroup(
        [
            dbc.Row(
            [
                dbc.Col(html.Label("Email", htmlFor="email-row"),width="auto"),
                dbc.Col(
                    [dcc.Input(
                        type="email",
                        id="email-row",
                        name="email",
                        className="form-control",
                        placeholder="Enter your email address",
                        style={"width":"50%"}
                    ),
                    dcc.Input(
                        type="hidden",
                        name="_subject",
                        value="Covidanalytics Mailing List",
                        style={"width":"50%"},
                    )
                ],
                width=True
                ),
            ],
            )
        ],
    )


    text_input = dbc.FormGroup(
        [
            dbc.Row(
            [
                dbc.Col(dbc.Label("Text", html_for="message-row"),width="auto"),
                dbc.Col(
                [
                    dcc.Textarea(
                        placeholder="Your message goes here...",
                        className="form-control",
                        id="message-row",
                        name="message",
                        style={"width":"50%","marginLeft":5},
                    )
                ],
                width=True
                ),
            ],
            )
        ],
    )

    submit_button = html.Button("Submit", className="btn btn-primary", formEncType="submit")

    form = html.Form([name_input, email_input, text_input, submit_button],
                     action=formspree_url,
                     method="POST")

    body = dbc.Container([
                dbc.Row(
                [
                    dbc.Col(
                        [
                            html.P("We are happy to collaborate and help you take our research one step further. " +
                                   "Feel free to send us an email using the following form."),
                            html.P(
                                ["You can also reach out to us by sending an email to ",
                                    html.A(
                                            mailing_list,
                                            href="mailto:%s" % mailing_list,
                                        ), "."
                                ]
                            ),
                            form
                          ]
                        )
                    ],

                    )
                ],
                className="page-body",
    )

    layout = html.Div([nav, body, footer],className="site")
    return layout
Beispiel #13
0
    def all_layouts(self):

        # Main plot
        graph = html.Div(
            [
                dcc.Graph(
                    figure=go.Figure(layout=XRayDiffractionComponent.empty_plot_style),
                    id=self.id("xrd-plot"),
                    config={"displayModeBar": False},
                )
            ]
        )

        # Radiation source selector
        rad_source = html.Div([
                html.P("Radiation Source"),
                dcc.Dropdown(
                    id=self.id("rad-source"),
                    options=[
                        {"label": i, "value": i} for i in self.WAVELENGTHS.keys()
                    ],
                    value="CuKa",
                    placeholder="Select a source...",
                    clearable=False
                )
            ], style={'max-width':'200'}
        )

        # Shape factor input
        shape_factor = html.Div(
            [
                html.P("Shape Factor, K "),
                dcc.Input(
                    id=self.id("shape-factor"),
                    placeholder='0.94',
                    type='text',
                    value='0.94'
                )
            ],style={'max-width':'200'}
        )
        # Peak profile selector (Gaussian, Lorentzian, Voigt)
        peak_profile = html.Div([
                html.P("Peak Profile"),
                dcc.Dropdown(
                    id=self.id("peak-profile"),
                    options=[
                        {"label":'Gaussian',"value":'G'},
                        {"label":'Lorentzian',"value":'L'},
                        {"label":'Voigt',"value":'V'}
                    ],
                    value="G",
                    clearable=False
                )
            ], style={'max-width':'200'}
        )

        # Crystallite size selector (via Scherrer Equation)
        crystallite_size = html.Div(
            [
                html.P("Scherrer Crystallite Size (nm)"),
                html.Div([
                    dcc.Slider(
                        id=self.id("crystallite-slider"),
                        marks={i: '{}'.format(10 ** i) for i in range(-1,3)},
                        min=-1,
                        max=2,
                        value=0,
                        step=0.01
                    ),
                ], style={'max-width':'500'}),
                html.Div([
                ],id=self.id("crystallite-input"),style={"padding-top":"20px"})
            ]
        )

        return {"graph": graph,
                "rad_source": rad_source,
                "peak_profile": peak_profile,
                "shape_factor": shape_factor,
                "crystallite_size": crystallite_size
                }
Beispiel #14
0
erc721 = json.loads(mockup_erc721)
df = df.append(erc721, sort=False)

df

#%%
app = dash.Dash()

#%%
app.layout = html.Div([
    html.Div([
        dcc.Input(id='input-box', type='text', style=dict(
            width='60%',
            height='44px',
            border='2px solid rgb(147, 162, 173)',
            margin='0 8px',
            boxSizing='border-box'
        )),
        html.Button('Find', id='find-button', style=dict(
            width='10%',
            height='44px',
            border='2px solid rgb(147, 162, 173)',
            margin='0 8px',
            boxSizing='border-box'
        ))
    ], style=dict(
        position='relative',
        display='flex',
        justifyContent='center',
        alignItems='center',
            for data in p:
                var_fit.append(data['var_fitness'])
                avg_fit.append((data['avg_fitness']))
            drop_down_logs.append({'label': file[:-7], 'value': len(logs)})
            logs.append({'name': file[:-7], 'var_fit': var_fit, 'avg_fit': avg_fit})
    # print(logs)


read_logs()

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

app.layout = html.Div([
    html.Div([
        html.Span('Name', style={'margin': '20px'}),
        dcc.Input(id='name-input', placeholder='Enter name of experiment', style={'width': '50%'}),
    ], style={'width': '80%', 'align': 'right', 'display': 'inline-block', 'margin': '10px'},
        id='name-div',
    ),
    html.Div([
        html.Span('Mutation Algorithms'),
        dcc.Dropdown(id='mutation-dropdown',
                     options=mutation_options,
                     value=0),

        html.Span('Probability', style={'display': 'None'}),
        dcc.Input(id='mutation-probability', value='0.5', style={'display': 'None'}),
    ], style={'width': '80%', 'align': 'right', 'display': 'inline-block', 'margin': '10px'},
        id='mutation-div',
    ),
    html.Div([
Beispiel #16
0
    maxk = max(model_keys)
    return html.Div([
        html.H5('Threshold:'),
        dcc.Slider(id='mdl-slider',
                   min=mink,
                   max=maxk,
                   step=None,
                   value=10,
                   marks={k: str(k)
                          for k in model_keys})
    ])


pop_div = html.Div([
    html.H5('Population:'),
    dcc.Input(id="pop-input", type="number", value=20)
])

ren_div = html.Div([
    html.H5('Releases Number:'),
    dcc.Input(id="ren-input", type="number", value=20)
])

res_div = html.Div([
    html.H5('Released Fraction:'),
    dcc.Slider(id='res-slider',
               min=0,
               max=1,
               step=0.15,
               value=1,
               marks=get_marks(0, 10 + 1, 1, 10))
def remaining_selection_drop_down(input, param_val):
    if input is None:
        return [
            html.Span('Remaining Selection Algorithms'),
            dcc.Dropdown(id='remaining-selection-dropdown',
                         options=remaining_selection_options,
                         value=None),
            html.Span('Parameter', style={'display': 'None'}),
            dcc.Input(id='remaining_pop_parameter', value='1', style={'display': 'None'}),
        ]
    elif input == 0:
        return [
            html.Span('Remaining Selection Algorithms'),
            dcc.Dropdown(id='remaining-selection-dropdown',
                         options=remaining_selection_options,
                         value=0),
            html.Span('Parameter', style={'display': 'None'}),
            dcc.Input(id='remaining_pop_parameter', value='1', style={'display': 'None'}),
        ]
    elif input == 1:
        return [
            html.Span('Remaining Selection Algorithms'),
            dcc.Dropdown(id='remaining-selection-dropdown',
                         options=remaining_selection_options,
                         value=1),
            html.Span('Parameter', style={'display': 'None'}),
            dcc.Input(id='remaining_pop_parameter', value='1', style={'display': 'None'}),
        ]
    elif input == 2:
        return [
            html.Span('Remaining Selection Algorithms'),
            dcc.Dropdown(id='remaining-selection-dropdown',
                         options=remaining_selection_options,
                         value=2),
            html.Span('Parameter'),
            dcc.Input(id='remaining_pop_parameter', value=param_val),
        ]
    elif input == 3:
        return [
            html.Span('Remaining Selection Algorithms'),
            dcc.Dropdown(id='remaining-selection-dropdown',
                         options=remaining_selection_options,
                         value=3),
            html.Span('Parameter', style={'display': 'None'}),
            dcc.Input(id='remaining_pop_parameter', value='1', style={'display': 'None'}),
        ]
    elif input == 4:
        return [
            html.Span('Remaining Selection Algorithms'),
            dcc.Dropdown(id='remaining-selection-dropdown',
                         options=remaining_selection_options,
                         value=4),
            html.Span('Parameter', style={'display': 'None'}),
            dcc.Input(id='remaining_pop_parameter', value='1', style={'display': 'None'}),
        ]
    elif input == 5:
        return [
            html.Span('Remaining Selection Algorithms'),
            dcc.Dropdown(id='remaining-selection-dropdown',
                         options=remaining_selection_options,
                         value=5),
            html.Span('Parameter', style={'display': 'None'}),
            dcc.Input(id='remaining_pop_parameter', value='1', style={'display': 'None'}),
        ]
    elif input == 6:
        return [
            html.Span('Remaining Selection Algorithms'),
            dcc.Dropdown(id='remaining-selection-dropdown',
                         options=remaining_selection_options,
                         value=6),
            html.Span('Parameter', style={'display': 'None'}),
            dcc.Input(id='remaining_pop_parameter', value='1', style={'display': 'None'}),
        ]
    elif input == 7:
        return [
            html.Span('Parents Selection Algorithms'),
            dcc.Dropdown(id='parents-selection-dropdown',
                         options=parent_selection_options,
                         value=8),

        ]
    elif input == 8:
        return [
            html.Span('Parents Selection Algorithms'),
            dcc.Dropdown(id='parents-selection-dropdown',
                         options=parent_selection_options,
                         value=8),
        ]
Beispiel #18
0
             'textAlign': 'center',
             'width': '600px',
             'padding': '10px',
             'display': 'inline-block'
         }),
     html.Div(id='fasta_database_hidden_output', style={'display': 'none'})
 ]),
 html.Br(),
 html.Div([
     html.H3("HLA alleles"),
     "Enter the alleles, seperated by a semi colons",
     dcc.Input(id='hla_alleles',
               value='HLA-DRB1*15:01;HLA-DRB1*13:01',
               style={
                   'width': '50%',
                   'height': '30px',
                   'lineHeight': '30px',
                   'borderWidth': '2px',
                   'textAlign': 'left',
                   'margin': '10px'
               })
 ]),
 html.Br(),
 html.Div([
     html.H3("Tissue Name"),
     "Enter the tissue as defined in Gene expression table: ",
     dcc.Input(id='tissue_name',
               value='total PBMC',
               style={
                   'width': '50%',
                   'height': '30px',
                   'lineHeight': '30px',
def mutation_drop_down(input, mutation_prob):
    if input is None:
        return [
            html.Span('Mutation Algorithms'),
            dcc.Dropdown(id='mutation-dropdown',
                         options=mutation_options,
                         value=None),
            html.Span('Probability', style={'display': 'None'}),
            dcc.Input(id='mutation-probability', value=mutation_prob, style={'display': 'None'}),
        ]
    elif input == 0:
        return [
            html.Span('Mutation Algorithms'),
            dcc.Dropdown(id='mutation-dropdown',
                         options=mutation_options,
                         value=0),
            html.Span('Probability'),
            dcc.Input(id='mutation-probability', value=mutation_prob),
        ]
    elif input == 1:
        return [
            html.Span('Mutation Algorithms'),
            dcc.Dropdown(id='mutation-dropdown',
                         options=mutation_options,
                         value=1),

            html.Span('Probability'),
            dcc.Input(id='mutation-probability', value=mutation_prob),
        ]
    elif input == 2:
        return [
            html.Span('Mutation Algorithms'),
            dcc.Dropdown(id='mutation-dropdown',
                         options=mutation_options,
                         value=2),
            html.Span('Probability'),
            dcc.Input(id='mutation-probability', value=mutation_prob),
        ]
    elif input == 3:
        return [
            html.Span('Mutation Algorithms'),
            dcc.Dropdown(id='mutation-dropdown',
                         options=mutation_options,
                         value=3),
            html.Span('Probability', style={'display': 'None'}),
            dcc.Input(id='mutation-probability', value=mutation_prob, style={'display': 'None'}),
        ]
    elif input == 4:
        return [
            html.Span('Mutation Algorithms'),
            dcc.Dropdown(id='mutation-dropdown',
                         options=mutation_options,
                         value=4),
            html.Span('Probability', style={'display': 'None'}),
            dcc.Input(id='mutation-probability', value=mutation_prob, style={'display': 'None'}),
        ]
    elif input == 5:
        return [
            html.Span('Mutation Algorithms'),
            dcc.Dropdown(id='mutation-dropdown',
                         options=mutation_options,
                         value=5),
            html.Span('Probability'),
            dcc.Input(id='mutation-probability', value=mutation_prob),
        ]
Beispiel #20
0
                 html.Button('Filter',
                             id='buttonsearch',
                             style=dict(width='100%'))
             ],
                      className='col-4'),
             html.Div([], className='col-4')
         ],
                  className='row'),
         html.Br(),
         html.Br(),
         html.Br(),
         html.Div([
             html.Div([
                 html.P('Max Rows : '),
                 dcc.Input(id='filterrowstable',
                           type='number',
                           value=10,
                           style=dict(width='100%'))
             ],
                      className='col-3')
         ],
                  className='row'),
         html.Center([
             html.H2('House Price Data', className='title'),
             html.Div(id='tablediv',
                      children=generate_table(dfTable))
         ])
     ]),
 dcc.Tab(label='Categorical Plots',
         value='tab-2',
         children=[
             html.Div([
Beispiel #21
0
         html.Label(
             [
                 html.Div(["Scenario"]),
                 dcc.Dropdown(
                     id='scenario',
                     value=dashboard.scenarios_from(product_names[0])[0]
                 ),
             ]
         ),
         html.Label(
             [
                 html.Div(["Outliers"]),
                 dcc.Input(
                     id="outlier",
                     placeholder="Enter a value...",
                     type="number",
                     value=0,
                     min=0,
                     max=5,
                 ),
             ]
         ),
         html.Label(
             [
                 html.A(
                     html.Button('Download Excel', id='download-button'),
                     id='download-link',
                 ),
             ]
         ),
     ]
 )
Beispiel #22
0
import pandas as pd
data = pd.read_csv("data/cities_and_distances.csv")
data.reset_index(inplace=True)
data1 = data.iloc[:, 2:]
data1.index = data1.columns.values
dist_mat = data1

app = dash.Dash()
app.layout = html.Div(children=[
    # an element to take the input
    html.H1('Travelling Salesman problem using Genetic Algorithm'),
    html.H3('Best solution so far'),
    html.Img(src='data:image/png;base64,{}'.format(encoded_image.decode())),
    html.P('Number of cities'),
    html.Div(dcc.Input(id='number_of_cities', value=11, type='int')),
    html.P('Initial Population size'),
    html.Div(dcc.Input(id='initial_pop_size', value=1000, type='int')),
    html.P('Elite Population size'),
    html.Div(dcc.Input(id='nelite', value=500, type='int')),
    html.P('Percentage of population to mutate'),
    html.Div(dcc.Input(id='percentage_to_mutate', value=10, type='int')),
    html.P('Percentage of population to crossover'),
    html.Div(dcc.Input(id='percentage_to_crossover', value=80, type='int')),
    html.P('Overall runs'),
    html.Div(dcc.Input(id='noverall', value=500, type='int')),
    # an element to handle the output
    html.Button('Run the genetic algorithm', id='my-button'),
    html.Div(id='output')
])
Beispiel #23
0
def create_app_ui():
    # Create the UI of the Webpage here
    main_layout = html.Div([
        html.H1('Terrorism Analysis with Insights', id='Main_title'),
        dcc.Tabs(
            id="Tabs",
            value="Map",
            children=[
                dcc.Tab(
                    label="Map tool",
                    id="Map tool",
                    value="Map",
                    children=[
                        dcc.Tabs(id="subtabs",
                                 value="WorldMap",
                                 children=[
                                     dcc.Tab(label="World Map tool",
                                             id="World",
                                             value="WorldMap"),
                                     dcc.Tab(label="India Map tool",
                                             id="India",
                                             value="IndiaMap")
                                 ]),
                        dcc.Dropdown(id='month',
                                     options=month_list,
                                     placeholder='Select Month',
                                     multi=True),
                        dcc.Dropdown(id='date',
                                     placeholder='Select Day',
                                     multi=True),
                        dcc.Dropdown(id='region-dropdown',
                                     options=region_list,
                                     placeholder='Select Region',
                                     multi=True),
                        dcc.Dropdown(id='country-dropdown',
                                     options=[{
                                         'label': 'All',
                                         'value': 'All'
                                     }],
                                     placeholder='Select Country',
                                     multi=True),
                        dcc.Dropdown(id='state-dropdown',
                                     options=[{
                                         'label': 'All',
                                         'value': 'All'
                                     }],
                                     placeholder='Select State or Province',
                                     multi=True),
                        dcc.Dropdown(id='city-dropdown',
                                     options=[{
                                         'label': 'All',
                                         'value': 'All'
                                     }],
                                     placeholder='Select City',
                                     multi=True),
                        dcc.Dropdown(
                            id='attacktype-dropdown',
                            options=
                            attack_type_list,  #[{'label': 'All', 'value': 'All'}],
                            placeholder='Select Attack Type',
                            multi=True),
                        html.H5('Select the Year', id='year_title'),
                        dcc.RangeSlider(id='year-slider',
                                        min=min(year_list),
                                        max=max(year_list),
                                        value=[min(year_list),
                                               max(year_list)],
                                        marks=year_dict,
                                        step=None),
                        html.Br()
                    ]),
                dcc.Tab(label="Chart Tool",
                        id="chart tool",
                        value="Chart",
                        children=[
                            dcc.Tabs(
                                id="subtabs2",
                                value="WorldChart",
                                children=[
                                    dcc.Tab(
                                        label="World Chart tool",
                                        id="WorldC",
                                        value="WorldChart",
                                        children=[
                                            html.Br(),
                                            dcc.Dropdown(
                                                id="Chart_Dropdown",
                                                options=chart_dropdown_values,
                                                placeholder="Select option",
                                                value="region_txt"),
                                            html.Br(),
                                            html.Hr(),
                                            dcc.Input(
                                                id="search",
                                                placeholder="Search Filter"),
                                            html.Hr(),
                                            html.Br()
                                        ]),
                                    dcc.Tab(label="India Chart tool",
                                            id="IndiaC",
                                            value="IndiaChart",
                                            children=[])
                                ]),
                        ])
            ]),
        html.Div(id="graph-object", children="Graph will be shown here")
    ])

    return main_layout
Beispiel #24
0
    app_name = os.environ['DASH_APP_NAME']
else:
    app_name = 'dash-text-annotationsplot'

layout = html.Div([
    html.Div([html.H1("Monthly Temperature Highs and Lows")], style={'textAlign': "center"}),
    html.Div([html.Div([dcc.Dropdown(id='value-selected', options=[{"label": i, 'value': i} for i in df.columns[1:]],
                                     value=['High 2007', 'Low 2000'], multi=True)],
                       style={"display": "block", "margin-left": "auto", "margin-right": "auto", "width": "60%"})],
             className="row"),
    dcc.Graph(id="my-graph"),
    html.Div([html.H6("Text-Annotations", className="row",
                      style={"display": "block", "text-align": "center", "text-decoration": "underline"}),
              html.Div([dcc.Dropdown(id='x-input', options=[{"label": i, "value": i} for i in month],
                                     placeholder="Select month", value='', className="three columns"),
                        dcc.Input(id='y-input', type='number', placeholder="Input temperature", value='',
                                  className="three columns"),
                        dcc.Input(id='text-input', type='text', placeholder="Input text", value='',
                                  className="two columns"),
                        html.Button(id='submit-button', children="Submit", className="two columns"),
                        html.Button(id='remove-button', children="Remove", className="two columns"), ], className="row",
                       style={"display": "block", "margin-left": "auto", "margin-right": "auto", "width": "100%"})])
], className="container")


@app.callback(
    Output("my-graph", "figure"),
    [Input("value-selected", "value"), Input("remove-button", 'n_clicks'), Input('submit-button', 'n_clicks')],
    [State('x-input', 'value'), State('y-input', 'value'), State('text-input', 'value')])
def update_graph(selected, remove, n_clicks, x_value, y_value, text):
    dropdown = {"High 2014": "High Temperature in 2014", "Low 2014": "Low Temperature in 2014",
                "High 2007": "High Temperature in 2007", "Low 2007": "Low Temperature in 2007",
Beispiel #25
0
from dash.dependencies import Input, Output, State
import pandas_datareader.data as web  # requires v0.6.0 or later
from datetime import datetime
import pandas as pd

from dotenv import load_dotenv
load_dotenv()
import os
TIINGO_API_KEY = os.getenv("TIINGO_API_KEY")

app = dash.Dash()

app.layout = html.Div([
    html.H1('Stock Ticker Dashboard'),
    html.H3('Enter a stock symbol:'),
    dcc.Input(id='my_ticker_symbol', value='TSLA'),
    dcc.Graph(id='my_graph', figure={'data': [{
        'x': [1, 2],
        'y': [3.4]
    }]})
])


@app.callback(Output('my_graph', 'figure'),
              [Input('my_ticker_symbol', 'value')])
def update_graph(stock_ticker):
    start = datetime(2017, 1, 1)
    end = datetime(2020, 10, 10)
    df = web.get_data_tiingo(stock_ticker, start, end, api_key=TIINGO_API_KEY)
    df.index = df.index.get_level_values('date')
    fig = {
    html.Div([
        html.Div(id='container_col_select',
                 children=dcc.Dropdown(id='col_select',
                                       options=[{
                                           'label': c.replace('_', ' ').title(),
                                           'value': c}
                                           for c in sample_df.columns]),
                 style={'display': 'inline-block', 'width': '30%', 'margin-left': '7%'}),
        # DataFrame filter containers
        html.Div([
            html.Div(children=dcc.RangeSlider(id='num_filter',
                                              updatemode='drag')),
            html.Div(children=html.Div(id='rng_slider_vals'), ),
        ], id='container_num_filter', ),
        html.Div(id='container_str_filter',
                 children=dcc.Input(id='str_filter')),
        html.Div(id='container_bool_filter',
                 children=dcc.Dropdown(id='bool_filter',
                                       options=[{'label': str(tf), 'value': tf}
                                                for tf in [True, False]])),
        html.Div(id='container_cat_filter',
                 children=dcc.Dropdown(id='cat_filter', multi=True,
                                       options=[{'label': day, 'value': day}
                                                for day in sample_df['category'].unique()])),
        html.Div([
            dcc.DatePickerRange(id='date_filter',
                                initial_visible_month= pd.datetime(2019, 5, 10)),
        ], id='container_date_filter'),
    ]),

    DataTable(id='table',
Beispiel #27
0
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output

import plotly.graph_objs as go
import numpy as np
import pandas as pd

df = pd.read_csv('OldFaithful.csv')
colors = {'background': '#111111', 'text': '#7FDBFF'}
app = dash.Dash()

app.layout = html.Div([
    dcc.Input(id='my-id', value='Initial Text', type='text'),
    html.Div(id='my-div')
])


@app.callback(Output(component_id='my-div', component_property='children'),
              [Input(component_id='my-id', component_property='value')])
def update_output_div(input_value):
    return "You entered : {}".format(input_value)


if __name__ == '__main__':
    app.run_server()
Beispiel #28
0
                ),
            ),
            dbc.NavbarToggler(id="navbar-toggler"),
        ],
        color="dark",
        dark=True
    ),
    html.Button(
        id='button',
        style={"width": "10%", "display": "inline-block"},
        children='Update',
        n_clicks=0,
    ),
    dcc.Input(
        id="input",
        type='text',
        style={"width": "30%"},
        value='',
    ),

    html.Button(
        id="input-button",
        style={"width": "10%", "left": 0, "display": "inline-block"},
        children="Import",
        n_clicks=0,
    ),
    html.Div(
        id="data",
        style={"display": "none"},
    ),
    dcc.Dropdown(
        id="dropmenu",
    )

app.title = 'Dashboard mpg'

app.layout = html.Div([
    html.H1('Cars Data Analytics'),
    html.H3('1870-1983'
    ),
        dcc.Tabs(id="tabs", value='tab-1', children=[
            dcc.Tab(label = 'Cars 1970 - 1982 Data', value = 'tab-1', children = [
                html.Div([
                    html.Div([
                        html.P('Find Car By: '),
                        dcc.Input(
                            id = 'filternametable',
                            type = 'text',
                            value = '',
                            style = dict(width='100%')
                        )
                    ], className = 'col-4'),
                    html.Div([
                        html.P('Filter Model Year : '),
                        dcc.Dropdown(
                             id='filterModelYear',
                             options=[i for i in [{ 'label': 'All year', 'value': '' },
                                                { 'label': '1970', 'value': '70' },
                                                { 'label': '1971', 'value': '71' },
                                                { 'label': '1972', 'value': '72' },
                                                { 'label': '1973', 'value': '73' },
                                                { 'label': '1974', 'value': '74' },
                                                { 'label': '1975', 'value': '75' },
                                                { 'label': '1976', 'value': '76' },
Beispiel #30
0
def render_content(tab):
    if tab == 'tab-1':
        return html.Div([
                    html.P('Enter UserID[1 - 1002]'),
                    dcc.Input(id='input-box', value='1', type='text', style={'borderRadius': '5px'}),
                    #plotted graphs
                    dcc.Graph(id='agg_det'),
                    html.Div(id='inter', children=[
                        dcc.Graph(id='pers_det'),
                        dcc.Graph(id='performance')
                    ], style={'columnCount': 2}),

                    #recommendations
                    html.H5('Recommendations', style={'color': '#CA0009', 'marginLeft': '2%'}),
                    html.Div([
                        html.H6('Products', style=styles['sub-menu']),
                        html.Div(id='prods', style=styles['sub-sub']),
                        html.H6('Tips', style=styles['sub-menu']),
                        html.Div(id='recoms',  style=styles['sub-sub'])
                ])
        ], style=styles['main'])
    elif tab == 'tab-2':
        return html.Div([
                    html.Div([
dcc.Markdown('''
    Follow Procedure Below to check your carbon_footprint
    And possible improvements you can make

    *Click on the Download File Button
    *Fill in your details
        *Consumption column is in count of units columns
        *Quality_of_Life_Importance__1_10 column is range of 100%
        *For Type of Energy Selection:
            *Input 1 for Yes
            *Input 0 for No
    *Drag and Drop or Select File to Upload File
    ***Please note, your data will be added to database to improve results
'''),

                        html.A(
                            html.Button('Download File'),
                            id='download',
                            href="/dash/urlToDownload"
                        ),
                    ], style={'margin': '0px 0px 0px 30px'}),
                    dcc.Upload(
                        id='upload-data',
                        children=html.Div([
                            'Drag and Drop or ',
                            html.A('Select File')
                        ]),
                        style={
                            'width': '95%',
                            'height': '60px',
                            'lineHeight': '60px',
                            'borderWidth': '1px',
                            'borderStyle': 'dashed',
                            'borderRadius': '5px',
                            'textAlign': 'center',
                            'margin': '0px 0px 0px 30px'
                        },
                    ),
                    html.Div(id='show-data')
                ])