plotly-dash

Html dash table

爷,独闯天下 提交于 2020-08-25 05:06:09
问题 I am trying to use dash to create a html table My dataframe looks like this : Cap non-cap 0 A a 1 B b 2 C c 3 D d 4 E e .. 26 Z z I want to display an html table just like the dataframe, but without the 0 - 26 index. The structure is {'Cap' : ['A', 'B', 'C',....], 'non-Cap' : ['a','b','c',...]} I tried : return html.Table( [html.Tr([html.Th(col) for col in dataframe.columns])] + [html.Tr([ html.Td(dataframe.iloc[i][col]) for col in dataframe.columns ]) for i in range(min(len(dataframe), max

plotly treemap element with “href” not working with local relative html paths

我是研究僧i 提交于 2020-08-25 04:02:14
问题 I have simple table with href inside the text. The href points to relative path of local html file. But clicking on it doesn't open the page. is there any way to do that/ good workaround? The folder structure is following. As the root will be changed, so the relative path is needed. --root --root/index.html --root/files/file1.html --root/files/file2.html import plotly.express as px df = px.data.gapminder().query("year == 2007") link_ref = '<a href="files/file1.html">{}</a>' df['country'] = df

Downloading dynamically generated files from a Dash/Flask app

巧了我就是萌 提交于 2020-08-21 05:35:42
问题 I tried to build a minimal example of a Dash app that illustrates the problem of dynamically generating a file that can then be downloaded via a download button. If you run this example, you will see a text area where text can be entered. A click on the "enter" button will store the text to a file and create a download button for the file. import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output, State import uuid

why does my x axis ticks are not sorted properly in plotly graph

懵懂的女人 提交于 2020-08-19 05:35:12
问题 I am trying to plot a sales trend, over the weeks. But in the x axis, the ticks are not in proper sorted order, there by making my graph look weird. Graph : As you can see , the circled week , needs to come in starting or the axis. Why does this happen like this even after I have sorted the dates in the dataframe ? Pandas Code : basic_df = filterDataFrameByDate(df,start_date,end_date) df = basic_df.groupby(['S2PName',basic_df['S2BillDate'].dt.to_period(flag)], sort=False)['S2PGTotal'].agg([(