Ejemplo n.º 1
0
     html.Div(id='gen-filter-dump',
              style={'display': 'none'
                     }),
     dcc.Checklist(
         id="gen-settings-input-1",
         options=[
             {
                 'label':
                 'Toggle Regression',
                 'value': 'regression'
             }, {
                 'label':
                 'Toggle Clustering',
                 'value': 'clustering'
             }, {
                 'label':
                 'Toggle Datapoints',
                 'value': 'datapoints'
             }, {
                 'label':
                 'Toggle Multiline',
                 'value': 'multiline'
             }
         ],
         labelStyle={
             'display': 'block',
             'margin-bottom': '6px'
         },
         values=[]),
 ],
 className=
 'toggle-container item-element-margin-top',
Ejemplo n.º 2
0
                                overview_df['Decimal Year'].unique()
                            },
                            included=True)
                    ])
                ]),
            dcc.Tab(
                label="Wavelength",
                children=[
                    # Div Container for detector checklist (positioned far left)
                    html.Div(children=[
                        dcc.Checklist(id="wavelength-detector-checklist",
                                      options=[{
                                          'label': "CCD",
                                          'value': 'STIS/CCD'
                                      }, {
                                          'label': "NUV-MAMA",
                                          'value': 'STIS/NUV-MAMA'
                                      }, {
                                          'label': "FUV-MAMA",
                                          'value': 'STIS/FUV-MAMA'
                                      }],
                                      value=wav_detectors)
                    ],
                             style={
                                 'width': '25%',
                                 'display': 'inline-block'
                             }),

                    # Div Container for obstype checklist (positioned middle)
                    html.Div(children=[
                        dcc.Checklist(id="wavelength-type-checklist",
                                      options=[{
Ejemplo n.º 3
0
                            updatemode='drag')
             ]),
    html.Div(className='app-controls-block',
             children=[
                 html.Div("Outline", className='app-controls-name'),
                 dcc.Slider(id='speck-outline',
                            className='control-slider',
                            max=1,
                            step=0.01,
                            value=0.0,
                            updatemode='drag'),
             ]),
    html.Hr(),
    dcc.Checklist(id='speck-show-hide-bonds',
                  options=[{
                      'label': 'Show bonds',
                      'value': 'True'
                  }],
                  values=[]),
    html.Div(className='app-controls-block',
             children=[
                 html.Div('Bond scale', className='app-controls-name'),
                 dcc.Slider(id='speck-bond-scale',
                            className='control-slider',
                            max=1,
                            step=0.01,
                            value=0.5,
                            updatemode='drag')
             ])
]

Ejemplo n.º 4
0
    dbc.Row([
        #header
        html.H1(children='Can renewable energy reduce carbon emissions?',
                className='nine columns'),
        html.Div(children='Dora Ma', className='three columns'),
    ]),

    #Check boxes for selecting renewable energy or co2 to display on graph
    row([
        #Checkboxes for renewable energy and CO2 for graph
        html.Div([
            dcc.Checklist(id='checkRC',
                          options=[{
                              'label': 'Renewable energy',
                              'value': 'renewEne'
                          }, {
                              'label': 'CO2 emissions',
                              'value': 'co2'
                          }],
                          values=['renewEne', 'co2'])
        ],
                 className='three columns'),
        html.Div(
            [
                #make slider for years
                dcc.Slider(id='year-slider',
                           min=df.year.min(),
                           max=df.year.max(),
                           value=df.year.min(),
                           marks={str(y): str(y)
                                  for y in available_years})
Ejemplo n.º 5
0
                    # sales indicators row
                    dcc.Loading(id='loading-sales-indicators',
                                children=[
                                    html.Div(id='sales-indicators',
                                             className='row'),
                                ]),
                    html.Br(),

                    # graph toggles
                    html.Div([
                        dcc.Checklist(id='sales-checkbox',
                                      options=[{
                                          'label': 'View sales by product',
                                          'value': 'y'
                                      }],
                                      value=[],
                                      style={
                                          'display': 'inline-block',
                                          'font-size': '20px',
                                          'margin-left': '2.5%'
                                      }),
                        dcc.Checklist(id='orders-checkbox',
                                      options=[
                                          {
                                              'label':
                                              'View orders by coupon use',
                                              'value': 'y'
                                          },
                                      ],
                                      value=[],
                                      style={
Ejemplo n.º 6
0
                 },
                 60: {
                     "label": "60"
                 },
             },
         )
     ],
     className="slider",
 ),
 html.Div(
     [
         dcc.Checklist(
             id="bin-auto",
             options=[{
                 "label": "Auto",
                 "value": "Auto"
             }],
             value=["Auto"],
             inputClassName="auto__checkbox",
             labelClassName="auto__label",
         ),
         html.P(
             "# of Bins: Auto",
             id="bin-size",
             className="auto__p",
         ),
     ],
     className="auto__container",
 ),
 dcc.Graph(
     id="wind-histogram",
     figure=dict(layout=dict(
Ejemplo n.º 7
0
by_state = by_state.groupby(by_state['State'], as_index=False).sum()
by_state = pd.melt(by_state, id_vars='State')

states = by_state.State.unique()
states.sort()

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

app.layout = html.Div([
    html.H3("Choose which states to visualize"),
    html.Div([
        dcc.Checklist(id='state-select',
                      options=[{
                          'label': i,
                          'value': i
                      } for i in states],
                      value=states,
                      style={'width': '75%'})
    ]),
    html.H3("Choose the date range"),
    dcc.DatePickerRange(id='my-date-picker-range',
                        min_date_allowed=dt(2020, 1, 22),
                        max_date_allowed=dt(2020, 7, 27),
                        initial_visible_month=dt(2020, 2, 1),
                        start_date=dt(2020, 1, 22).date(),
                        end_date=dt(2020, 7, 27).date()),
    dcc.Graph('lines', config={'displayModeBar': False})
])

Ejemplo n.º 8
0
                                #### 3.Row ####
                                html.Div(
                                    [
                                        html.Button('Training',
                                                    id='train_button',
                                                    n_clicks_timestamp='0',
                                                    className='two columns'),
                                        html.Button('Test',
                                                    id='test_button',
                                                    n_clicks_timestamp='0',
                                                    className='two columns'),
                                        dcc.Checklist(
                                            id='trading_markers_checkbox',
                                            options=[{
                                                'label': 'Trading markers',
                                                'value': 'checked',
                                                'disabled': True
                                            }],
                                            values='',
                                            className='two columns'),

                                        # Portfolio dropdown
                                        dcc.Dropdown(
                                            id='portfolio_val_dropdown',
                                            multi=True,
                                            value='default',
                                            style={'vertical-align': 'right'},
                                            className='six columns')
                                    ],
                                    className="row",
                                    style={'marginTop': 30}),
Ejemplo n.º 9
0
    dbc.Row([dbc.Col([
                        html.H3("Client's Name:"),
                        dcc.Dropdown(
                        id='client_name_dropdown',
                        options=[
                            {'label': name, 'value': name} for name in client_names
                        ],
                        value=client_names[0]
                        )
                    ],
                    width={'size':3},
                    ),
            dbc.Col([
                        html.H3("Client's Base Numbers:"),
                        dcc.Checklist(
                        id='base_numbers_checklist',labelStyle={'display': 'inline-block'}
                        )
                    ],
                    width={'size':5},
                    ), 
            dbc.Col(card_risk_current, width=2),
            dbc.Col(card_risk_target, width=2),
            ]),

    html.Br(),
    dbc.Row([dbc.Col(card_assets, width=3),
             dbc.Col(card_liab, width=3),
             dbc.Col(card_month_return, width=2),
             dbc.Col(card_quarter_return, width=2),
             dbc.Col(card_year_return, width=2)], justify="around"),  # justify="start", "center", "end", "between", "around"
    dbc.Row([dbc.Col([dcc.Graph(id='asset_liab_timeseries')],
Ejemplo n.º 10
0
n_function_show_slider = dcc.Slider(id='n_functions_show_slider',
                                    value=10,
                                    min=0,
                                    max=40,
                                    className='dcc_control')

le_list = list(
    pd.read_sql('''
SELECT DISTINCT legal_entity_short
FROM hc_data_main
''',
                con=engine)['legal_entity_short'])
le_options = [{'label': str(dept), 'value': str(dept)} for dept in le_list]
le_checklist = dcc.Checklist(id='le_checklist',
                             options=le_options,
                             value='ГРС',
                             className='dcc_control',
                             labelStyle={'display': 'block'})

le_dict = pd.read_sql(
    'SELECT DISTINCT legal_entity_short_eng, legal_entity_short FROM hc_data_main',
    con=engine).set_index(
        'legal_entity_short_eng').to_dict()['legal_entity_short']
le_options_dict = [{
    'label': str(value),
    'value': str(key)
} for key, value in le_dict.items()]

le_dropdown = dcc.Dropdown(id='le_dropdown',
                           options=le_options_dict,
                           multi=True,
Ejemplo n.º 11
0
                ])
            ]),
        ], className='six columns'),
    ], className='row'),

    html.H4(children='US Agriculture Exports (2011)'),

    html.Div([
        html.Div([
            html.H1(children='Gráfico 2'),#
            html.Div(children='''
                Otro ejemplo
            '''),#
            dcc.Checklist(id='crossfilter_tipo_contrato1',
                options=[{'label': i, 'value': i} 
                            for i in available_tipo_contrato],
                value = ['Suministros','Consultoría'],
                labelStyle={'display': 'inline-block'}
                ),
            dcc.Graph(
                id='example-graph-2'
            ),  
        ], className='six columns'),
        html.Div([
            html.H1(children='Gráfico 3'),#
            html.Div(children='''
                
                Tipo de Contrato
            
            '''),#
            dcc.Dropdown(
                id='crossfilter_tipo_contrato2',
Ejemplo n.º 12
0
    html.Label('Radio Items'),
    dcc.RadioItems(
        options=[
            {'label': 'New York City', 'value': 'NYC'},
            {'label': 'Montreal', 'value': 'MTL'},
            {'label': 'San Francisco', 'value': 'SF'}
        ],
        value='MTL'
    ),

    html.Label('Checkboxes'),
    dcc.Checklist(
        options=[
            {'label': 'New York City', 'value': 'NYC'},
            {'label': 'Montreal', 'value': 'MTL'},
            {'label': 'San Francisco', 'value': 'SF'}
        ],
        values=['MTL', 'SF']
    ),

    html.Label('Text Input'),
    dcc.Input(value='MTL', type='text'),

    html.Label('Slider'),
    dcc.Slider(
        min=0,
        max=9,
        marks={i: 'Label {}'.format(i) if i == 1 else str(i) for i in range(1, 6)},
        value=5,
    ),
], style={'columnCount': 2})
Ejemplo n.º 13
0
def team_layout(pathname):
    # Here we extract context from the url in order to render relevant data:
    pathelements = pathname.split('/')
    for count, element in enumerate(pathelements):
        if element == 'team':
            break
    record_id = pathelements[count - 1]

    author = get_object_or_404(Author, pk=record_id)

    #message = html.P("ID: %s  |   Inspector: %s" %(record_id, author.name))
    message = html.P('')

    team_layout = [
        message,
        html.Div(
            [
                html.Div([
                    html.Div(
                        [
                            html.H2("PLAYER AND TEAM PERFORMANCE COMPARISON"),
                        ],
                        style={
                            'background-color': '#2aa9d2',
                            'color': 'white',
                            'border-radius': '2px',
                            'padding': '10px 0px 10px 10px'
                        }),
                    html.Div([
                        dcc.Graph(id='g1'),
                    ],
                             style={
                                 'width': '33%',
                                 'float': 'left',
                                 'display': 'inline-block'
                             }),
                    html.Div(
                        [
                            dcc.Graph(id='g3'),
                        ],
                        style={
                            'width': '33%',
                            'float': 'center',
                            'display': 'inline-block'
                        }),
                    html.Div(
                        [
                            dcc.Graph(id='g2'),
                        ],
                        style={
                            'width': '34%',
                            'float': 'right',
                            'display': 'inline-block'
                        }),
                ]),
                html.Div(
                    [
                        html.Div(
                            [
                                dcc.RangeSlider(
                                    id='slider_1',
                                    marks={
                                        i: '{}'.format(month)
                                        for i, month in enumerate([
                                            "Nov 2015", "Dec 2015", 'Jan 2015',
                                            'Feb 2016', 'Mar 2016'
                                        ])
                                    },
                                    min=0,
                                    max=4,
                                    value=[0, 4],
                                    step=None,
                                )
                            ],
                            style={
                                'display': 'inline-block',
                                'width': '100%',
                                'float': 'left',
                                'marginBottom': 50,
                            },
                        ),
                        html.Div(
                            [
                                dcc.RadioItems(
                                    id='home_away_1',
                                    options=[{
                                        'label': "Host",
                                        'value': 0
                                    }, {
                                        'label': 'Guest',
                                        'value': 1
                                    }],
                                    value=0,
                                    labelStyle={'display': 'inline-block'}),
                            ],
                            style={
                                'display': 'inline-block',
                                'float': 'none',
                                'margin': 'auto'
                            },
                        ),
                        html.Div(
                            [
                                dcc.Checklist(
                                    id='Player_name_1',
                                    options=[{
                                        'label': i,
                                        'value': i
                                    } for i in player_name_list],
                                    values=['Cheatham Hannif'],
                                    labelStyle={'display': 'inline-block'})
                            ],
                            style={
                                'display': 'inline-block',
                                'float': 'right',
                                'margin': 'auto'
                            },
                        ),
                    ],
                    style={
                        'marginTop': 50,
                        'width': '45%',
                        'float': 'left',
                        'display': 'inline-block',
                        'padding': '0px 0px 100px 40px',
                        'font-size': '16px'
                    },
                ),
                html.Div(
                    [
                        html.Div(
                            [
                                dcc.RangeSlider(
                                    id='slider_2',
                                    marks={
                                        i: '{}'.format(month)
                                        for i, month in enumerate([
                                            "Nov 2015", "Dec 2015", 'Jan 2015',
                                            'Feb 2016', 'Mar 2016'
                                        ])
                                    },
                                    min=0,
                                    max=4,
                                    value=[0, 4]),
                            ],
                            style={
                                'display': 'inline-block',
                                'width': '100%',
                                'float': 'middle',
                                'marginBottom': 50,
                            },
                        ),
                        html.Div(
                            [
                                dcc.RadioItems(
                                    id='home_away_2',
                                    options=[{
                                        'label': "Host",
                                        'value': 0
                                    }, {
                                        'label': "Guest",
                                        'value': 1
                                    }],
                                    value=0,
                                    labelStyle={'display': 'inline-block'}),
                            ],
                            style={
                                'display': 'inline-block',
                                'width': '30%',
                                'float': 'left',
                                'margin': 'auto'
                            },
                        ),
                        html.Div(
                            [
                                dcc.Checklist(id='Player_name_2',
                                              options=[{
                                                  'label': i,
                                                  'value': i
                                              } for i in player_name_list],
                                              values=['Henry Ellenson'])
                            ],
                            style={
                                'display': 'inline-block',
                                'float': 'right',
                                'width': '100%',
                                'margin': 'auto'
                            },
                        ),
                    ],
                    style={
                        'marginTop': 50,
                        'width': '45%',
                        'float': 'right',
                        'display': 'inline-block',
                        'padding': '0px 40px 100px 50px',
                        'font-size': '16px'
                    })
            ],
            style={
                'width': '100%',
                'float': 'left',
                'marginLeft': 'auto',
                'marginRight': 'auto',
                'boxShadow': '0px 0px 5px 5px rgba(204,204,204,0.4)'
            })
    ]

    return team_layout
Ejemplo n.º 14
0
def _main():

    p = Path('Data/missions.csv')

    if p.is_file():  # If the updated dataset exits
        countries = pd.read_csv('Data/missions.csv', sep='\t', header=0)

    else:  # If the dataset must be generated
        # Load the 4 datasets using the .read_csv function from pandas, sep = '\t' for tsv files, don't load the header
        # The files are assumed to be in the 'Data' folder
        countries = pd.read_csv('Data/countries.tsv', sep='\t', header=0)
        missions = pd.read_csv('Data/missions.tsv', sep='\t', header=0)
        places = pd.read_csv('Data/places.tsv', sep='\t', header=0)
        users = pd.read_csv('Data/users.tsv', sep='\t', header=0)
        missions = build_dataset(missions)

    # Go to http://127.0.0.1:8050/ in the browser to run the visualization
    # or run it in JupyterNotebook using Jupyter Dash.
    modes = ['public', 'car', 'train', 'plane']  # Transportation modes

    external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'
                            ]  # Modify text Css

    #app = JupyterDash(__name__, external_stylesheets=external_stylesheets) #Uncomment if running on jupyter
    app = dash.Dash(__name__, external_stylesheets=external_stylesheets
                    )  #Uncomment if running normally

    # Layout of the visualization
    app.layout = html.Div([
        html.H1(
            'InfoViz assignment: Visualizing emission per region'),  # Title
        # Build a checklist for each transportation mode
        dcc.Checklist(
            id="transports",
            options=[{
                "label": x,
                "value": x
            } for x in modes],
            value=modes[0:],  # All selected at the init
            labelStyle={'display': 'inline-block'}  # Display in a single line
        ),
        dcc.Graph(id="emission-chart"),
    ])

    # Interactivity of the visualization: takes as input the trasportation modes and output the graph
    @app.callback(Output("emission-chart", "figure"),
                  [Input("transports", "value")])
    def update_line_chart(modes):

        # Fixed color palette
        color_discrete_map = {
            'North': '#D55E00',
            'Reach': '#0072B2',
            'Dorne': '#CC79A7',
            'Westerlands': '#E69F00',
            'Riverlands': '#009E73',
            'Vale': '#19D3F3',
            'Crownlands': '#F0E442'
        }
        # Gets all the rows from the selected modes in the checklist
        mask = missions['mode'].isin(modes)
        # Get the cumulative sums of the emissions for the visualization
        missions['cumsum'] = missions[mask].groupby(
            'regions')['emissions'].transform(pd.Series.cumsum)

        #Display the visualization. X axis is the date, Y axis is the cumulative emissions. We rename the labels and apply a fixed color palette
        fig = px.line(missions[mask],
                      x='date',
                      y=missions[mask]['cumsum'],
                      color='regions',
                      labels={
                          'date': 'Date',
                          'y': 'Total emissions'
                      },
                      color_discrete_map=color_discrete_map)
        return fig

    #app.run_server(mode='inline') #Uncomment if running on jupyter
    app.run_server(debug=True)  # Uncomment if running normally
Ejemplo n.º 15
0
    html.Hr(),
    html.Label('Range Slider'),
    dcc.RangeSlider(id='rangeslider',
                    marks={i: 'Label {}'.format(i)
                           for i in range(0, 9)},
                    min=0,
                    max=9,
                    value=[0, 1],
                    step=1),
    html.Br(),
    html.Hr(),
    html.Label('Text Area'),
    dcc.Textarea(id='textarea',
                 placeholder='Enter a value...',
                 value='This is a TextArea component'),
    html.Br(),
    html.Hr(),
    html.Label('Date Picker Single'),
    dcc.DatePickerSingle(id='date-picker-single', date=dt(2019, 6, 12)),
    html.Br(),
    html.Hr(),
    html.Label('Radio Items'),
    dcc.RadioItems(id='radio', options=options, value='PT'),
    html.Br(),
    html.Hr(),
    html.Label('Checkboxes'),
    dcc.Checklist(id='checkbox', options=options, value=['PT', 'FR'])
])

if __name__ == '__main__':
    app.run_server(debug=True)
Ejemplo n.º 16
0
def get_updated_df():
    df = FULL_DF.copy()
    # Process df
    return df


app.layout = Container([
    Row(
        Col(
            [
                html.Label('Options'),
                dcc.Checklist(
                    id='checklist',
                    options=[
                        {'label': 'A', 'value': 'A'},
                        {'label': 'B', 'value': 'B'},
                    ],
                    values=['A', 'B'],
                    labelStyle={'margin': '5px'},
                )
            ], bp=BOOTSTRAP_SCREEN_SIZE, size=12,
        )
    ),
    Row(
        Col(
            [
                dcc.Graph(id='graph_1')
            ], bp=BOOTSTRAP_SCREEN_SIZE, size=12,
        )
    ),
    html.Div(id='hidden-data', style={'display': 'none'}),
Ejemplo n.º 17
0
app.layout = html.Div(
    style = {'color': 'black', 'background-color': 'white'},
    children = [
    html.H1(children = 'リアルタイムデータの見える化'),

    html.H3(children = '''
        micro:bit 3次元加速度センサーの値を見える化しています。
    '''),
    dcc.Checklist(
        id = 'ax-checklist',
        options = [
            {'label': 'X方向の加速度 ', 'value': 'x'},
            {'label': 'Y方向の加速度 ', 'value': 'y'},
            {'label': 'Z方向の加速度 ', 'value': 'z'}
        ],
        value = ['x', 'y', 'z'],
        labelStyle = {'display': 'inline-block',
                    'paddingLeft' : 20,
                    'fontSize': '20px'
                    }
    ),
    html.Div(id = 'get_data'),
    dcc.Interval(id = 'timer', interval = 500),
    dcc.Graph(id = 'graph-with-checkbox'),
    html.Div([
	    daq.Gauge(
	    	id = 'x-gauge',
			showCurrentValue = True,
			color = COLOR,
			max = ACCEL_MAX,
Ejemplo n.º 18
0
    def _sub_layouts(self):

        options = html.Div(
            [
                dcc.Checklist(
                    options=[{
                        "label": "Filter solids ",
                        "value": "filter_solids"
                    }],
                    value=["filter_solids", "show_labels"],
                    id=self.id("pourbaix_diagram_options"),
                    style={"display": "inline-block"},
                    inputClassName="mpc-radio",
                ),
                dcc.Checklist(
                    options=[
                        {
                            "label": "Show heatmap ",
                            "value": "show_heatmap"
                        },
                        {
                            "label": "Show labels ",
                            "value": "show_labels"
                        },
                    ],
                    value=["show_labels"],
                    id=self.id("pourbaix_display_options"),
                    style={"display": "inline-block"},
                    inputClassName="mpc-radio",
                ),
            ],
            style={
                "width": WIDTH,
                "display": "inline-block"
            },
        )

        graph = html.Div(
            [
                dcc.Graph(
                    figure=go.Figure(
                        layout=PourbaixDiagramComponent.empty_plot_style),
                    id=self.id("graph"),
                    config={
                        "displayModeBar": False,
                        "displaylogo": False
                    },
                )
            ],
            id=self.id("pourbaix-div"),
        )

        sliders = html.Div(
            [
                html.Div(
                    children=[
                        html.Div(
                            "concentration-{}".format(n),
                            id=self.id("concentration-{}-text".format(n)),
                        ),
                        dcc.Slider(
                            id=self.id("concentration-slider-{}".format(n)),
                            min=-8,
                            max=1,
                            step=1,
                            value=-4,
                        ),
                    ],
                    id=self.id("concentration-slider-{}-div".format(n)),
                    style={"display": "none"},
                ) for n in range(SUPPORTED_N_ELEMENTS)
            ],
            id=self.id("slider-div"),
            style={"width": WIDTH},
        )

        return {"graph": graph, "options": options, "sliders": sliders}
Ejemplo n.º 19
0
                    value=func.getColumns()[0]['label'],
                    multi=False,
                    style={
                    'backgroundColor' :'#d4c9f0', 'fontSize':12,
                    },


                ),

                dcc.Checklist(
                    id='showTop25',
                    options= 
                    [
                        {'label': 'Show Top 25', 'value': 'top25'},
                    #     {'label': u'Montréal', 'value': 'MTL'},
                    #     {'label': 'San Francisco', 'value': 'SF'}
                    ],
                    value= ['top25'],
                    style = {'fontSize':12, 'color': '#2314f5'},
                    #multi=False


                ),
                #html.Br(),
            html.Label('Select Category'),
            dcc.Dropdown(
                id='itemsDropDown',
                options= Functions.get2ndColumnValues(func.df,firstColumnAtribute=func.df.columns[1]),
                    # {'label': 'New York City', 'value': 'NYC'},
                    # {'label': u'Montréal', 'value': 'MTL'},
                    # {'label': 'San Francisco', 'value': 'SF'},
                    # {'label': 'San Jose', 'value': 'SJ'}
Ejemplo n.º 20
0
def NamedChecklist(name, style=None, **kwargs):
    style = __get_style(style)
    return html.Div(
        [html.P('{}:'.format(name), style=style),
         dcc.Checklist(**kwargs)])
                             style=dict(width='35%',
                                        display='inline-block',
                                        verticalAlign="middle"))
     ],
     style={
         'width': '100%',
         'display': 'flex',
         'align-items': 'center',
         'justify-content': 'center'
     }),
 html.Div(
     [
         html.Label('Function'),
         dcc.Checklist(id='KIND_CHECKLIST',
                       options=kindoptions,
                       value=kinds,
                       labelStyle=dict(display='inline-block'),
                       style=dict(width='25%', verticalAlign="middle")),
         html.Label('Instrument'),
         dcc.Input(id='INSTRUMENT_INPUT',
                   type='text',
                   placeholder="Instrument",
                   style=dict(width='15%', verticalAlign="middle")),
         html.Label('Passage Date'),
         dcc.Input(
             id='PASSAGE_INPUT',
             type='text',
             #value=datetime.datetime.now().strftime("%Y-%m-%d"),
             placeholder="YYYY-MM-DD",
             style=dict(width='15%', verticalAlign="middle")),
         html.Label('Host'),
Ejemplo n.º 22
0
                 {'label': 'Active only ', 'value': 'active'},
                 {'label': 'Customize ', 'value': 'custom'}
             ],
             value='active',
             labelStyle={'display': 'inline-block'}
         ),
         dcc.Dropdown(
             id='well_statuses',
             options=well_status_options,
             multi=True,
             value=[]
         ),
         dcc.Checklist(
             id='lock_selector',
             options=[
                 {'label': 'Lock camera', 'value': 'locked'}
             ],
             values=[],
         )
     ],
     className='six columns'
 ),
 html.Div(
     [
         html.P('Filter by well type:'),
         dcc.RadioItems(
             id='well_type_selector',
             options=[
                 {'label': 'All ', 'value': 'all'},
                 {'label': 'Productive only ', 'value': 'productive'},  # noqa: E501
                 {'label': 'Customize ', 'value': 'custom'}
Ejemplo n.º 23
0
             'label': 'San Francisco',
             'value': 'SF'
         },
     ],
     value='MTL'  # default value
 ),
 html.Label('Checkboxes'),
 dcc.Checklist(
     options=[
         {
             'label': 'New York City',
             'value': 'NYC'
         },
         {
             'label': u'Montréal',
             'value': 'MTL'
         },
         {
             'label': 'San Francisco',
             'value': 'SF'
         },
     ],
     value=['MTL', 'SF']  # default value
 ),
 #
 html.Label('Text Box'),
 dcc.Input(id='my-id', value='MTL', type='text'),
 html.Div(id='my-div'),
 #
 dcc.Graph(id='life-exp-vs-gdp',
           figure={
    def __init__(self):

        self.search_heading = html.Div([
            html.H3('Search Insider Transactions',
                    style={
                        'textAlign': 'center',
                        'fontSize': 20
                    })
        ])

        self.input_form = html.Div(
            [
                html.Div(
                    [
                        # input box
                        html.Label('Ticker', className='control_label'),
                        dcc.Input(
                            id='input_ticker',
                            value="AAPL",
                            type='text',
                            style={
                                'width': 130,
                                'fontSize': 15
                            },
                        )
                    ],
                    style=styles['input_form']),
                html.Div(
                    [
                        # from date
                        html.Label('From', className='control_label'),
                        dcc.DatePickerSingle(
                            id='date_from',
                            date=datetime.today() - relativedelta(years=1),
                            display_format='YYYY-MM-DD',
                        ),
                    ],
                    style=styles['input_form']),
                html.Div(
                    [
                        # to date
                        html.Label('To'),
                        dcc.DatePickerSingle(
                            id='date_to',
                            date=datetime.today(),
                            display_format='YYYY-MM-DD',
                        )
                    ],
                    style=styles['input_form'])
            ],
            style=styles['search_criteria'])

        self.filter_insiders = html.Div([
            html.P('Filter by insiders:'),
            dcc.RadioItems(id='insider_filter_radio',
                           options=[{
                               'label': 'All',
                               'value': 'all'
                           }, {
                               'label': 'Customize',
                               'value': 'custom'
                           }],
                           value='all',
                           style={'display': 'flex'}),
            dcc.Dropdown(id='insider_filter_dropdown',
                         multi=True,
                         style={'width': '95%'})
        ],
                                        style={
                                            'display': 'block',
                                            'paddingLeft': '20px'
                                        })

        self.filter_transactions = html.Div([
            html.P('Filter by transactions:'),
            html.Div([
                dcc.Checklist(id='filter_market_trades_checkbox',
                              options=[{
                                  'label': 'Open Market Transactions',
                                  'value': 'filter'
                              }],
                              value=['filter'],
                              style={'paddingRight': '15px'}),
                dcc.Checklist(id='filter_buys',
                              options=[{
                                  'label': 'Buys',
                                  'value': 'P'
                              }],
                              value=['P'],
                              style={'paddingRight': '15px'}),
                dcc.Checklist(id='filter_sells',
                              options=[{
                                  'label': 'Sells',
                                  'value': 'S'
                              }],
                              value=['S'],
                              style={'paddingRight': '15px'})
            ],
                     style={'display': 'flex'})
        ],
                                            style={'paddingLeft': '20px'})

        self.submit = html.Div([
            html.Button('Submit',
                        id='submit_button',
                        style={
                            'background': '#119dff8c',
                            'width': '90%',
                            'margin': 'auto'
                        }),
            dcc.Interval('interval_componant', interval=1000, n_intervals=0)
        ])

        self.details = html.Div(
            [
                html.Div(
                    [
                        html.Label('Units:'),
                        dcc.RadioItems(id='volume_type_details_radio',
                                       options=[
                                           {
                                               'label': 'Shares',
                                               'value': 'shares'
                                           },
                                           {
                                               'label': 'Notional',
                                               'value': 'notional'
                                           },
                                       ],
                                       value='shares',
                                       style={'display': 'flex'})
                    ],
                    style={
                        'display': 'flex',
                        'float': 'left',
                        'paddingTop': '10px',
                        'fontSize': '14px'
                    }),
                # chart details
                # number of transactions found
                html.Div(
                    [
                        html.Div([
                            html.H6(id='num_transactions',
                                    style=styles['details_label']),
                            html.P('# Transactions', style=styles['paragraph'])
                        ],
                                 style=styles['details']),

                        # number of insiders found
                        html.Div([
                            html.H6(id='num_insiders',
                                    style=styles['details_label']),
                            html.P('# Insiders', style=styles['paragraph'])
                        ],
                                 style=styles['details']),

                        # total buy volume
                        html.Div([
                            html.H6(id='total_buy_vol',
                                    style=styles['details_label']),
                            html.P('Buy Volume', style=styles['paragraph'])
                        ],
                                 style=styles['details']),

                        # total sell volume
                        html.Div([
                            html.H6(id='total_sell_vol',
                                    style=styles['details_label']),
                            html.P('Sell Volume', style=styles['paragraph'])
                        ],
                                 style=styles['details'])
                    ],
                    style={'display': 'inline-flex'})
            ],
            style={
                'display': 'grid',
                'position': 'absolute',
                'bottom': '20px'
            })

        self.filter_transactions_size = html.Div(
            [
                # select units
                dcc.Dropdown(id='filter_transactions_unit',
                             options=[{
                                 'label': 'Shares',
                                 'value': 'shares'
                             }, {
                                 'label': 'Notional',
                                 'value': 'amount'
                             }, {
                                 'label': 'Ownership %',
                                 'value': 'ownership_percentage'
                             }],
                             placeholder='Units',
                             style={
                                 'paddingLeft': '5px',
                                 'width': '130px'
                             }),
                # select operator
                dcc.Dropdown(id='filter_transactions_operator',
                             options=[{
                                 'label': '>',
                                 'value': '>'
                             }, {
                                 'label': '<',
                                 'value': '<'
                             }],
                             placeholder='Op',
                             style={
                                 'paddingLeft': '5px',
                                 'width': '77px',
                                 'paddingRight': '4px'
                             }),
                # enter value
                dcc.Input(id='filter_transactions_value',
                          placeholder='Value',
                          style={
                              'width': '80px',
                              'paddingLeft': '5px',
                              'height': '36px'
                          }),
                # select value type
                dcc.Dropdown(id='filter_transactions_value_type',
                             options=[{
                                 'label': 'Real',
                                 'value': 'real'
                             }, {
                                 'label': 'ABS',
                                 'value': 'absolute'
                             }],
                             placeholder='Type',
                             style={
                                 'paddingLeft': '5px',
                                 'width': '73px'
                             }),
                html.Div([
                    html.Button('Filter',
                                id='filter_button',
                                style=styles['filter_button'])
                ])
            ],
            style=styles['filter_transactions'])

        self.stored_data = html.Div([
            html.Div(id='stored_transactions'),
            html.Div(id='stored_insider_stats'),
            html.Div(id='stored_volatility_stats'),
            html.Div(id='stored_performence_stats'),
            html.Div(id='stored_price_data'),
            html.Div(id='stored_spy_data'),
            html.Div(id='stored_vix_data'),
        ],
                                    style={'display': 'none'})

        self.filtered_data = html.Div([
            html.Div(id='filtered_transactions'),
            html.Div(id='filtered_insider_stats'),
            html.Div(id='filtered_volatility_stats'),
            html.Div(id='filtered_performence_stats')
        ],
                                      style={'display': 'none'})
Ejemplo n.º 25
0
                      } for s in VEHICLES],
                      value=VEHICLES[0]),
         html.Hr(),
         html.Label('Subassies'),
         dcc.RadioItems(id='subassies-radioitems',
                        options=[{
                            'label': s,
                            'value': s
                        } for s in SUBASSIES],
                        value=SUBASSIES[0]),
         html.Hr(),
         html.Label('Element'),
         dcc.Checklist(
             id='element-checklist',
             # !!!!!!!!!!!!!1
             options=[{
                 'label': s,
                 'value': s
             } for s in SUBASSIES_STRUCTURE[SUBASSIES[0]].keys()],
             values=list(SUBASSIES_STRUCTURE[SUBASSIES[0]].keys())),
         html.Hr(),
         html.Label('Sensors'),
         dcc.Dropdown(id='sensors-dropdown',
                      options=[{
                          'label': s,
                          'value': s
                      } for s in get_subassy_sensors(SUBASSIES[0])],
                      value=[],
                      multi=True),
     ],
     className='row'),
 html.Hr(),
Ejemplo n.º 26
0
import pickle

df =pd.read_csv(‘https://gist.githubusercontent.com/jbrav/f281e0063418dd62ad63004671cf96ec/raw/bab2df8189cd39099eaf4ecceb82cbf37762dc99/coma.csv 3’)
dataframe=json.loads(df.to_json())

print df
app = dash.Dash()
app.config.suppress_callback_exceptions=True

available_funds = df[‘FUNDS’].unique()

app.layout = html.Div([
html.Div([
html.Div([
html.H1(‘Evolucion rentabilidades’),
dcc.Checklist(
id=‘mychecklist’,
options= [{‘label’: i, ‘value’: i} for i in available_funds]),
dcc.Graph(id=‘mygraph1’)
]),
html.Div([
html.H1(‘Evolucion 2’),
dcc.Checklist(
id=‘mychecklist2’,
options=[{‘label’: i, ‘value’: i} for i in available_funds]),
dcc.Graph(id=‘mygraph2’)
]),

    html.Div([
       html.H1('Evolucion 3'),
       dcc.Checklist(
           id='mychecklist3',
Ejemplo n.º 27
0
#html.Table(generate_table(y, max_rows=10))

### Sliders and Buttons
slider_week = dcc.RangeSlider(
    id='sl_week',
    min=min_week,
    max=max_week,
    value=[max_week - 4, max_week],
    step=1,
    marks={ind: str(ind)
           for ind in range(min_week, max_week, 4)})

checklist_flagtypes = dcc.Checklist(id='cl_flagtypes',
                                    value=flagtypes,
                                    options=[{
                                        'label': t,
                                        'value': t
                                    } for t in flagtypes])

radio_coronatopic = dcc.RadioItems(id='rd_coronatopic',
                                   value="yes",
                                   options=[{
                                       'label': 'yes',
                                       'value': "yes"
                                   }, {
                                       'label': 'no',
                                       'value': "no"
                                   }])


@app.callback(Output(component_id='show_dates', component_property='children'),
Ejemplo n.º 28
0
                         'width': '49%',
                         'float': 'right',
                         'display': 'inline-block'
                     })
        ],
        style={
            'borderBottom': 'thin lightgrey solid',
            'backgroundColor': 'rgb(250, 250, 250)',
            'padding': '10px 5px'
        }),
    html.Div([
        html.P("Markers Selection:"),
        dcc.Checklist(
            id='markers-tab1',
            options=[{
                'value': x,
                'label': x
            } for x in markers_options],
            #          value=markers_options[0],
            labelStyle={'display': 'inline-block'}),
    ]),
    # Bivariate choropleth matp
    html.Div([html.Iframe(id='map', width='100%', height='600')],
             style={
                 'width': '98%',
                 'display': 'inline-block',
                 'padding': '0 20'
             }),
    # Div for small multiples of the chorpleths
    #TODO add here

    # Scatterplot and some other random graph
Ejemplo n.º 29
0
def layout():

    return html.Div(
        id='speck-body',
        className='app-body',
        children=[
            dcc.Loading(className='dashbio-loading',
                        children=html.Div(id='speck-container',
                                          children=[
                                              dash_bio.Speck(id='speck',
                                                             view={
                                                                 'resolution':
                                                                 600,
                                                                 'zoom': 0.3
                                                             },
                                                             scrollZoom=True)
                                          ])),
            html.Div(
                id='speck-control-tabs',
                className='control-tabs',
                children=[
                    dcc.Tabs(
                        id='speck-tabs',
                        value='what-is',
                        children=[
                            dcc.Tab(
                                label='About',
                                value='what-is',
                                children=html.Div(
                                    className='control-tab',
                                    children=[
                                        html.H4(className='what-is',
                                                children='What is Speck?'),
                                        html.
                                        P('Speck is a WebGL-based molecule renderer. By '
                                          'using ambient occlusion, the resolution of '
                                          'the rendering does not suffer as you zoom in.'
                                          ),
                                        html.
                                        P('You can toggle between molecules using the menu under the '
                                          '"Data" tab, and control parameters related to '
                                          'the appearance of the molecule in the "View" tab. '
                                          'These parameters can be controlled at a low level '
                                          'with the sliders provided, or preset views can be '
                                          'applied for a higher-level demonstration of changing '
                                          'atom styles and rendering.')
                                    ])),
                            dcc.Tab(
                                label='Data',
                                value='datasets',
                                children=html.Div(
                                    className='control-tab',
                                    children=[
                                        html.Div(
                                            className='app-controls-block',
                                            children=[
                                                html.Div(className=
                                                         'app-controls-name',
                                                         children='Preloaded'),
                                                dcc.Dropdown(
                                                    id=
                                                    'speck-molecule-dropdown',
                                                    className='speck-dropdown',
                                                    options=[{
                                                        'label':
                                                        'DNA',
                                                        'value':
                                                        '{}dna.xyz'.format(
                                                            DATAPATH)
                                                    }, {
                                                        'label':
                                                        'Caffeine',
                                                        'value':
                                                        '{}caffeine.xyz'.
                                                        format(DATAPATH)
                                                    }, {
                                                        'label':
                                                        'Methane',
                                                        'value':
                                                        '{}methane.xyz'.format(
                                                            DATAPATH)
                                                    }, {
                                                        'label':
                                                        'Testosterone',
                                                        'value':
                                                        '{}testosterone.xyz'.
                                                        format(DATAPATH)
                                                    }, {
                                                        'label':
                                                        'Gold nanoparticle',
                                                        'value':
                                                        '{}au.xyz'.format(
                                                            DATAPATH)
                                                    }, {
                                                        'label':
                                                        'Thiolated gold nanoparticle',
                                                        'value':
                                                        '{}au_thiol.xyz'.
                                                        format(DATAPATH)
                                                    }, {
                                                        'label':
                                                        'Benzene',
                                                        'value':
                                                        '{}benzene.xyz'.format(
                                                            DATAPATH)
                                                    }, {
                                                        'label':
                                                        'Protein (4E0O)',
                                                        'value':
                                                        '{}4E0O.xyz'.format(
                                                            DATAPATH)
                                                    }],
                                                    value='{}dna.xyz'.format(
                                                        DATAPATH))
                                            ]),
                                        html.Div(
                                            id='speck-preloaded-uploaded-alert'
                                        ),
                                        dcc.Upload(
                                            id='speck-file-upload',
                                            className='control-upload',
                                            children=html.Div([
                                                "Drag and drop .xyz files, or click \
                                    to select files."
                                            ])),
                                        html.A(html.Button(
                                            'Download sample .xyz data',
                                            id='speck-file-download',
                                            className='control-download'),
                                               href=os.path.join(
                                                   'assets', 'sample_data',
                                                   'speck_4QCI.xyz'),
                                               download='4QCI.xyz')
                                    ])),
                            dcc.Tab(
                                label='View',
                                value='view-options',
                                children=html.Div(
                                    className='control-tab',
                                    children=[
                                        dcc.Checklist(
                                            id='speck-enable-presets',
                                            options=[{
                                                'label': 'Use presets',
                                                'value': 'True'
                                            }],
                                            values=[]),
                                        html.Hr(),
                                        html.Div(id='speck-controls-detailed',
                                                 children=default_sliders),
                                        html.Div(
                                            id='speck-controls-preset',
                                            className='speck-controls',
                                            children=[
                                                html.Div(
                                                    className=
                                                    'app-controls-block',
                                                    children=[
                                                        html.Div(
                                                            className=
                                                            'app-controls-name',
                                                            children=
                                                            'Rendering style'),
                                                        dcc.Dropdown(
                                                            id=
                                                            'speck-preset-rendering-dropdown',
                                                            className=
                                                            'speck-dropdown',
                                                            options=[
                                                                {
                                                                    'label':
                                                                    'Default/reset',
                                                                    'value':
                                                                    'default'
                                                                },
                                                                {
                                                                    'label':
                                                                    'Toon',
                                                                    'value':
                                                                    'toon'
                                                                },
                                                            ],
                                                            value='default')
                                                    ]),
                                                html.Div(
                                                    className=
                                                    'app-controls-block',
                                                    children=[
                                                        html.Div(
                                                            className=
                                                            'app-controls-name',
                                                            children=
                                                            'Atom style'),
                                                        dcc.Dropdown(
                                                            id=
                                                            'speck-preset-atom-style-dropdown',
                                                            className=
                                                            'speck-dropdown',
                                                            options=[{
                                                                'label':
                                                                'Ball-and-stick',
                                                                'value':
                                                                'stickball'
                                                            }, {
                                                                'label':
                                                                'Licorice',
                                                                'value':
                                                                'licorice'
                                                            }],
                                                            value='default')
                                                    ])
                                            ])
                                    ])),
                        ])
                ]),
            dcc.Store(id='speck-store-preset-rendering', data=None),
            dcc.Store(id='speck-store-preset-atom-style', data=None),
        ])
         className='app-controls-name'
     ),
     dcc.Slider(
         id='speck-outline',
         className='control-slider',
         max=1,
         step=0.01,
         value=0.0,
         updatemode='drag'
     ),
 ]),
 #html.Hr(),
 dcc.Checklist(
     id='speck-show-hide-bonds',
     options=[
         {'label': 'Show bonds',
          'value': 'True'}
     ],
     value=[]
 ),
 html.Div(className='app-controls-block', children=[
     html.Div(
         'Bond scale',
         className='app-controls-name'
     ),
     dcc.Slider(
         id='speck-bond-scale',
         className='control-slider',
         max=1,
         step=0.01,
         value=0.5,
         updatemode='drag'