Esempio n. 1
0
def serve_layout():
    # Generates a session ID
    session_id = str(uuid.uuid4())

    # Post the image to the right key, inside the bucket named after the
    # session ID
    res = store_image_string(IMAGE_STRING_PLACEHOLDER, session_id)
    print(res)

    # App Layout
    return html.Div([
        # Session ID
        html.Div(session_id, id='session-id', style={'display': 'none'}),

        # Banner display
        html.Div([
            html.H2('Image Processing App', id='title'),
            html.Img(
                src=
                "https://s3-us-west-1.amazonaws.com/plotly-tutorials/logo/new-branding/dash-logo-by-plotly-stripe-inverted.png"
            )
        ],
                 className="banner"),

        # Body
        html.Div(
            className="container",
            children=[
                html.Div(
                    className='row',
                    children=[
                        html.Div(
                            className='five columns',
                            children=[
                                drc.Card([
                                    dcc.Upload(id='upload-image',
                                               children=[
                                                   'Drag and Drop or ',
                                                   html.A('Select an Image')
                                               ],
                                               style={
                                                   'width': '100%',
                                                   'height': '50px',
                                                   'lineHeight': '50px',
                                                   'borderWidth': '1px',
                                                   'borderStyle': 'dashed',
                                                   'borderRadius': '5px',
                                                   'textAlign': 'center'
                                               },
                                               accept='image/*'),
                                    drc.NamedInlineRadioItems(
                                        name='Selection Mode',
                                        short='selection-mode',
                                        options=[{
                                            'label': ' Rectangular',
                                            'value': 'select'
                                        }, {
                                            'label': ' Lasso',
                                            'value': 'lasso'
                                        }],
                                        val='select'),
                                    drc.NamedInlineRadioItems(
                                        name='Image Display Format',
                                        short='encoding-format',
                                        options=[{
                                            'label': ' JPEG',
                                            'value': 'jpeg'
                                        }, {
                                            'label': ' PNG',
                                            'value': 'png'
                                        }],
                                        val='jpeg'),
                                ]),
                                drc.Card([
                                    drc.CustomDropdown(
                                        id='dropdown-filters',
                                        options=[{
                                            'label': 'Blur',
                                            'value': 'blur'
                                        }, {
                                            'label': 'Contour',
                                            'value': 'contour'
                                        }, {
                                            'label': 'Detail',
                                            'value': 'detail'
                                        }, {
                                            'label': 'Enhance Edge',
                                            'value': 'edge_enhance'
                                        }, {
                                            'label': 'Enhance Edge (More)',
                                            'value': 'edge_enhance_more'
                                        }, {
                                            'label': 'Emboss',
                                            'value': 'emboss'
                                        }, {
                                            'label': 'Find Edges',
                                            'value': 'find_edges'
                                        }, {
                                            'label': 'Sharpen',
                                            'value': 'sharpen'
                                        }, {
                                            'label': 'Smooth',
                                            'value': 'smooth'
                                        }, {
                                            'label': 'Smooth (More)',
                                            'value': 'smooth_more'
                                        }],
                                        searchable=False,
                                        placeholder='Basic Filter...'),
                                    drc.CustomDropdown(
                                        id='dropdown-enhance',
                                        options=[{
                                            'label': 'Brightness',
                                            'value': 'brightness'
                                        }, {
                                            'label': 'Color Balance',
                                            'value': 'color'
                                        }, {
                                            'label': 'Contrast',
                                            'value': 'contrast'
                                        }, {
                                            'label': 'Sharpness',
                                            'value': 'sharpness'
                                        }],
                                        searchable=False,
                                        placeholder='Enhance...'),
                                    html.Div(
                                        id='div-enhancement-factor',
                                        style={
                                            'display': 'none',
                                            'margin':
                                            '25px 5px 30px 0px'
                                        },
                                        children=[
                                            f"Enhancement Factor:",
                                            html.Div(
                                                style={'margin-left': '5px'},
                                                children=dcc.Slider(
                                                    id=
                                                    'slider-enhancement-factor',
                                                    min=0,
                                                    max=2,
                                                    step=0.1,
                                                    value=1,
                                                    updatemode='drag'))
                                        ]),
                                    html.Button('Run Operation',
                                                id='button-run-operation',
                                                style={
                                                    'margin-right': '10px',
                                                    'margin-top': '5px'
                                                }),
                                    html.Button('Undo',
                                                id='button-undo',
                                                style={'margin-top': '5px'})
                                ]),
                                dcc.Graph(id='graph-histogram-colors',
                                          config={'displayModeBar': False})
                            ]),
                        html.Div(
                            className='seven columns',
                            style={'float': 'right'},
                            children=[
                                # The Interactive Image Div contains the dcc Graph
                                # showing the image, as well as the hidden div storing
                                # the true image
                                html.Div(id='div-interactive-image',
                                         children=[
                                             GRAPH_PLACEHOLDER,
                                             html.Div(
                                                 id='div-storage',
                                                 children=STORAGE_PLACEHOLDER,
                                                 style={'display': 'none'})
                                         ])
                            ])
                    ])
            ])
    ])
