This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dash | |
from dash import Dash, dash_table, dcc, html | |
from dash.dependencies import Input, Output | |
import pandas as pd | |
import plotly.express as px | |
df = px.data.tips() | |
df["id"] = df.index | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
See other MWEs for images and text icons here: https://github.com/plotly/dash-table/pull/916 | |
Css in assets folder: (not tested yet maybe move the body font-size somewhere else since it will affect the entire app like this) | |
.cell-markdown > p { | |
display: flex; | |
height: 100%; | |
justify-content: center; | |
align-items: center; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dash import Dash, dcc, html, Input, Output | |
import dash_bootstrap_components as dbc | |
import spacy | |
from spacy import displacy | |
import base64 | |
nlp = spacy.load("en_core_web_sm") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
From dash community question: | |
https://community.plotly.com/t/how-can-i-allow-users-to-select-which-comparison-variables-to-display-on-a-chart/69124 | |
""" | |
from dash import Dash, html, dcc, Input, Output | |
import plotly.express as px | |
import pandas as pd | |
import dash_bootstrap_components as dbc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dash | |
from dash import Dash, dcc, html, Input, Output | |
import dash_bootstrap_components as dbc | |
import requests | |
app = Dash(__name__, external_stylesheets=[dbc.themes.SUPERHERO, dbc.icons.BOOTSTRAP]) | |
coins = ["bitcoin", "ethereum", "binancecoin", "ripple"] | |
interval = 6000 # update frequency - adjust to keep within free tier | |
api_url = "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dash import Dash, dcc, html, dash_table, Input, Output, callback | |
import plotly.express as px | |
import dash_bootstrap_components as dbc | |
from dash_bootstrap_templates import ThemeSwitchAIO | |
# select the Bootstrap stylesheet2 and figure template2 for the theme toggle here: | |
template_theme1 = "minty" | |
template_theme2 = "cyborg" | |
url_theme1 = dbc.themes.MINTY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dash import Dash | |
import dash_mantine_components as dmc | |
from dash_iconify import DashIconify | |
app = Dash(__name__) | |
pages = ["home.py", "page1.py", "page2.py"] | |
assets = ["mycss.css", "app.png", "page1.png"] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from Adam's video https://www.youtube.com/watch?v=2pWwSm6X24o&list=PLh3I780jNsiQObs1CGDIB1S_I7--M40yC | |
# data is stored in a dcc.Store(id="changed-cell") | |
app.clientside_callback( | |
""" | |
function (input,oldinput) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dash import Dash, dcc, html, Input, Output | |
import dash_bootstrap_components as dbc | |
import requests | |
app = Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP, dbc.icons.BOOTSTRAP]) | |
def get_data(coin): | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dash import Dash, html, dcc, Input, Output | |
import numpy as np | |
import plotly.express as px | |
import dash_bootstrap_components as dbc | |
app = Dash(__name__, external_stylesheets=[dbc.themes.SPACELAB]) | |
heading = html.H4( | |
"Normal Distribution Simulation", className="bg-primary text-white p-4" |
NewerOlder