def generate_main_layout():
    return html.Div(
        [
            # walkalround that let client download js bundle, *bugs* in dash
            Redirect(
                "click me to redirect", href="", style={"display": "none"}),
            LocalStorageWriter(id="global-local-storage-writer",
                               label=USER_STORAGE),
            LocalStorageReader(id="user-local-storage-reader",
                               label=USER_STORAGE),
            LocalStorageReader(id=gen_id("main_cart_reader"),
                               label=CART_STORAGE),
            html.Div(style={"display": "none"},
                     children=[
                         dt.DataTable(id="global-table-hiden",
                                      rows=[{
                                          "No data": "no data"
                                      }],
                                      row_selectable=True,
                                      filterable=True,
                                      sortable=True,
                                      editable=False,
                                      selected_row_indices=[]),
                     ]),
            sd_material_ui.Snackbar(
                id="snackbar", open=False, message=_("Polo"), action="Reveal"),
            nav_bar.components_tree(),
            # This Location component represents the URL bar
            dcc.Location(id="global-url", refresh=False),
            # Each "page" will modify this element
            html.Div(id="content-container-root"),
            html.Div(id=DUMMY_ID)
        ],
        className="container-fluid")
    # walkalround that let client download js bundle, *bugs* in dash
    html.Div(style={"display":"none"}, children=[
        dt.DataTable(
            id='global-datatable-component',
            rows=[{"No": "No"}],
            row_selectable=True,
            filterable=True,
            sortable=True,
            editable=False,
            selected_row_indices=[]
        )
    ]),
    Redirect("click me to redirect", href="", style={"display": "none"}),
    LocalStorageReader(id="user-local-storage-reader", label=USER_STORAGE),
    LocalStorageReader(id="cart-local-storage-reader", label=CART_STORAGE),
    sd_material_ui.Snackbar(id="snackbar", open=False, message="Polo", action="Reveal"),
    LocalStorageWriter(id="global-local-storage-writer", label=USER_STORAGE),
    html.Div(style={"display":"none"}, children=[
    ]),
    total,
    # This Location component represents the URL bar
    dcc.Location(id="url", refresh=False),
])

@app.callback(
    Output("content-container-root", "children"),
    [Input("url", "pathname")])
def display_page(pathname):
    logger.debug(pathname)
    if not pathname:
        pathname = "/"
示例#3
0
    ),
    spacer,
    html.Div(id='output14', children=['Selected item appears here.']),
    spacer,

    # Test for SDToggle
    html.Div(children=[
        sd_material_ui.Toggle(id='input9', label='Johnny?'),
        html.Div(id='output9', children=[html.P('Flame off')]),
    ],
             style=dict(width=150)),
    spacer,
    sd_material_ui.RaisedButton(id='input10', label='Marco'),
    html.Div(id='output10', children=['Looking...']),
    sd_material_ui.Snackbar(id='snackbar',
                            open=False,
                            message='Polo',
                            action='Reveal'),
    spacer,

    # Test for SDAutoComplete
    sd_material_ui.AutoComplete(
        id='input13',
        anchorOrigin={
            'vertical': 'center',
            'horizontal': 'middle'
        },
        animated=True,
        dashCallbackDelay=3000,
        dataSource=['orange', 'red', 'blue', 'peach'],
        fullWidth=True,
        floatingLabelText="Type here",
示例#4
0
     id='use-guide',
     activeStep=0,
     finishedText='Institution Added! Restart?',
     stepCount=3,
     stepLabels=['Open Plaid Link', 'Store Token', 'Select From Dropdown']),
 plaidash.LoginForm(
     id='plaid-link',
     clientName='Butters',
     env=PLAID_ENV,
     publicKey=PLAID_PUBLIC_KEY,
     product=PLAID_PRODUCTS,
     # institution=)
 ),
 html.Button('Store current token', id='store-button'),
 sd_material_ui.Snackbar(id='token-alert',
                         open=False,
                         message='Token Added to Dropdown',
                         action='Select It'),
 html.H1('Accounts & Balances', style=dict()),
 html.Div(id='auth-container'),
 html.H1('Credit & Loans', style=dict()),
 html.Div(id='credit-container'),
 html.H1('Transactions & Spending', style=dict()),
 dcc.DatePickerRange(
     id='transaction-history',
     max_date_allowed=dt.date(dt.today()),
     start_date=dt.date(dt.today()) - timedelta(days=60),
     end_date=dt.date(dt.today()),
     calendar_orientation='vertical',
 ),
 html.Div(id='transaction-container'),
 html.H1('Income & Cash Flow', style=dict()),
