def create_dashapp(self): # """ Creates DjangoDash DashApp :return: DjangoDash DashApp (object) DashApp object for direct insertion into webapp """ app = DjangoDash(self.app_id) app.layout = \ html.Div([ html.Div( dcc.Graph( id=self.app_id, # Unique ID to track DashApp figure=self.figure, ), ), ]) app.title = self.app_id return app
import pandas as pd import os import dash_core_components as dcc from django_plotly_dash import DjangoDash import dash_html_components as html import dash_bootstrap_components as dbc from datetime import datetime as dt import plotly import numpy as np import requests import json app = DjangoDash('pI3j5YHUf0mEpE0K') app.title = 'P.Dashboard' app.layout = html.Div(children=[ html.H1(children='Application Sample'), html.Div(children='Plotly Dash App'), dcc.Graph(id='graph', figure={ 'data': [ { 'x': [1, 2, 3], 'y': [4, 1, 2], 'type': 'bar', 'name': 'Sydney' }, { 'x': [1, 2, 3], 'y': [2, 4, 5], 'type': 'bar', 'name': 'Melbourne' },
'reds', 'reds_r', 'solar', 'solar_r', 'spectral', 'spectral_r', 'speed', 'speed_r', 'sunset', 'sunset_r', 'sunsetdark', 'sunsetdark_r', 'teal', 'teal_r', 'tealgrn', 'tealgrn_r', 'tealrose', 'tealrose_r', 'tempo', 'tempo_r', 'temps', 'temps_r', 'thermal', 'thermal_r', 'tropic', 'tropic_r', 'turbid', 'turbid_r', 'twilight', 'twilight_r', 'viridis', 'viridis_r', 'ylgn', 'ylgn_r', 'ylgnbu', 'ylgnbu_r', 'ylorbr', 'ylorbr_r', 'ylorrd', 'ylorrd_r' ]] app = DjangoDash( 'WorldMap', add_bootstrap_links=True ) # dash.Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP]) から変更 # dash_bootstrap_componentsを利用する場合には"add_bootstrap_links=True"を追加する # server = app.serverは削除 app.title = "世界の統計地図" app.layout = dbc.Container([ html.Div([ html.H4("世界の統計地図"), html.Div([html.P("データ元: 世界銀行")], style={"text-align": "right"}), html.Div( [ dcc.Dropdown(id='item-dropdown', options=item_options, value='一人当たりGDP(ドル)') ], style={ 'width': '25%', 'marginLeft': '0%', 'marginRight': '0%', 'display': 'inline-block',
#app.scripts.config.serve_locally = True #app.css.config.serve_locally = True from py2neo import Graph import pandas as pd graph = Graph("bolt://localhost:7687", auth=("neo4j", "test")) cursor = graph.run("MATCH (a:EfigaRecord) RETURN a") rs = [] for record in cursor: rs.append(dict(record.values(0)[0])) df = pd.DataFrame(rs) #pivot_ui(df,outfile_path="pivottablejs.html") app.title = 'Efiga Data' app.layout = html.Div([ dash_pivottable.PivotTable(id='table', data=df.to_dict('records'), cols=[], colOrder="key_a_to_z", rows=[], rowOrder="key_a_to_z", rendererName="Table", aggregatorName="Count", vals=[], valueFilter={}), dcc.Markdown(id='output'), dcc.Markdown(id='output') ])
# drc = importlib.import_module("dash_reusable_components") # utils = importlib.import_module("utils") external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] APP_PATH = 'C:/Users/Dell-pc/Desktop/Capstone/django/ecfullfill/home/dash_apps/finished_apps' app = DjangoDash('SimpleExample') app.css.append_css({'external_url': 'https://codepen.io/amyoshino/pen/jzXypZ.css'}) # resets the callbacks app.callback_map = {} # sets the title app.title = 'Ecfullfill Capstone' # html content app.layout = html.Div([ #Card Groups html.Div([ #Product Length Button html.Div([ html.Div(id='output-container-button-1', children='Enter Product Length'), html.Div(dcc.Input(id='input-box-1', type='text'), style={'position':'relative'}), html.Button('Submit', id='button-1', style={'position':'relative'}) ],className='two columns'),