Esempio n. 2
0
 dbc.Row([html.H6("Deployed Database Configuration file")],
         style={
             'padding': '15px',
             'backgroundColor': '#c2e0ff',
             'padding-bottom': '5px'
         }),
 dbc.Row(
     [
         dcc.Input(value="DeployedDatabase/deployedDB.cnf",
                   id="updatedVal",
                   style={'padding': '10px'}),
         dcc.Upload(
             id='upload-data',
             children=html.Div([
                 dbc.Button("Load New File",
                            color="primary",
                            className="mr-1",
                            style={'margin': '5px'})
             ]),
             # Allow multiple files to be uploaded
             multiple=False),
     ],
     style={
         'backgroundColor': '#c2e0ff',
         'padding': '5px'
     }),
 dbc.Row([
     dbc.Col(
         [
             dbc.Row([
                 dbc.Col(
                     html.Div([html.H5("Optimum Configuration Parameters")],
Esempio n. 3
0
    dcc.Store(id='rule-dataframe', storage_type='local'),
    dcc.Location(id='url', refresh=False),
    sidebar,
    content
])

home_content = html.Div([
    html.H2("SQIs Table"),
    dcc.Upload(
        id='upload-data',
        children=html.Div(['Drag and Drop or ',
                           html.A('Select Files')]),
        style={
            'width': '100%',
            'height': '50px',
            'lineHeight': '60px',
            'borderWidth': '1px',
            'borderStyle': 'dashed',
            'borderRadius': '2px',
            'textAlign': 'center',
            'margin': '2px'
        },
        # Allow multiple files to be uploaded
        multiple=False),
    html.H2("Rule Table (Optional)"),
    dcc.Upload(
        id='upload-rule',
        children=html.Div(['Drag and Drop or ',
                           html.A('Select Files')]),
        style={
            'width': '100%',
            'height': '50px',
Esempio n. 4
0
         'margin' : '5px',
     },
     value='Humedad I',
 ),
 html.P(
     "o puedes subir una foto en formato PNG de una humedad sobre la que generar el proceso:",
 ),
 dcc.Upload(
     id='upload-image',
     children=html.Div([
         'Arrastra o ',
         html.A('Selecciona un archivo')
     ]),
     style={
         'lineHeight': '60px',
         'borderWidth': '1px',
         'borderStyle': 'dashed',
         'borderRadius': '5px',
         'textAlign': 'center',
         'margin': '10px'
     },
     # Allow multiple files to be uploaded
     # multiple=True,
     # className=""
 ),
 html.P(
     "Elección de color para las figuras",
 ),
 dcc.RadioItems(
     id='color-select',
     options= [
         {'label': "Terreno", 'value': 'terrain'},
Esempio n. 5
0
from datetime import datetime

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

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

app.layout = html.Div([
    dcc.Upload(
        id='upload-1',
        children=html.Div([
            'Drag and drop or ',
            html.A('Select Files')
        ]),
        style={
            'width': '100%',
            'height': '60px',
            'textAlign': 'center',
            'borderWidth': '1px',
            'borderStyle': 'dashed',
            'borderRadius': '5px',
            'lineHeight': '60px'
        },
        multiple=True
    ),
    html.Div(id='div-1')
])

def parse_contents(content, name, date):
    return html.Div([
        html.H5(name),
        html.H6(datetime.fromtimestamp(date)),
Esempio n. 6
0
def parser():
    return html.Div(
        [
            # Select Division Dropdown
            html.Div(
                [
                    # Select Division Dropdown
                    html.Div(children="",
                             className='glyphicon glyphicon-user',
                             id="user"),
                    #html.Button(id="addConn",className="glyphicon glyphicon-plus-sign"),
                    html.Button(id='logout',
                                n_clicks=0,
                                className="glyphicon glyphicon-off"),
                ],
                className='fixed_header'),
            html.Div([
                html.H3(children="", className="h3"),
                html.Button(id="closeMsg",
                            className="glyphicon glyphicon-close")
            ],
                     className="userAlert",
                     id="userAlert"),
            html.Div([
                html.H3(children="Connect With DAVID"),
                html.Div([
                    html.Div([
                        html.Label(" Select Category : ",
                                   style={"width": "40%"}),
                        dcc.Dropdown(id='category',
                                     options=[{
                                         'label': 'Report an Issue',
                                         'value': 'Issue'
                                     }, {
                                         'label': 'Ask a Query',
                                         'value': 'Query'
                                     }, {
                                         'label': 'Share a Suggestion',
                                         'value': 'Sugestion'
                                     }],
                                     value='Suggestion')
                    ],
                             style={
                                 "display": "inline-flex",
                                 "width": "100%"
                             }),
                    html.Div(
                        [
                            html.Label(" Subject : ", style={"width": "40%"}),
                            dcc.Input(id='msg_sub',
                                      placeholder='Enter Subject...')
                        ],
                        style={
                            "width": "100%",
                            "display": "inline-flex",
                            "padding": "10px 0px"
                        })
                ],
                         className="subArea"),
                html.Div([
                    html.Label(" Message : ", style={"width": "40%"}),
                    dcc.Textarea(id='msg_txt', placeholder='Enter Message...')
                ],
                         className="msgArea"),
                html.Div(
                    [
                        html.Label(" Email : ", style={"width": "40%"}),
                        dcc.Input(id='msg_mail', placeholder='Enter Email...'),
                    ],
                    style={
                        "width": "100%",
                        "padding": "10px 0px",
                        "display": "inline-flex"
                    }),
                html.
                P("* You'll receive a confirmation mail on this email . We promise not to spam you , !",
                  style={
                      "color": "#fff",
                      "font-size": "12px",
                      "margin-left": "105px"
                  }),
                html.Button(children="SEND", className="btn send "),
                html.Button(children="CLOSE", className="btn closeModal ")
            ],
                     className="contactModal hidden"),
            html.Div([
                html.Div(children="DAVID", className="logoContainer"),
                html.Div([
                    html.Span([html.A("ABOUT", href='/about')],
                              className="invisble-btn about"),
                    html.Span([html.A("HOME", href='/login')],
                              className="invisble-btn about"),
                    html.Span([
                        html.Button(children="Knowledge Base",
                                    className="invisble-btn parser")
                    ]),
                    html.Span([
                        html.Button(children="DASHBOARD",
                                    className="invisble-btn dash")
                    ]),
                    html.Span([
                        html.Button(children="CONTACT",
                                    className="invisble-btn",
                                    id="contactDavid")
                    ]),
                ],
                         className="linksContainer")
            ],
                     className="horizontal_header"),
            html.Div([
                html.Span(className="glyphicon glyphicon-upload upload"),
                dcc.Upload(
                    id="upload-data",
                    children=html.Div([
                        "Drag and drop or click to select a file to upload."
                    ]),
                    style={
                        "width": "100%",
                        "height": "60px",
                        "lineHeight": "60px",
                        "borderWidth": "1px",
                        "borderStyle": "dashed",
                        "borderRadius": "5px",
                        "textAlign": "center",
                        "margin": "10px",
                    },
                    multiple=True,
                ),
                html.Div([html.Ul(id="copied-file-list")],
                         id="copied-file-list-container"),
                html.Span(
                    className="glyphicon glyphicon-circle-arrow-right icons")
            ],
                     className="uploadSection"),
            html.Div([
                html.Span(className="glyphicon glyphicon-search ",
                          style={
                              "font-size": "50px",
                              "padding": "10px"
                          }),
                dcc.Input(placeholder="Search for corpus here..."),
                html.Span(
                    className="glyphicon glyphicon-circle-arrow-left icons")
            ],
                     className="searchBox hidden"),
            #html.H2("File List"),
            #html.Div([html.Ul(id="file-list")],id="file-list-container"),
            html.Hr(),
            html.Div(
                [
                    #todolist : check for knwoledge article and auto-fill if check return true
                    html.Div(
                        [html.Label(children="Title"),
                         dcc.Input(type="text")],
                        className="title sec"),
                    html.Div(
                        [html.Label(children="Description"),
                         html.Textarea()],
                        className="issue_description sec"),
                    html.Div([
                        html.Label(children="Domain"),
                        dcc.Input(type="text")
                    ],
                             className="issue_domain sec left-half"),
                    html.Div([
                        html.Label(children="Module"),
                        dcc.Input(type="text")
                    ],
                             className="issue_module sec right-half"),
                    html.Div([
                        html.Label(children="Customer"),
                        dcc.Input(type="text")
                    ],
                             className="customer sec left-half"),
                    html.Div([
                        html.Label(children="Log Date"),
                        dcc.Input(type="date")
                    ],
                             className="log_date sec right-half"),
                    html.Div([
                        html.Label(children="Steps to Reproduce"),
                        html.Textarea()
                    ],
                             className="reproduce sec"),
                    html.Div([
                        html.Label(children="Steps to Resolve"),
                        html.Textarea()
                    ],
                             className="resolve sec"),
                    html.Div([
                        html.Label(children="Filed By"),
                        dcc.Input(type="text")
                    ],
                             className="author sec"),
                    dcc.Input(id="fileConnectorId", className="hidden"),
                    html.Div(
                        [
                            #html.Button(children="SAVE"),
                            html.Span([
                                html.Button(children="SUBMIT",
                                            className="submit sec last")
                            ]),
                            html.Span([
                                html.Button(children="SAVE AS DRAFT",
                                            className="draft sec last")
                            ]),

                            #],className="submit sec last"),
                        ],
                        className="submit sec last"),
                ],
                className="form-container",
                id="formContainer"),
        ],
        style={"max-width": "100%"},
    )
Esempio n. 7
0
                         'value': 'ex2'
                     }, {
                         'label': 'Exemplo 3',
                         'value': 'ex3'
                     }, {
                         'label': 'Personalizado',
                         'value': 'custom'
                     }],
                     value='ex1',
                     searchable=False,
                     clearable=False)
    ], **_styles),
    # inserir portfolio personalizado
    dbc.FormGroup([
        dcc.Upload(id='upload-data',
                   children=dbc.Button(
                       'Carregar arquivo', outline=True, color='dark'))
    ], **_styles),
    # atualizar dados
    dbc.FormGroup([dbc.Button('Atualizar portfólio', id='btn-portfolio')],
                  **_styles),
    # gerar recomendações
    dbc.FormGroup([dbc.Button('Gerar recomendações', id='btn-update')],
                  **_styles)
])

view_portfolio = dbc.Row([html.Div(id='table-portfolio')])

view_recommends = dbc.Row([html.Div(id='table-recommends')])

app.layout = dbc.Container([
                                    },
                                    # children=[html.Div(dcc.Input(id='input-box', type='text'))]
                                ),
                                html.Div(
                                    children = [
                                        dcc.Upload(
                                            id="upload-data",
                                            children=html.Div([
                                                'Drag and Drop or ',
                                                html.A('Select Files')
                                            ]),
                                            style={
                                                'display': 'inline',
                                                'float': 'left',
                                                'width': '25rem',
                                                'lineHeight': '25px',
                                                'borderStyle': 'dashed',
                                                'borderRadius': '5px',
                                                'textAlign': 'center',
                                                'margin': '25px',
                                                'border-radius':'4px',

                                            },
                                            # Allow multiple files to be uploaded
                                            multiple=False
                                        ),
                                        html.Button(
                                            'Submit',
                                            id="getword",
                                            style={
                                                'margin-top': ' 20px',
Esempio n. 9
0
 html.Div([html.H1("Upload a file for plotting")],
          style={
              "color": "gray",
              "textAlign": "center",
              "font-size": "20px",
          }),
 dcc.Upload(
     id="upload-data",
     children=html.Div(
         ["Drag and drop or click to select a file to upload."]),
     style={
         "width": "100%",
         "height": "60px",
         "lineHeight": "60px",
         "borderWidth": "1px",
         "borderStyle": "dashed",
         "borderRadius": "5px",
         "textAlign": "center",
         "margin": "10px",
         "color": "white",
         "font-family": "Times New Roman, Times, serif",
         "font-size": "20px",
         "background-color": "coral",
     },
     multiple=True,
 ),
 html.Div([html.H2("File List")], style={"color": "gray"}),
 html.Div([
     dcc.Checklist(options=[
         {
             'label': 'BPFO',
             'value': 'BPFO'
Esempio n. 10
0
def layout():

    return html.Div(
        id='mol3d-body',
        className='app-body',
        children=[
            html.Div(
                id='mol3d-control-tabs',
                className='control-tabs',
                children=[
                    dcc.Tabs(
                        id='mol3d-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 Molecule3D?'),
                                        html.
                                        P('Molecule3D is a visualizer that allows you '
                                          'to view biomolecules in multiple representations: '
                                          'sticks, spheres, and cartoons.'),
                                        html.
                                        P('You can select a preloaded structure, or upload your own, '
                                          'in the "Data" tab. A sample structure is also '
                                          'available to download.'),
                                        html.
                                        P('In the "View" tab, you can change the style and '
                                          'coloring of the various components of your molecule.'
                                          )
                                    ])),
                            dcc.Tab(
                                label='Data',
                                value='upload-download',
                                children=html.Div(
                                    className='control-tab',
                                    children=[
                                        html.Div(
                                            title=
                                            'download a sample data file to view',
                                            children=[]),
                                        html.Div(
                                            title='Select molecule to view',
                                            className="app-controls-block",
                                            children=[
                                                html.Div(
                                                    className=
                                                    'app-controls-name',
                                                    children='Select structure'
                                                ),
                                                dcc.Dropdown(
                                                    id='dropdown-demostr',
                                                    options=[
                                                        {
                                                            'label':
                                                            'Measles nucleocapsid',
                                                            'value':
                                                            '{}4uft.pdb'.
                                                            format(DATAPATH)
                                                        },
                                                        {
                                                            'label':
                                                            'a-cobratoxin-AChBP complex',
                                                            'value':
                                                            '{}1yi5.pdb'.
                                                            format(DATAPATH)
                                                        },
                                                        {
                                                            'label':
                                                            'Calcium ATPase',
                                                            'value':
                                                            '{}1su4.pdb'.
                                                            format(DATAPATH)
                                                        },
                                                        {
                                                            'label':
                                                            'DNA',
                                                            'value':
                                                            '{}1bna.pdb'.
                                                            format(DATAPATH)
                                                        },
                                                        {
                                                            'label':
                                                            'T7 RNA polymerase',
                                                            'value':
                                                            '{}1msw.pdb'.
                                                            format(DATAPATH)
                                                        },
                                                    ],
                                                    value='{}1bna.pdb'.format(
                                                        DATAPATH)),
                                            ],
                                        ),
                                        html.Div(
                                            title=
                                            'Upload biomolecule to view here',
                                            className='app-controls-block',
                                            id='mol3d-upload-container',
                                            children=[
                                                dcc.Upload(
                                                    id='mol3d-upload-data',
                                                    className='control-upload',
                                                    children=html.Div([
                                                        'Drag and drop or click to upload a file.',
                                                    ]),
                                                    # Allow multiple files to be uploaded
                                                    multiple=True),
                                                html.A(html.Button(
                                                    "Download sample structure",
                                                    id=
                                                    "mol3d-download-sample-data",
                                                    className='control-download'
                                                ),
                                                       href=os.path.join(
                                                           'assets',
                                                           'sample_data',
                                                           'molecule3d_2mru.pdb'
                                                       ),
                                                       download='2mru.pdb')
                                            ]),
                                        html.Div(id='mol3d-data-info')
                                    ])),
                            dcc.Tab(
                                label='View',
                                value='view-options',
                                children=html.Div(
                                    className='control-tab',
                                    children=[
                                        # Textarea container to display the selected atoms
                                        html.Div(
                                            title=
                                            'view information about selected atoms '
                                            'of biomolecule',
                                            className="app-controls-block",
                                            id="mol3d-selection-display",
                                            children=[
                                                html.P("Selection",
                                                       style={
                                                           'font-weight':
                                                           'bold',
                                                           'margin-bottom':
                                                           '10px'
                                                       }),
                                                html.Div(
                                                    id='mol3d-selection-output'
                                                ),
                                            ]),
                                        # Dropdown to select chain representation
                                        # (sticks, cartoon, sphere)
                                        html.Div(
                                            title=
                                            'select style for molecule representation',
                                            className="app-controls-block",
                                            id='mol3d-style',
                                            children=[
                                                html.P('Style',
                                                       style={
                                                           'font-weight':
                                                           'bold',
                                                           'margin-bottom':
                                                           '10px'
                                                       }),
                                                dcc.Dropdown(
                                                    id='dropdown-styles',
                                                    options=[
                                                        {
                                                            'label': 'Sticks',
                                                            'value': 'stick'
                                                        },
                                                        {
                                                            'label': 'Cartoon',
                                                            'value': 'cartoon'
                                                        },
                                                        {
                                                            'label': 'Spheres',
                                                            'value': 'sphere'
                                                        },
                                                    ],
                                                    value='cartoon'),
                                            ],
                                        ),

                                        # Dropdown to select color of representation
                                        html.Div(
                                            title=
                                            'select color scheme for viewing biomolecule',
                                            className="app-controls-block",
                                            id='mol3d-style-color',
                                            children=[
                                                html.P('Color',
                                                       style={
                                                           'font-weight':
                                                           'bold',
                                                           'margin-bottom':
                                                           '10px'
                                                       }),
                                                dcc.Dropdown(
                                                    id='dropdown-style-color',
                                                    options=[
                                                        {
                                                            'label': 'Atom',
                                                            'value': 'atom'
                                                        },
                                                        {
                                                            'label':
                                                            'Residue identity',
                                                            'value': 'residue'
                                                        },
                                                        {
                                                            'label':
                                                            'Residue type',
                                                            'value':
                                                            'residue_type'
                                                        },
                                                        {
                                                            'label': 'Chain',
                                                            'value': 'chain'
                                                        },
                                                    ],
                                                    value='residue'),
                                                dcc.Dropdown(
                                                    id='mol3d-coloring-key',
                                                    options=[]),
                                            ],
                                        ),
                                        html.Div(
                                            title=
                                            'Customize molecule coloring.',
                                            className="app-controls-block",
                                            children=[
                                                html.
                                                P(id='mol3d-customize-coloring',
                                                  style={
                                                      'font-weight': 'bold',
                                                      'margin-bottom': '10px'
                                                  }),
                                                daq.ColorPicker(
                                                    id='mol3d-coloring-value',
                                                    size=315),
                                            ]),
                                    ]),
                            ),
                        ]),
                ]),
            dcc.Loading(html.Div(id='mol3d-biomolecule-viewer', children=[])),
            dcc.Store(id='mol3d-color-storage', data={})
        ])
Esempio n. 11
0
                html.P('Ancillary data available?'),
                dcc.Textarea(
                    id='ancillary-data',
                    placeholder='Description of parameters or URL link'
                ),

                dcc.Upload(
                        id='upload-data',
                        children=html.Div([
                            'Drag and Drop or ',
                            html.A('Select Database File')
                    ]),
                    style={
                        'width': '90%',
                        'height': '60px',
                        'lineHeight': '60px',
                        'borderWidth': '1px',
                        'borderStyle': 'dashed',
                        'borderRadius': '5px',
                        'textAlign': 'center',
                        'margin': '25px 0 0 0',
                    },
                    # allow single file upload
                    multiple=False
                ),
                html.Div(id='upload-output'),
                html.Button(id='upload-button', n_clicks=0, children='Upload', 
                    style={
                        'margin': '15px 0px 10px 0px'   
                    }
                ),
Esempio n. 12
0
 dcc.Store(id=f'{APP_ID}_session_store'),
 dcc.Store(id=f'{APP_ID}_large_upload_fn_store'),
 dbc.Row([
     dbc.Col(
         du.Upload(id=f'{APP_ID}_large_upload')
     ),
     dbc.Col(
         dcc.Upload(
             id=f'{APP_ID}_dcc_upload',
             children=html.Div([
                 'dcc.Upload '
             ]),
             style={
                 'width': '100%',
                 'height': '60px',
                 'lineHeight': '60px',
                 'borderWidth': '1px',
                 'borderStyle': 'dashed',
                 'borderRadius': '5px',
                 'textAlign': 'center',
                 'margin': '10px'
             },
             multiple=True
         ),
     )
 ]),
 dbc.ButtonGroup([
     dbc.Button('Process Data', id=f'{APP_ID}_process_data_button', color='primary', disabled=True)
 ]),
 dcc.Loading(
     children=dbc.Row([
Esempio n. 13
0
def create_div_landscapes():
    return html.Div(
        className="eight columns",
        children=[
            dcc.Graph(
                id='landscape-plot',
                config={'displaylogo': False, 'displayModeBar': True},
                style={ 'height': '100vh'}
            ),
            html.Div(
                className="row",
                children=[
                    html.Div(
                        className="four columns",
                        children=[
                            html.Div(
                                className='row',
                                children=[
                                    html.Div(
                                        className='six columns',
                                        children=[
                                            html.A(
                                                html.Button(
                                                    id='download-button',
                                                    children='Save',
                                                    style=style_text_box,
                                                    n_clicks=0,
                                                    n_clicks_timestamp=0
                                                ),
                                                id='download-set-link',
                                                download="selected_set.csv",
                                                href="",
                                                target="_blank",
                                                style={
                                                    'width': '100%',
                                                    'textAlign': 'center',
                                                    'color': app_config.params['font_color']
                                                }
                                            )],
                                        style={'padding-top': '0px'}
                                    ),
                                    html.Div(
                                        className='six columns',
                                        children=[
                                            dcc.Upload(
                                                id='upload-pointsets',
                                                children=html.Div([
                                                    html.Button(
                                                        id='upload-button',
                                                        children='Load',
                                                        style=style_text_box,
                                                        n_clicks=0,
                                                        n_clicks_timestamp=0
                                                    )]
                                                ),
                                                style={
                                                    'width': '100%',
                                                    'textAlign': 'center',
                                                    'color': app_config.params['font_color']
                                                },
                                                multiple=True
                                            )]
                                    )],
                                style={ 'border': 'thin lightgrey solid', 'padding': 1, 'margin': 1 }
                            )
                        ],
                        style=style_invis_dialog_box
                    ),
                    html.Div(
                        className="eight columns",
                        children=[
                            create_div_select_dataset(app_config.params['dataset_options'])
                        ],
                        style=style_invis_dialog_box
                    )]
            )]
    )
Esempio n. 14
0
 html.Div(className='clear'),
 # html.Br(),
 html.Div(
     id='upload-section',
     children=[
         # html.H4(id='title2', children=['Upload Files']),
         dcc.Upload(id='upload-data',
                    multiple=False,
                    children=[
                        'Drag and Drop or ',
                        html.A('Select a File (accepts *.xlsx, *.csv)')
                    ],
                    style={
                        'width': '95%',
                        'height': '60px',
                        'lineHeight': '60px',
                        'borderWidth': '2px',
                        'borderStyle': 'dashed',
                        'border-color': 'white',
                        'borderRadius': '15px',
                        'textAlign': 'center',
                        'margin-left': '20px',
                        'margin-right': '0px',
                        'font-size': '20px',
                        'color': 'white'
                    })
     ]),
 html.Div(className='clear'),
 html.Br(),
 html.Div(
     id='choose-list',
     children=[
Esempio n. 15
0
 children=[
     html.Div(
         children=[
             html.H6(
                 children=[
                     "ایجاد پایگاه داده از فایل صفحه گسترده"
                 ],
                 className="text-right pb-3"
             ),
             dcc.Upload([
                 html.B(
                     children=[
                         'انتخاب فایل',
                         html.I(className="fa fa-cloud-upload ml-2"),
                     ],
                     className='font-weight-light'
                 ),
             ],
                 className="upload-button m-auto",
                 id="CHOOSE_SPREADSHEET-TAB1_SIDEBAR_CARD2",
                 accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
             ),
             html.Small(
                 dir="rtl",
                 id="FILENAME_SPREADSHEET-TAB1_SIDEBAR_CARD2",
             )
         ],
         className='card-text text-center'
     ),
     html.Div(
         children=[
Esempio n. 16
0
def server_layout(mode=None):
    #return the layout of the GUI
    session_id = str(uuid.uuid4())

    #variable, distribution selection panel
    selection_panel = html.Div(id='selection-panel',children=[
        html.Div(id='selected-column-panel',children=[
            html.Div(id='selected-column-sec1-panel',children=[
                drc.NamedDropdown(
                    name='Select series',
                    id='selected-series',
                    searchable=False,
                    clearable=False
                ),
                dcc.Checklist(
                    id='apply-log-transform',
                    options=[{'label':' Apply log transform','value':'logtransform'}
                ]),
            ]),
            drc.NamedTextarea(
                id='series-characteristics',
                name='Series characteristics',
                cols='50',
                rows='2',
                readOnly='readOnly'
            ),
        ]),
        html.Div(id='apply-panel',children=[
            html.Div(id='apply-sec1-panel',children=[
                drc.NamedDropdown(
                    id='fitted-distributions',
                    name='Fitted distribution',
                    options=[
                        {'label': ' '+ v[0], 'value': k}
                        for k,v in dist_par_template.items() if k != 'native' and v[2]
                    ],
                    value='normal',
                    searchable=False,
                    clearable=False
                ),
            ]),
            # html.Div(id='apply-sec1b-panel',children=[
            #     drc.NamedDropdown(
            #         id='plotting-distributions',
            #         name='Probability scale',
            #         options=[
            #             {'label': ' '+ v[0], 'value': k}
            #             for k,v in dist_par_template.items() if v[2]
            #         ],
            #         value='native',
            #         searchable=False,
            #         clearable=False
            #     ),
            # ]),
            html.Div(id='apply-sec2a-panel',children=[
                html.Button('Fit',id='fit-button',n_clicks=0),
            ]),
            #dcc.Checklist(
            #    id='show-y-log',
            #    options=[{'label':' Show y-axis in log scale','value':'true'}
            #]),
        ]),
        html.Label(id='graph-refresh'),
        dcc.Store(
            id='graph-refresh-hidden',
            data=0
        ),
        html.Div(id='message-panel',children=[""]),

    ])

    #variable, distribution selection panel
    par_panel = html.Div(id='fitted-panel',children=[
        html.Div(id='fitted-sec1-panel',children=[
            drc.NamedTextarea(
                id='fitted-par',
                name='Estimated distribution parameters',
                readOnly='readOnly',
                cols= 40,
                rows= 3
            ),
            drc.NamedTextarea(
                id='estimated-quantiles',
                name='Estimated quantiles',
                readOnly='readOnly',
                cols= 40,
                rows= 3
            ),
        ])
    ])

    upload_panel = html.Div(id='last-card',children=[
        dcc.Upload(
            id='upload-data',
            children=html.Div([
                'Drag and Drop or ',
                html.A('Select File')
            ]),
            style={
                'lineHeight': '60px',
                'borderWidth': '1px',
                'borderStyle': 'dashed',
                'borderRadius': '5px',
                'textAlign': 'center',
            }
        ),
        html.Label('''File upload limited to < %0.0f Kb, containing no more than %d rows and %d columns'''%(configs['max_file_size']/1024,configs['max_file_rows'],configs['max_file_cols'])),
        html.Label('',id='data-filename'),
        html.Label('',id='data-description'),
        html.Div(id='table-panel',children=[
            dash_table.DataTable(
                id='attribute-table',
                columns=[],
                row_selectable='multi',
                editable=False,
                style_header={
                    'textAlign': 'center',
                    'fontWeight': 'bold',
                    'color': 'black',
                },
                style_cell={
                    'padding': '2px',
                    '--selected-background': 'grey',
                    'color': 'black',
                },
                style_data_conditional=[
                    {
                        'if': {'row_index': 'odd'},
                        'backgroundColor': 'rgb(248, 248, 248)'
                    }
                ],
                #locale_format= '0.3',
            )
        ],style={'visibility':'none','display':'none'}),
    ])

    chart_panel = html.Div(id='chart-panel',children=[
        dcc.Loading(id = "loading-icon", children=[
            dcc.Graph(
                id='graph',
                figure={
                },
                responsive=True,
                config=graph_config,
                style={'display':'none'}
            )
        ]),
    ],
    style={'visibility':'none'})


    layout = html.Div(
        id="body",
        className="container scalable",
        children=[
            visdcc.Run_js(id = 'chart-updated-js'),
            visdcc.Run_js(id = 'chart-unupdated-js'),
            visdcc.Run_js(id = 'error-display-js'),
            dcc.Store(id='error-display',data=''),
            html.Title(title=configs['title']),
            #hidden session id
            #row 1 for title
            html.Div(id='top-panel',children=[
                html.H5(id='app-title',children=
                    '''Distribution Fitting and Analysis Tool.
                    This tool is only for demostration porpuses''',
                    style={"margin-bottom": "0px"},
                ),
            ],className="row flex-display"),
            #second row layout
            html.Div(id='main-panel',children=[
                html.Div(id='left-panel',children=[
                    upload_panel
                ]),
                html.Div(id='output-panel',children=[
                    selection_panel,
                    par_panel,
                    chart_panel
                ],style={'visibility':'none','display':'none'}),
            ]),
            #row 4 is the footer
            html.Div(id='footer-panel',children=[
                '''
                    A web application built on top of Dash (v%s) (framework for Python) by
                    Exequiel Sepúlveda and Dmitri Kavetski.'''%(dash.__version__)
            ]),
        ],
    )
    return layout
Esempio n. 17
0
def serve_layout():
    # Generates a session ID
    session_id = str(uuid.uuid4())

    # Post the image to the right key, inside the bucket named after the
    # session ID
    store_image_string(utils.IMAGE_STRING_PLACEHOLDER, session_id)

    # App Layout
    return html.Div(
        id="root",
        children=[
            # Session ID
            html.Div(session_id, id="session-id"),
            # Main body
            html.Div(
                id="app-container",
                children=[
                    # Banner display
                    html.Div(
                        id="banner",
                        children=[
                            html.Img(
                                id="logo",
                                src=app.get_asset_url("dash-logo-new.png")),
                            html.H2("Image Processing App", id="title"),
                        ],
                    ),
                    html.Div(
                        id="image",
                        children=[
                            # The Interactive Image Div contains the dcc Graph
                            # showing the image, as well as the hidden div storing
                            # the true image
                            html.Div(
                                id="div-interactive-image",
                                children=[
                                    utils.GRAPH_PLACEHOLDER,
                                    html.Div(
                                        id="div-storage",
                                        children=utils.STORAGE_PLACEHOLDER,
                                    ),
                                ],
                            )
                        ],
                    ),
                ],
            ),
            # Sidebar
            html.Div(
                id="sidebar",
                children=[
                    drc.Card([
                        dcc.Upload(
                            id="upload-image",
                            children=[
                                "Drag and Drop or ",
                                html.A(children="Select an Image"),
                            ],
                            # No CSS alternative here
                            style={
                                "color": "darkgray",
                                "width": "100%",
                                "height": "50px",
                                "lineHeight": "50px",
                                "borderWidth": "1px",
                                "borderStyle": "dashed",
                                "borderRadius": "5px",
                                "borderColor": "darkgray",
                                "textAlign": "center",
                                "padding": "2rem 0",
                                "margin-bottom": "2rem",
                            },
                            accept="image/*",
                        ),
                        drc.NamedInlineRadioItems(
                            name="Selection Mode",
                            short="selection-mode",
                            options=[
                                {
                                    "label": " Rectangular",
                                    "value": "select"
                                },
                                {
                                    "label": " Lasso",
                                    "value": "lasso"
                                },
                            ],
                            val="select",
                        ),
                        drc.NamedInlineRadioItems(
                            name="Image Display Format",
                            short="encoding-format",
                            options=[
                                {
                                    "label": " JPEG",
                                    "value": "jpeg"
                                },
                                {
                                    "label": " PNG",
                                    "value": "png"
                                },
                            ],
                            val="jpeg",
                        ),
                    ]),
                    drc.Card([
                        drc.CustomDropdown(
                            id="dropdown-filters",
                            options=[
                                {
                                    "label": "Blur",
                                    "value": "blur"
                                },
                                {
                                    "label": "Contour",
                                    "value": "contour"
                                },
                                {
                                    "label": "Detail",
                                    "value": "detail"
                                },
                                {
                                    "label": "Enhance Edge",
                                    "value": "edge_enhance"
                                },
                                {
                                    "label": "Enhance Edge (More)",
                                    "value": "edge_enhance_more",
                                },
                                {
                                    "label": "Emboss",
                                    "value": "emboss"
                                },
                                {
                                    "label": "Find Edges",
                                    "value": "find_edges"
                                },
                                {
                                    "label": "Sharpen",
                                    "value": "sharpen"
                                },
                                {
                                    "label": "Smooth",
                                    "value": "smooth"
                                },
                                {
                                    "label": "Smooth (More)",
                                    "value": "smooth_more"
                                },
                            ],
                            searchable=False,
                            placeholder="Basic Filter...",
                        ),
                        drc.CustomDropdown(
                            id="dropdown-enhance",
                            options=[
                                {
                                    "label": "Brightness",
                                    "value": "brightness"
                                },
                                {
                                    "label": "Color Balance",
                                    "value": "color"
                                },
                                {
                                    "label": "Contrast",
                                    "value": "contrast"
                                },
                                {
                                    "label": "Sharpness",
                                    "value": "sharpness"
                                },
                            ],
                            searchable=False,
                            placeholder="Enhance...",
                        ),
                        html.Div(
                            id="div-enhancement-factor",
                            children=[
                                f"Enhancement Factor:",
                                html.Div(children=dcc.Slider(
                                    id="slider-enhancement-factor",
                                    min=0,
                                    max=2,
                                    step=0.1,
                                    value=1,
                                    updatemode="drag",
                                )),
                            ],
                        ),
                        html.Div(
                            id="button-group",
                            children=[
                                html.Button("Run Operation",
                                            id="button-run-operation"),
                                html.Button("Undo", id="button-undo"),
                            ],
                        ),
                    ]),
                    dcc.Graph(
                        id="graph-histogram-colors",
                        figure={
                            "layout": {
                                "paper_bgcolor": "#272a31",
                                "plot_bgcolor": "#272a31",
                            }
                        },
                        config={"displayModeBar": False},
                    ),
                ],
            ),
        ],
    )
Esempio n. 18
0
import dash_core_components as dcc
import dash_html_components as html


layout = html.Div([
    html.H3('Upload Corpus for Archetype Discovery'),
    dcc.Upload(
        id='upload-data',
        children=html.Div([
            'Drag and Drop or ',
            html.A('Select File', href='')
        ]),
        style={
            'width': '100%',
            'height': '60px',
            'lineHeight': '60px',
            'borderWidth': '1px',
            'borderStyle': 'dashed',
            'borderRadius': '5px',
            'textAlign': 'center'
        },
        # Allow multiple files to be uploaded
        multiple=False,
        accept='.zip',
        className='mt-4'
    ),
    html.Div(id='output-data-upload'),
], className='mt-4')
Esempio n. 19
0
import find_significant as fs

samples_sheet = 'SAMPLES'
observations_sheet = 'OBSERVATIONS'
antibodies_sheet = 'ANTIBODIES'

app = dash.Dash()
app.scripts.config.serve_locally = True
app.css.append_css(
    {"external_url": "https://codepen.io/chriddyp/pen/bWLwgP.css"})

app.layout = html.Div([
    html.H2('Analysis of RPMA Data', style={'text-align': 'center'}),
    html.Div([
        dcc.Upload(html.Button('Upload File'),
                   id='upload',
                   style={'text-align': 'center'})
    ]),
    html.Div([
        html.Pre(id='slider-pre'),
        html.Div(dcc.Slider(id='slider'), style={'display': 'none'})
    ]),
    html.Div([
        html.Pre(id='table1-pre'),
        html.Div([
            html.Div([
                html.Div(dt.DataTable(
                    rows=[{}], id='table1a', row_selectable=True),
                         style={'display': 'none'},
                         className='three columns'),
                html.Div(dt.DataTable(
Esempio n. 20
0
                                      ]),
                         ]),
                html.Div(className="row",
                         style={},
                         children=[
                             html.Div(className="twelve columns",
                                      children=[
                                          dcc.Upload(
                                              id="upload-data",
                                              children=html.Div([
                                                  'Drag and Drop or ',
                                                  html.A('Select Files')
                                              ]),
                                              style={
                                                  "width": "100%",
                                                  "height": "60px",
                                                  "lineHeight": "60px",
                                                  "borderWidth": "1px",
                                                  "borderStyle": "dashed",
                                                  "borderRadius": "5px",
                                                  "textAlign": "center",
                                                  "margin": "10px"
                                              },
                                          )
                                      ])
                         ]),
            ])
    ])


@app.callback(Output("error-message", "children"),
Esempio n. 21
0
             'However, you can test pre-loaded by pressing ´Push here to analyze´. '
             'The score of pre-loaded material can be seen by pressing ´Show score´. '
             'Analysis takes time, and appears at the bottom of the page.', style={'color':'red', 'textSize': 24}),
    dcc.Upload(
        id='upload-data',
        children=html.Div([
            'Drag and Drop or ',
            html.A('Select File'),
        ],
            style={
                'textAlign': 'center',
                'color': 'grey'
            }
        ),
        style={
            'width': '100%',
            'height': '60px',
            'lineHeight': '60px',
            'borderWidth': '1px',
            'borderStyle': 'dashed',
            'borderRadius': '5px',
            'textAlign': 'center',
            'margin': '10px',
            'color': 'grey'
        },
        # Allow multiple files to be uploaded
        multiple=True
    ),

    dcc.Dropdown(
        options=[{'label': val, 'value': val} for val in examples],
        "https://codepen.io/bcd/pen/KQrXdb.css"
    ])

app.layout = html.Div([
    html.Div(
        [
            html.Div(children=[
                html.Div(
                    dcc.Upload(id='upload-data',
                               children=html.Div([
                                   'Drag and Drop or ',
                                   html.A('Select File')
                               ]),
                               style={
                                   'width': '100%',
                                   'height': '40',
                                   'lineHeight': '60px',
                                   'borderWidth': '1px',
                                   'borderStyle': 'dashed',
                                   'borderRadius': '5px',
                                   'textAlign': 'center',
                                   'margin-bottom': '5px',
                                   'font-size': '14px'
                               })),
            ]),
            html.Div(id='intermediate-values', style={'display': 'none'}),
            html.Div(id='filter-selection',
                     children=[
                         html.Div(children=[dcc.Dropdown(id='start-date')],
                                  style={
                                      'margin-bottom': '5px',
                                      'font-size': '14px',
Esempio n. 23
0
                ])


cnt_msg_upfile = html.Div([
                        html.Div(id="msg-upfile", children=msg_file)                        
                    ])
                       

cnt_uploader = html.Div([dcc.Upload(id="upload-file",
                children=html.Div([
                    'Arrastra y suelta o ',
                    html.A('selecciona el/los archivo/s')
                ]),
                style={
                    'width': '100%',
                    'height': '60px',
                    'lineHeight': '60px',
                    'borderWidth': '1px',
                    'borderStyle': 'dashed',
                    'borderRadius': '5px',
                    'textAlign': 'center'
                },
                multiple=True
            ),
            html.Div(id='container-upfile',
                     children=[cnt_msg_upfile]
                     ),
            html.Div(id="cnt-alert-format", 
                     children=[
                        dbc.Alert(
                            id="alert-format",
                            color="light",
Esempio n. 24
0
                      'value': 'json'
                  }, {
                      'label': 'Excel',
                      'value': 'xls'
                  }],
                  value='op-li',
                  placeholder='Select file type',
                  style={
                      'margin-left': '1.5%',
                      'margin-top': '2.0%',
                      'width': '27.0%'
                  })
 ], ),
 html.Div([
     dcc.Upload(id='upload-data',
                children=html.Div(
                    [(html.Button('Upload File'))],
                    style={'margin-left': '45.0%'})),
     html.Hr(),
     html.Hr(),
     html.Hr(),
     dcc.Upload(
         ['Drag and Drop or ',
          html.A('Select a File')],
         style={
             'width': '100%',
             'height': '60px',
             'lineHeight': '60px',
             'borderWidth': '1px',
             'borderStyle': 'dashed',
             'borderRadius': '5px',
             'textAlign': 'center'
Esempio n. 25
0
 html.Br(),
 html.B('OR'),
 html.Br(),
 html.Br(),
 html.Details(children=[
     html.Summary('From your computer'),
     html.Br(),
     dcc.Upload(
         id='csv',
         children=html.Div([
             'Drag and Drop or ',
             html.A('Select Files'),
             html.Div(id='filename-select',
                      className='filename-class'),
         ]),
         style={
             'width': '400px',
             'height': '60px',
             'borderWidth': '1px',
             'borderStyle': 'dashed',
             'borderRadius': '5px',  # curvature of the border
             'textAlign': 'center',
             # 'margin': '10px',      # margin from left
             # 'lineHeight': '40px'   # height of a carriage return
         })
 ]),
 html.Hr(),
 'Output directory',
 html.Br(),
 dcc.Input(
     value='',
     id='outDir',
Esempio n. 26
0
}

ClassUploadChildren = [html.Div(["Drag and Drop or ", html.A("Select Files")])]

CONFIG_CONTENT = "config-content"
CLASS_UPLOAD = "class-upload"
FOLDER_SELECT = "folder-select"
DATA_OUTPUT = "data-output"
GO_BUTTON = "go-button"

ConfigLayout = html.Div(
    [
        html.H3("Class List"),
        dcc.Upload(
            id=CLASS_UPLOAD,
            children=ClassUploadChildren,
            style=SelectStyle,
            multiple=False,
        ),
        html.H3("Data Folder"),
        dcc.Input(
            id=FOLDER_SELECT,
            type="text",
            placeholder="Select folder...",
            value=os.path.abspath(
                os.path.join(os.path.dirname(__file__), "..", "..", "data",
                             "corpus")),
            style=SelectStyle,
        ),
        html.H3("Data Output File"),
        dcc.Input(
            id=DATA_OUTPUT,
Esempio n. 27
0
         style={
             'display': 'flex',
             'margin-left': 'auto',
             'margin-right': '0px',
             'align-items': 'center'
         })
 ],
         style={
             'display': 'flex',
             'margin-bottom': '5px'
         }),
 dbc.Col([
     dcc.Upload(id='upload-data',
                children=html.Div([
                    'Drag and Drop or ',
                    html.A('Select Files')
                ]),
                multiple=False,
                className='upload-file'),
     html.Div(id='alert-container')
 ]),
 dbc.Col([
     html.Table(
         html.Tr([
             html.Td(html.P('Notes:')),
             html.Td([
                 html.
                 P("We won't save your data unless you specify to Save (which is not currently available)"
                   ),
                 html.
                 P('Due to heroku free plan performance, upload time may take a few minutes depend on file size. For comparison, 100kb file uploaded around 20 second and 1mb around 2 minutes.'
Esempio n. 28
0
     #)
 ],
     className="banner"
 ),
 html.Div(className="container", children=[
     html.Div(className='row', children=[
         html.Div(className='five columns', children=[
                 dcc.Upload(
                     id='upload-image',
                     children=html.Div([
                         'Drag and Drop or ',
                         html.A('Select an Image')
                     ]),
                     style={
                         'width': '100%',
                         'height': '50px',
                         'lineHeight': '50px',
                         'borderWidth': '1px',
                         'borderStyle': 'dashed',
                         'borderRadius': '5px',
                         'textAlign': 'center'
                     },
                     #multiple=True
                     #accept='image/*'
                 ),
                 #drc.NamedInlineRadioItems(
                 #    name='Selection Mode',
                 #    short='selection-mode',
                 #    options=[
                 #        {'label': ' Rectangular', 'value': 'select'},
                 #        {'label': ' Lasso', 'value': 'lasso'}
                 #    ],
Esempio n. 29
0
 label='Load network',
 children=[
     dbc.Button('Upload .csv file',
                id='open-upload-modal',
                color="primary",
                block=True),
     dbc.Modal(
         [
             dbc.ModalHeader(
                 'Upload CSV file from your computer'),
             dbc.ModalBody([
                 dcc.Upload(id='upload-data',
                            children=[
                                dbc.Button(
                                    'Upload .csv file',
                                    color="primary",
                                    block=True),
                            ],
                            className='upload-panel',
                            multiple=False),
                 html.Span(id='uploaded-file-name'),
                 dcc.Checklist(
                     id='is-directed-checkbox',
                     options=[
                         {
                             'label': 'Directed',
                             'value': 'directed'
                         },
                     ],
                 )
             ]),
Esempio n. 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')
                ])