예제 #1
0
    def _perform_layout(self):
        ddk = import_ddk()

        children = []

        if self.title is not None:
            children.append(ddk.Header([ddk.Title(self.title)]))

        # Input card
        sidebar_children = []
        sidebar_children.append(
            ddk.ControlCard(
                children=self.get_containers("input"),
            )
        )

        sidebar = ddk.Sidebar(
            foldable=True,
            children=sidebar_children,
            style={"minWidth": self.sidebar_width if self.sidebar_width else "auto"},
        )
        children.append(sidebar)

        output_card_children = []
        output_card_children.extend(self.get_containers("output"))

        output_card = ddk.ControlCard(output_card_children)

        sidebar_companion = ddk.SidebarCompanion(output_card)
        children.append(sidebar_companion)

        return children
예제 #2
0
    def _perform_layout(self):
        ddk = import_ddk()
        import dash_core_components as dcc

        children = []

        if self.title is not None:
            children.append(ddk.Header([ddk.Title(self.title)]))

        # Input card
        sidebar_children = []
        sidebar_children.append(
            ddk.ControlCard(
                children=self.get_containers("input"),
            )
        )

        sidebar = ddk.Sidebar(
            foldable=True,
            children=sidebar_children,
            style={"minWidth": self.sidebar_width if self.sidebar_width else "auto"},
        )
        children.append(sidebar)

        self._tabs.children = [
            dcc.Tab(
                value=role,
                label=title,
                children=ddk.ControlCard(list(reversed(self.get_containers(role)))),
            )
            for role, title in self.tab_roles.items()
        ]

        sidebar_companion = ddk.SidebarCompanion(self._tabs)
        children.append(sidebar_companion)

        return children
예제 #3
0
 ddk.Header(
     style={
         'height': '7vh',
         'background-color': '#163d47',
         'opacity': '1',
         'margin': '0px'
     },
     children=[
         ddk.Block(
             width=33,
             style={'text-align': 'left'},
             children=[
                 html.Div(id='placeholder1',
                          style={"display": "none"},
                          children=layouts.sound(0)),
                 html.Div(id='on-content',
                          style={'display': 'none'}),
                 html.Div(id='off-content',
                          style={'display': 'none'}),
                 html.Button(children="TURN ON",
                             style={
                                 'text-align': 'center',
                                 "background-color": "palegreen",
                                 "border-radius": "20px",
                                 'margin': '10px',
                                 'font-size': '15px'
                             },
                             id='On_Avtomat_btn',
                             n_clicks=0),
                 html.Button(
                     children="ALERT",
                     style={
                         'text-align': 'center',
                         # 'max-width': '100px',
                         "background-color": "tomato",
                         "border-radius": "20px",
                         'margin': '10px',
                         'font-size': '15px'
                     },
                     id='Off_Avtomat_btn',
                     n_clicks=0)
             ]),
         ddk.Block(width=33,
                   style={'text-align': 'center'},
                   children=[
                       html.Button(children="REFRESH BALANCE",
                                   style={
                                       'text-align': 'center',
                                       "background-color":
                                       "palegreen",
                                       "border-radius": "20px",
                                       'margin': '10px',
                                       'font-size': '15px'
                                   },
                                   id='Ref_balance_btn',
                                   n_clicks=0),
                       html.Div(id='BALANCE-content',
                                style={'display': 'none'}),
                   ]),
         ddk.Block(width=33,
                   style={'text-align': 'right'},
                   children=[
                       dcc.Link('ГЛАВНАЯ',
                                style={
                                    'color': 'azure',
                                    'margin': '10px'
                                },
                                href='/'),
                       dcc.Link('REGIM 2',
                                style={
                                    'color': 'azure',
                                    'margin': '10px'
                                },
                                href='/regim2'),
                       dcc.Link('REGIM 3',
                                style={
                                    'color': 'azure',
                                    'margin': '10px'
                                },
                                href='/regim3'),
                       dcc.Link('КЛЮЧИ',
                                style={
                                    'color': 'azure',
                                    'margin': '10px'
                                },
                                href='/keys')
                   ])
     ]),
예제 #4
0
import dash
import dash_design_kit as ddk
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output

app = dash.Dash(__name__)
server = app.server  # expose server variable for Procfile

