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 | |
from dash_extensions import BeforeAfter | |
import dash_bootstrap_components as dbc | |
deep_field = "https://user-images.githubusercontent.com/72614349/179115661-f8de6e4c-0dca-4628-ab67-3d525f5ac049.jpg" | |
stephans_quintet = "https://user-images.githubusercontent.com/72614349/179115662-32d348da-fa8b-481d-b4fc-9f7414f49de0.jpg" | |
webb_stephans_quintet = "https://user-images.githubusercontent.com/72614349/179115663-71578706-1ab5-45a5-b809-812c7c3028a7.jpg" | |
carina = "https://user-images.githubusercontent.com/72614349/179115665-9800b45c-e1dc-4aa7-8b34-885d48c61221.png" | |
southern_nebula = "https://user-images.githubusercontent.com/72614349/179115666-fdd204fc-e33d-4524-9ba5-a2611740f8a7.jpg" | |
webb_deep_field = "https://user-images.githubusercontent.com/72614349/179115668-2630e3e4-3a9f-4c88-9494-3412e606450a.jpg" |
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 | |
scripts = [ | |
"https://cdnjs.cloudflare.com/ajax/libs/dayjs/1.10.8/dayjs.min.js", | |
"https://cdnjs.cloudflare.com/ajax/libs/dayjs/1.10.8/locale/fr.min.js", | |
] | |
# Default is English. To change the locale be sure to include proper localization file from dayjs library. | |
# See more options here: |
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 | |
app = Dash(__name__) | |
app.layout = html.Div( | |
[ | |
html.Div(["Regular Markdown link - note that the page refreshes"]), | |
dcc.Markdown(["[Page 1](page1)"]), | |
html.Br(), | |
html.Div(["Markdown dccLink - note that the pages does not refresh"]), |
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 more info: https://stackoverflow.com/questions/63589249/plotly-dash-display-real-time-data-in-smooth-animation/63681810#63681810 | |
from dash import Dash, dcc, html | |
import numpy as np | |
from dash.dependencies import Input, Output, State | |
# Example data (a circle). | |
resolution = 1000 |
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, dash_table | |
import pandas as pd | |
data = dict( | |
[ | |
("Date", ["2015-01-01", "2015-10-24", "2016-05-10", "2017-01-10", "2018-05-10", "2018-08-15"]), | |
("Region", [ | |
"[Montreal](https://en.wikipedia.org/wiki/Montreal)", |
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, clientside_callback, Output, Input | |
app = Dash(__name__) | |
app.layout = html.Div( | |
[ | |
html.Label( | |
[ | |
html.Span("Name: "), | |
dcc.Input(id="name_input", size="4", placeholder="John") |
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, State, ALL, MATCH, ctx | |
import plotly.express as px | |
import dash_bootstrap_components as dbc | |
df = px.data.gapminder() | |
default_column_x = "year" | |
default_column_y = "gdpPercap" | |
app = Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP]) |
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
# Timeline component with icons from dash-mantine-components and DashIconify | |
import dash_mantine_components as dmc | |
from dash import Dash | |
from dash_iconify import DashIconify | |
app = Dash(__name__) | |
def make_icon(icon): |
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
# https://community.plotly.com/t/different-colour-for-each-wrapped-text/64566/6 | |
# Dash DataTable formatting cells with html | |
from dash import Dash, dash_table | |
import pandas as pd | |
data = dict( | |
[ | |
("Date",["2015-01-01", "2015-10-24","2016-05-10"]), | |
("values", ["1\n1.2\n1.3", "2\n2.2\n2.3", "3\n3.2\n3.3"]), |
NewerOlder