示例#5
0
                    id='toggle-input',
                    label='Johnny?',
                    toggled=False,
                ),
                html.P(id='toggle-output', children=['Flame off']),
            ]),

            spacer,

            html.Div([
                html.P([html.Strong('Test for Snackbar')]),
                html.Button('Open/Close Snackbar', id='snackbar-button'),
                html.Div(children=['Snackbar button clicks: None'], id='snackbar-output'),
                sd_material_ui.Snackbar(
                    id='snackbar',
                    action='Update text',
                    actionStyles=dict(color='white'),
                    message='You opened the Snackbar!')
            ]),

            spacer,

            html.Div([
                    html.P([html.Strong('Sample for AutoComplete')]),
                    sd_material_ui.AutoComplete(
                        id='autocomplete',
                        dataSource=[{'label': 'Austin, TX', 'value': 'Austin'},
                                    {'label': 'Houston, TX', 'value': 'Houston'},
                                    {'label': 'New York, NY', 'value': 'New York'},
                                    {'label': 'Denver, CO', 'value': 'Denver'},
                                    {'label': 'Chicago, IL', 'value': 'Chicago'},
示例#6
0
 html.Div([
     html.Div(id="kafka_title", children="kafka broker"),
     html.Div([
         html.Div([
             dcc.Input(
                 id="input_kafka_broker".format("text"),
                 type="text",
                 placeholder="kafka broker".format("text"),
             ),
             html.Button(id='kafka-submit-buttom',
                         n_clicks=0,
                         children='Submit'),
             html.Div(id="kafka_broker_title"),
         ],
                  className="bare_container"),
         sd_material_ui.Snackbar(
             id='snackbar-kafka', open=False, message='')
     ]),
     html.Label('timestamp'),
     dcc.Slider(id='timestamp-slider',
                min=0,
                max=0,
                marks={-1: "null"},
                value=-1),
     html.Div([
         html.Div(id='plot-container', className="topmargin_box"),
         html.Label('level'),
         html.Div([
             dcc.Slider(
                 id='level-slider',
                 min=0,
                 max=0,
示例#7
0
         label='Johnny?',
         toggled=False,
     ),
     html.P(id='toggle-output', children=['Flame off']),
 ]),
 spacer,
 html.Div([
     html.P([html.Strong('Test for Snackbar')]),
     html.Button('Open/Close Snackbar',
                 id='snackbar-button'),
     html.Div(children=['Snackbar button clicks: None'],
              id='snackbar-output'),
     sd_material_ui.Snackbar(
         id='snackbar',
         action='Update text',
         actionStyles=dict(color='white'),
         message='sample message',
         # children=html.P('You opened the Snackbar!'),
     )
 ]),
 spacer,
 html.Div([
     html.P([html.Strong('Sample for AutoComplete')]),
     sd_material_ui.AutoComplete(
         id='autocomplete',
         dataSource=[{
             'label': 'Austin, TX',
             'value': 'Austin'
         }, {
             'label': 'Houston, TX',
             'value': 'Houston'
示例#8
0
                 id="input_kafka_broker".format("text"),
                 type="text",
                 placeholder="kafka broker".format("text"),
             ),
             html.Div(id="kafka_broker_title"),
         ]),
         html.Div([
             dcc.Input(
                 id="delete_topics".format("text"),
                 type="text",
                 placeholder="delete topics regex".format("text"),
             ),
             html.Button(
                 id='submit-buttom', n_clicks=0, children='Submit'),
         ]),
         sd_material_ui.Snackbar(
             id='snackbar-deltopic', open=False, message='')
     ]),
     html.Div([
         dash_treeview_antd.TreeView(id='filelist',
                                     multiple=False,
                                     checkable=False,
                                     checked=[],
                                     selected=[],
                                     expanded=['0'],
                                     data=treeFilesDict),
         #dcc.Graph(id='treemap', figure=create_treemap()),
         html.Div(id='launching-producer-text-display')
     ]),
     sd_material_ui.Snackbar(id='snackbar', open=False, message='')
 ],
 className="pretty_container eight columns"),
                        ])
                    ])
            ])

register_button_row = html.Div(className="row", children=[
                html.Div(className="col-md-3"),
                html.Div(className="col-md-6", children=[
                    html.Button(type="submit", id=gen_id(REGISTER), className="btn btn-success", children=[
                        _("Register"), html.I(className="fa fa-user-plus")
                    ])
                ])
            ])

auto_link = Redirect(id=gen_id(REDIRECT), href="")

snack_bar_msg =sd_material_ui.Snackbar(id=gen_id(SNACK_BAR), open=True, message='')


def layout():
    logger.debug("register layout")
    return html.Div(className="container", children=[
            register_title_row,
            tel_row,
            email_row,
            password_row,
            confirm_pwd_row,
            register_button_row,
            snack_bar_msg,
            auto_link,
            html.Div(id=gen_id(HIDDEN_DIV))
    ])
示例#10
0
            dcc.Input(
                id="input_s3_bucket".format("text"),
                type="text",
                placeholder="s3 bucket".format("text"),
            ),
            html.Div(id="product_prefix_title", children="product prefix"),
            html.Div([
                dcc.Input(
                    id="input_product_prefix".format("text"),
                    type="text",
                    placeholder="product prefix".format("text"),
                ),
            ]),
            html.Button(id='submit-buttom', n_clicks=0, children='Submit'),
            sd_material_ui.Snackbar(id='snackbar-submit-io',
                                    open=False,
                                    message='')
        ]),
    ])

    @app.callback([
        dash.dependencies.Output('snackbar-submit-io', 'open'),
        dash.dependencies.Output('snackbar-submit-io', 'message')
    ], [Input('submit-buttom', 'n_clicks')], [
        State('input_kafka_broker', 'value'),
        State('input_product_prefix', 'value'),
        State('input_s3_bucket', 'value')
    ])
    def subscribe_an_output_product(n_clicks, kafka_broker, product_prefix,
                                    s3bucket):
        if n_clicks <= 0: