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
# Plotly's Figure Friday challenge. See more info here: https://community.plotly.com/t/figure-friday-2024-week-52/89593 | |
import pandas as pd | |
from dash import Dash, dcc, Input, Output, State, callback, _dash_renderer, ctx | |
import dash_mantine_components as dmc | |
import dash_ag_grid as dag | |
import plotly.express as px | |
_dash_renderer._set_react_version("18.2.0") | |
dmc.add_figure_templates(default="mantine_dark") |
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 fastapi import FastAPI, Request | |
from pydantic import BaseModel | |
from typing import List, Dict, Any, Union, Optional | |
from dash import Dash, html, Input, Output, ctx, set_props | |
import dash | |
from flask import Flask, has_request_context | |
import flask | |
from flask.testing import EnvironBuilder | |
from werkzeug.datastructures import Headers |
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
# Plotly's Figure Friday challenge. See more info here: https://community.plotly.com/t/figure-friday-2024-week-32/86401 | |
import dash | |
import pandas as pd | |
from dash import Dash, html, dcc, Input, Output, State, callback, Patch | |
import dash_bootstrap_components as dbc | |
import dash_ag_grid as dag | |
import plotly.graph_objects as go | |
app = Dash(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
# Plotly's Figure Friday challenge. See more info here: https://community.plotly.com/t/figure-friday-2024-week-28/84980 | |
import pandas as pd | |
import plotly.express as px | |
from dash import Dash, html, dcc, Input, Output | |
import dash_bootstrap_components as dbc | |
import dash_ag_grid as dag | |
import plotly | |
df = pd.read_excel( |
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 |
NewerOlder