app.layout = ddk.App([
    ddk.Header([
        ddk.Logo(src=app.get_asset_url('logo.png')),
        ddk.Title('Dash Enterprise Sample Application'),
    ]),
    ddk.Row(children=[
        ddk.Card(children=ddk.Graph(figure={
            'data': [{
                'x': [1, 2, 3, 4],
                'y': [4, 1, 6, 9],
                'line': {
                    'shape': 'spline'
                }
            }]
        }, )),
    ]),
    ddk.Row(children=[
        ddk.Card(width=50,
                 children=ddk.Graph(figure={
                     'data': [{
                         'x': [1, 2, 3, 4],
                         'y': [4, 1, 6, 9],
예제 #5
0
    for i in columns:
        figure.add_trace(go.Box(x=dataframe[i], name=i,
                                marker_color='#ffad33'))

    return figure


app.layout = ddk.App(
    show_editor=False,  # setting to True allows styling after build
    children=[
        ddk.Header([
            ddk.Logo(
                "assets/6synctLogoBlack.png",
                style={
                    "height": "30px",
                    "margin-right": "0px",
                    "width": "auto",
                },
            ),
            ddk.Title('NRC IRAP - Corporate Funding in Canada from 2018-2020'),
        ]),  # end of ddk.Header
        ddk.Block(  # left-hand column
            width=20,
            children=[
                dcc.Tabs([
                    dcc.Tab(
                        label='Map Filters',
                        children=[
                            ddk.ControlCard(
                                id='map-controls',
                                children=[
app = dash.Dash(__name__)
server = app.server  # expose server variable for Procfile

graph_height = 300

graph_config = {'modeBarButtonsToRemove': ['hoverCompareCartesian', 'select2d', 'lasso2d'],
                'doubleClick': 'reset+autosize', 'toImageButtonOptions': {'height': None, 'width': None, },
                'displaylogo': False}

app.layout = ddk.App([
    ddk.Header([
        ddk.Logo(src=app.get_asset_url('logo.png'), style={
            'max-height': 100,
            'width': 'auto'
        }),
        ddk.Title('TELONAS2'),
        ddk.SectionTitle('', id='final_date'),
        html.Button('Refresh', style={'float': 'right'}, id='refresh', n_clicks=0),
    ]),
    ddk.Block(
        children=[
            dcc.Tabs(id='selected-tab', value='load',
                     children=[
                         dcc.Tab(label="Load", value='load',
                                 children=[ddk.Card(width=100,
                                                    children=[
                                                        dcc.Loading(id='load_loader', children=[
                                                            ddk.Graph(id="load_plot", config=graph_config)]),
                                                            ]
                                                        )
예제 #7
0
import dash
from dash import dcc

import dash_design_kit as ddk

app = dash.Dash(__name__)

app.layout = ddk.App([
    ddk.Header([
        ddk.Menu(dcc.Link(page["name"], href=page["path"]))
        for page in dash.page_registry
    ]),
    dash.page_container,
])

if __name__ == "__main__":
    app.run_server(debug=True)
예제 #8
0
# df3 = df.groupby(df['Period','Type'], as_index=False)
#df3['LatLongTypeCount']=df3['name_old']
Type_list = list(df["Type"].unique())
totalFossilsFounds = len(df.axes[0])

# fig = px.scatter_geo(df, lat='Latitude', lon='Longitude', color="Country",
#                      hover_name="Country",
#                      projection="mercator",
#                      )


layout = ddk.App(
        [
                ddk.Header(
                        [
                        ddk.Logo(src=app.get_asset_url('trex.png')),
                        ddk.Title("Dino Fossil Data"),
                        ]
                ),
                dbc.Row(
                children=[
                        dbc.Col(
                        dbc.Card(
                                dbc.CardBody(
                                children=[
                                        html.Label('Period', style={'fontSize':30, 'textAlign':'center'}),
                                        dcc.Dropdown(
                                        id='period',
                                        options=[
                                                {"label": i, "value": i} for i in Period_list
                                        ],
                                        multi=True,
예제 #9
0
    print("skipping call to update redis cache")

app.layout = ddk.App(children=[
    ddk.Header(children=[
        dcc.Link(
            href=app.get_relative_path("/"),
            children=[ddk.Logo(src=app.get_relative_path("/assets/hnts.png"))],
        ),
        ddk.Title("Daily Standup"),
        html.Div([
            html.P(
                "Powered by",
                style={
                    "float": "left",
                    'fontSize': 10,
                    "margin-bottom": "0px"
                },
            ),
            html.Img(src=app.get_asset_url("his.png"),
                     style={
                         "width": "130px",
                         "float": "left",
                         "margin-top": "0px",
                         "margin-left": "5px"
                     })
        ]),
    ],
               style={"backgroundColor": "var(--accent_positive)"}),
    ddk.Sidebar([
        ddk.Menu([
            dcc.Link(href=app.get_relative_path('/'), children='Home'),
예제 #10
0
dash_app.layout = html.Div([
    dcc.Location(id='url', refresh=False),
    ddk.App(
        style={'background-color': 'transparent'},
        children=[
            ddk.Header(
                style={
                    'height': '7vh',
                    'background-color': '#163d47',
                    'opacity': '1',
                    'margin': '0'
                },
                children=[
                    ddk.Logo(src='../assets/logo.gif'),
                    ddk.Block(
                        style={'text-align': 'right'},
                        children=[
                            dcc.Link('Главная',
                                     style={
                                         'color': 'azure',
                                         'margin': '10px'
                                     },
                                     href='/'),
                            # dcc.Link('Карточка Матча', style={'color': '#fff', 'margin': '10px'}, href='/match_card'),
                            # dcc.Link('МАТЧИ', style={'color': '#fff', 'margin': '10px'}, href='/all_matches')
                        ])
                ]),
            html.Div(id='page-content'),
            html.Div(id='table-container'),
        ])
])
예제 #11
0
    ddk.CollapsibleMenu(title='Performance',
                        default_open=False,
                        children=[
                            dcc.Link('Team 1',
                                     href=app.get_relative_path('/')),
                            dcc.Link('Team 2',
                                     href=app.get_relative_path('/')),
                        ]),
    dcc.Link('Conditions', href=app.get_relative_path('/')),
    dcc.Link('Historical', href=app.get_relative_path('/')),
    dcc.Link('Portal', href=app.get_relative_path('/')),
])

app.layout = ddk.App([
    ddk.Header([
        ddk.Logo(src=app.get_asset_url('logo.png')),
        ddk.Title(get_configuration()), menu
    ]),
    ddk.Block(width=30,
              children=[
                  ddk.ControlCard(controls),
                  ddk.ControlCard(controls),
                  ddk.ControlCard(controls),
              ]),
    ddk.Block(width=70,
              children=[
                  ddk.Row([
                      ddk.Card(width=50,
                               children=dcc.Markdown(
                                   textwrap.dedent('''
                Sed ut perspiciatis unde omnis iste natus
                voluptatem accusantium doloremque laudantium,
예제 #12
0
    ddk.CollapsibleMenu(title='Performance',
                        default_open=False,
                        children=[
                            dcc.Link('Team 1',
                                     href=app.get_relative_path('/')),
                            dcc.Link('Team 2',
                                     href=app.get_relative_path('/')),
                        ]),
    dcc.Link('Conditions', href=app.get_relative_path('/')),
    dcc.Link('Historical', href=app.get_relative_path('/')),
    dcc.Link('Portal', href=app.get_relative_path('/')),
])

app.layout = ddk.App([
    ddk.Header([
        ddk.Logo(src=app.get_asset_url('logo.png')),
        ddk.Title('Weekly Report'), menu
    ]),
    ddk.Block(width=30,
              children=[
                  ddk.ControlCard(controls),
                  ddk.ControlCard(controls),
                  ddk.ControlCard(controls),
              ]),
    ddk.Block(width=70,
              children=[
                  ddk.Row([
                      ddk.Card(width=50,
                               children=dcc.Markdown(
                                   textwrap.dedent('''
                Sed ut perspiciatis unde omnis iste natus
                voluptatem accusantium doloremque laudantium,
예제 #13
0
import dash
import dash_design_kit as ddk
import plotly.express as px
import pandas as pd

app = dash.Dash(__name__)
server = app.server  # expose server variable for Procfile

df = pd.DataFrame({
    "Fruit": ["Apples", "Oranges", "Bananas", "Apples", "Oranges", "Bananas"],
    "Amount": [4, 1, 2, 2, 4, 5],
    "City": ["SF", "SF", "SF", "Montreal", "Montreal", "Montreal"]
})

fig = px.bar(df, x="Fruit", y="Amount", color="City", barmode="group")

app.layout = ddk.App(
    show_editor=True,
    children=[
        ddk.Header([ddk.Title('Hello Dash')]),
        ddk.Card(children=[
            ddk.CardHeader(
                title='Dash: A Web application framework for Python.'),
            ddk.Graph(figure=fig)
        ])
    ])