Skip to content

Instantly share code, notes, and snippets.

@jackparmer
Created July 28, 2021 20:00
Show Gist options
  • Save jackparmer/75f855ac530d9cd6749ce8fe65e22dc2 to your computer and use it in GitHub Desktop.
Save jackparmer/75f855ac530d9cd6749ce8fe65e22dc2 to your computer and use it in GitHub Desktop.
pyenv('Version','/opt/anaconda3/bin/python3');
pyenv('ExecutionMode','OutOfProcess');
pyenv
dct = py.dict(pyargs('href', 'https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css', ...
'rel', 'stylesheet', ...
'integrity', 'sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO', ...
'crossorigin', 'anonymous' ))
ext_stylesheets = py.list({py.str('https://codepen.io/chriddyp/pen/bWLwgP.css'), dct})
app = py.dash.Dash('__main__',pyargs('external_stylesheets',ext_stylesheets));
dc = py.dict(pyargs("Fruit", {'apple','melon','orange','apple'}, ...
"Amount", [4 4 5 3], ...
"City", {'ny','la','sf','sf'}));
df = py.pandas.DataFrame(dc);
fig = py.plotly.express.bar(df,pyargs('x',"Fruit", 'y',"Amount", 'color',"City", 'barmode',"group"));
app.layout = py.dash_html_components.Div(pyargs('children', ...
{py.dash_html_components.H1(pyargs('children','Hello Dash')), ...
py.dash_html_components.Div(pyargs('children','Hello')), ...
py.dash_core_components.Graph(pyargs('id','example-graph','figure',fig) )} ))
app.run_server(pyargs('debug',false,'use_reloader',false,'port','8057'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment