from app import app, html, dcc, dash # sensor data for table global sensors global values sensors = ["S1", "S2", "S3", "S4", "S5"] values = [1, 2, 3, 4, 5] overview = html.Div([ html.H2('Hello World'), dcc.Dropdown(id='dropdown', options=[{ 'label': i, 'value': i } for i in ['LA', 'NYC', 'MTL']], value='LA'), html.Div(id='display-value'), html.Table( # Sensor names [html.Tr([html.Th("Sensor", ), html.Th("Value")])] + # Sensor Values [ html.Tr([html.Td(sensors[i]), html.Td(values[i])]) for i in range(max(len(sensors), len(values))) ]) ])
from app import app, html, dcc, dash from db import Data, Sensor import dash_table import pandas as pd sensors = html.Div([ html.H2('Sensors'), html.Div(id='display-sensor'), dcc.Interval( id='interval-component', interval=1 * 1000, # in milliseconds n_intervals=0), html.H2('Sensor Values'), html.Div(id='display-value') ]) def getSensorTable(): sensor_query = Sensor.query df = pd.read_sql(sensor_query.statement, sensor_query.session.bind) return dash_table.DataTable( id='sensor-table', data=df.to_dict('records'), columns=[{ "name": i, "id": i } for i in df.columns], style_cell={ 'textAlign': 'center', 'min-width': '50px'
from app import app, html, dcc, dash, Data, Sensor import dash_table import pandas as pd import plotly.express as px #f = px.data.iris() #ig = px.scatter(df, x="sepal_width", y="sepal_length", color="species") # If you print fig, you'll see that it's just a regular figure with data and layout # print(fig) fig.show() overview = html.Div([ html.H2('Sensors'), html.Div(id='display-value'), dcc.Interval( id='interval-component', interval=1 * 1000, # in milliseconds n_intervals=0) ]) def getSensorTable(): sensor_query = Sensor.query print(sensor_query) df = pd.read_sql(sensor_query.statement, sensor_query.session.bind) return dash_table.DataTable( id='sensor-table', data=df.to_dict('records'),
import numpy as np from app import IBNR, cl, MyPickle, html, dbc, dash_table, Format, Scheme NAV_STYLE = { "height": 10, "padding": "2rem 1rem", } CONTENT_STYLE = { "padding": "5rem 1rem", } nav = dbc.Nav( [ html.H2(children="I.B.N.R.", style={ "color": "#fff", "margin-right": "2rem" }), dbc.NavItem(dbc.NavLink("Step One ", href="/step_one")), dbc.NavItem(dbc.NavLink("Step Two ", active=True, href="/step_two")), ], pills=True, className="navbar navbar-expand-lg navbar-dark bg-primary fixed-top", style=NAV_STYLE) def _get_paid_df_ult_ibnr_M2Qper(param_hist): df = IBNR.Data_Handler.data output = pd.DataFrame([]) for i, row in param_hist.iterrows(): product_code_claim = eval(row['product_code_claim'])
from app import app, html, dcc, dash from db import Data, Sensor import plotly.graph_objs as go import dash_table import pandas as pd from util import angle_between from pages.components.orientation import Orientation from pages.components.card import Card from pages.components.row import Row orientation = Orientation() card = Card() row = Row() overview = html.Div([ html.H2('Overview'), dcc.Interval( id='interval-component', interval=1*1000, # in milliseconds n_intervals=0 ), row.create(children=[ card.create( title='Orientation', children=[orientation.create(id='orientation')], footer_id='orientation_text', col_sizes={'md': 6, 'xl': 4} ), card.create( title='Altitude', children=[
{'name': 'claim_category', 'id': 'claim_category'}, {'name': 'updated_on', 'id': 'updated_on'}, {'name': 'params', 'id': 'params'} ], data = None, row_selectable="multi", selected_rows =[], row_deletable=False, sort_action="native", page_current= 0, page_size= 10, style_header={'textAlign': 'center'}, style_table={'overflowX': 'auto'}, ) table_incremental = html.Div([ html.H2('Incremental Triangle'), dash_table.DataTable( id='incremental triangle', columns=None, data=None, export_format="csv", merge_duplicate_headers=True, style_data_conditional = None, style_header={ 'fontWeight': 'bold', 'textAlign': 'center' }, style_table={'overflowX': 'auto'}, ) ]) table_cummulative = html.Div([