Spaces:
Running
Running
Update version
Browse files- README.md +4 -4
- app.py +1 -1
- chart_groups.py +0 -2
- pages/_factories.py +1 -1
- pages/_pages_utils.py +3 -0
- pages/examples/bubble_map.py +25 -0
- pages/examples/dot_map.py +23 -0
- pages/spatial.py +77 -2
- pages/time.py +1 -1
- requirements.in +6 -0
- requirements.txt +121 -2
README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
---
|
2 |
title: Visual Vocabulary
|
3 |
-
emoji:
|
4 |
colorFrom: blue
|
5 |
-
colorTo:
|
6 |
sdk: docker
|
7 |
pinned: false
|
8 |
license: apache-2.0
|
@@ -45,7 +45,7 @@ The dashboard is still in development. Below is an overview of the chart types f
|
|
45 |
| Beeswarm | β | Distribution |
|
46 |
| Boxplot | β
| Distribution |
|
47 |
| Bubble | β
| Correlation |
|
48 |
-
| Bubble map |
|
49 |
| Bubble timeline | β | Time |
|
50 |
| Bullet | β | Magnitude |
|
51 |
| Bump | β | Ranking |
|
@@ -59,7 +59,7 @@ The dashboard is still in development. Below is an overview of the chart types f
|
|
59 |
| Diverging bar | β | Deviation |
|
60 |
| Diverging stacked bar | β | Deviation |
|
61 |
| Donut | β
| Part-to-whole |
|
62 |
-
| Dot map |
|
63 |
| Dot plot | β | Distribution |
|
64 |
| Fan | β | Time |
|
65 |
| Flow map | β | Spatial |
|
|
|
1 |
---
|
2 |
title: Visual Vocabulary
|
3 |
+
emoji: π¨
|
4 |
colorFrom: blue
|
5 |
+
colorTo: purple
|
6 |
sdk: docker
|
7 |
pinned: false
|
8 |
license: apache-2.0
|
|
|
45 |
| Beeswarm | β | Distribution |
|
46 |
| Boxplot | β
| Distribution |
|
47 |
| Bubble | β
| Correlation |
|
48 |
+
| Bubble map | β
| Spatial |
|
49 |
| Bubble timeline | β | Time |
|
50 |
| Bullet | β | Magnitude |
|
51 |
| Bump | β | Ranking |
|
|
|
59 |
| Diverging bar | β | Deviation |
|
60 |
| Diverging stacked bar | β | Deviation |
|
61 |
| Donut | β
| Part-to-whole |
|
62 |
+
| Dot map | β
| Spatial |
|
63 |
| Dot plot | β | Distribution |
|
64 |
| Fan | β | Time |
|
65 |
| Flow map | β | Spatial |
|
app.py
CHANGED
@@ -110,5 +110,5 @@ dashboard = vm.Dashboard(
|
|
110 |
app = Vizro().build(dashboard)
|
111 |
server = app.dash.server
|
112 |
|
113 |
-
if __name__ == "__main__":
|
114 |
app.run()
|
|
|
110 |
app = Vizro().build(dashboard)
|
111 |
server = app.dash.server
|
112 |
|
113 |
+
if __name__ == "__main__":
|
114 |
app.run()
|
chart_groups.py
CHANGED
@@ -198,9 +198,7 @@ spatial_chart_group = ChartGroup(
|
|
198 |
name="Spatial",
|
199 |
pages=pages.spatial.pages,
|
200 |
incomplete_pages=[
|
201 |
-
IncompletePage("Dot map"),
|
202 |
IncompletePage("Flow map"),
|
203 |
-
IncompletePage("Bubble map"),
|
204 |
],
|
205 |
icon="Map",
|
206 |
intro_text=spatial_intro_text,
|
|
|
198 |
name="Spatial",
|
199 |
pages=pages.spatial.pages,
|
200 |
incomplete_pages=[
|
|
|
201 |
IncompletePage("Flow map"),
|
|
|
202 |
],
|
203 |
icon="Map",
|
204 |
intro_text=spatial_intro_text,
|
pages/_factories.py
CHANGED
@@ -33,7 +33,7 @@ def butterfly_factory(group: str):
|
|
33 |
|
34 |
Use a butterfly chart when you wish to emphasize the comparison between two data sets sharing the same
|
35 |
parameters. Sharing this chart with your audience will help them see at a glance how two groups differ
|
36 |
-
within the same parameters. You can also **stack** two bars on each side
|
37 |
categories.
|
38 |
"""
|
39 |
),
|
|
|
33 |
|
34 |
Use a butterfly chart when you wish to emphasize the comparison between two data sets sharing the same
|
35 |
parameters. Sharing this chart with your audience will help them see at a glance how two groups differ
|
36 |
+
within the same parameters. You can also **stack** two bars on each side to divide your
|
37 |
categories.
|
38 |
"""
|
39 |
),
|
pages/_pages_utils.py
CHANGED
@@ -55,3 +55,6 @@ stepped_line_data = pd.DataFrame(
|
|
55 |
"rate": [0.10, 0.12, 0.15, 0.13, 0.14, 0.13, 0.14, 0.16, 0.15],
|
56 |
}
|
57 |
)
|
|
|
|
|
|
|
|
55 |
"rate": [0.10, 0.12, 0.15, 0.13, 0.14, 0.13, 0.14, 0.16, 0.15],
|
56 |
}
|
57 |
)
|
58 |
+
|
59 |
+
|
60 |
+
carshare = px.data.carshare()
|
pages/examples/bubble_map.py
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import vizro.models as vm
|
2 |
+
import vizro.plotly.express as px
|
3 |
+
from vizro import Vizro
|
4 |
+
|
5 |
+
carshare = px.data.carshare()
|
6 |
+
|
7 |
+
page = vm.Page(
|
8 |
+
title="Bubble map",
|
9 |
+
components=[
|
10 |
+
vm.Graph(
|
11 |
+
figure=px.scatter_map(
|
12 |
+
carshare,
|
13 |
+
lat="centroid_lat",
|
14 |
+
lon="centroid_lon",
|
15 |
+
size="car_hours",
|
16 |
+
size_max=15,
|
17 |
+
opacity=0.5,
|
18 |
+
zoom=10,
|
19 |
+
)
|
20 |
+
)
|
21 |
+
],
|
22 |
+
)
|
23 |
+
|
24 |
+
dashboard = vm.Dashboard(pages=[page])
|
25 |
+
Vizro().build(dashboard).run()
|
pages/examples/dot_map.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import vizro.models as vm
|
2 |
+
import vizro.plotly.express as px
|
3 |
+
from vizro import Vizro
|
4 |
+
|
5 |
+
carshare = px.data.carshare()
|
6 |
+
|
7 |
+
page = vm.Page(
|
8 |
+
title="Dot map",
|
9 |
+
components=[
|
10 |
+
vm.Graph(
|
11 |
+
figure=px.scatter_map(
|
12 |
+
carshare,
|
13 |
+
lat="centroid_lat",
|
14 |
+
lon="centroid_lon",
|
15 |
+
opacity=0.5,
|
16 |
+
zoom=10,
|
17 |
+
)
|
18 |
+
)
|
19 |
+
],
|
20 |
+
)
|
21 |
+
|
22 |
+
dashboard = vm.Dashboard(pages=[page])
|
23 |
+
Vizro().build(dashboard).run()
|
pages/spatial.py
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
import vizro.models as vm
|
4 |
import vizro.plotly.express as px
|
5 |
|
6 |
-
from pages._pages_utils import PAGE_GRID, gapminder, make_code_clipboard_from_py_file
|
7 |
|
8 |
choropleth = vm.Page(
|
9 |
title="Choropleth",
|
@@ -42,4 +42,79 @@ choropleth = vm.Page(
|
|
42 |
],
|
43 |
)
|
44 |
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
import vizro.models as vm
|
4 |
import vizro.plotly.express as px
|
5 |
|
6 |
+
from pages._pages_utils import PAGE_GRID, carshare, gapminder, make_code_clipboard_from_py_file
|
7 |
|
8 |
choropleth = vm.Page(
|
9 |
title="Choropleth",
|
|
|
42 |
],
|
43 |
)
|
44 |
|
45 |
+
dot_map = vm.Page(
|
46 |
+
title="Dot map",
|
47 |
+
path="spatial/dot-map",
|
48 |
+
layout=vm.Layout(grid=PAGE_GRID),
|
49 |
+
components=[
|
50 |
+
vm.Card(
|
51 |
+
text="""
|
52 |
+
#### What is a dot map?
|
53 |
+
|
54 |
+
A dot map, or scatter map, uses dots to represent the value of a specific variable at geographic locations.
|
55 |
+
|
56 |
+
|
57 |
+
|
58 |
+
#### When should I use it?
|
59 |
+
|
60 |
+
Use a dot map to visually display the distribution and concentration of data points across a geographic
|
61 |
+
area. It's ideal for showing the frequency or density of an attribute, helping to identify patterns,
|
62 |
+
clusters, or anomalies.
|
63 |
+
|
64 |
+
Dot maps offer a clear visual impression of spatial distributions, but overlapping dots can make it hard to
|
65 |
+
distinguish individual data points in dense areas. Consider adding opacity to your dots to improve clarity.
|
66 |
+
"""
|
67 |
+
),
|
68 |
+
vm.Graph(
|
69 |
+
figure=px.scatter_map(
|
70 |
+
carshare,
|
71 |
+
lat="centroid_lat",
|
72 |
+
lon="centroid_lon",
|
73 |
+
opacity=0.5,
|
74 |
+
zoom=10,
|
75 |
+
),
|
76 |
+
),
|
77 |
+
make_code_clipboard_from_py_file("dot_map.py"),
|
78 |
+
],
|
79 |
+
)
|
80 |
+
|
81 |
+
bubble_map = vm.Page(
|
82 |
+
title="Bubble map",
|
83 |
+
path="spatial/bubble-map",
|
84 |
+
layout=vm.Layout(grid=PAGE_GRID),
|
85 |
+
components=[
|
86 |
+
vm.Card(
|
87 |
+
text="""
|
88 |
+
#### What is a bubble map?
|
89 |
+
|
90 |
+
A bubble map uses bubbles of varying sizes to represent the value of a specific variable at geographic
|
91 |
+
locations.
|
92 |
+
|
93 |
+
|
94 |
+
|
95 |
+
#### When should I use it?
|
96 |
+
|
97 |
+
Use a bubble map to show the distribution, concentration, and size of data points on a map.
|
98 |
+
It's great for highlighting patterns, clusters, and anomalies.
|
99 |
+
|
100 |
+
Bubble maps clearly display spatial distributions and magnitudes, but overlapping bubbles can obscure
|
101 |
+
details in crowded areas. Adjust the opacity and size of your bubbles to enhance clarity.
|
102 |
+
"""
|
103 |
+
),
|
104 |
+
vm.Graph(
|
105 |
+
figure=px.scatter_map(
|
106 |
+
carshare,
|
107 |
+
lat="centroid_lat",
|
108 |
+
lon="centroid_lon",
|
109 |
+
size="car_hours",
|
110 |
+
size_max=15,
|
111 |
+
opacity=0.5,
|
112 |
+
zoom=10,
|
113 |
+
),
|
114 |
+
),
|
115 |
+
make_code_clipboard_from_py_file("bubble_map.py"),
|
116 |
+
],
|
117 |
+
)
|
118 |
+
|
119 |
+
|
120 |
+
pages = [choropleth, dot_map, bubble_map]
|
pages/time.py
CHANGED
@@ -26,7 +26,7 @@ line = vm.Page(
|
|
26 |
|
27 |
You should select a line chart when you want to show trends over time. Usually, your y-axis will show a
|
28 |
quantitative value and your x-axis will be marked as a timescale or a sequence of intervals. You can also
|
29 |
-
display negative values below the x-axis.
|
30 |
same chart, try to limit yourself to 3-4 to avoid cluttering up your chart.
|
31 |
"""
|
32 |
),
|
|
|
26 |
|
27 |
You should select a line chart when you want to show trends over time. Usually, your y-axis will show a
|
28 |
quantitative value and your x-axis will be marked as a timescale or a sequence of intervals. You can also
|
29 |
+
display negative values below the x-axis. To group several lines (different data series) in the
|
30 |
same chart, try to limit yourself to 3-4 to avoid cluttering up your chart.
|
31 |
"""
|
32 |
),
|
requirements.in
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# This file is only used if you don't have hatch installed.
|
2 |
+
# It should be fully generated and used when the demo moves to huggingface.
|
3 |
+
black==24.4.2
|
4 |
+
plotly>=5.24.0
|
5 |
+
vizro
|
6 |
+
gunicorn
|
requirements.txt
CHANGED
@@ -1,3 +1,122 @@
|
|
|
|
|
|
|
|
|
|
1 |
black==24.4.2
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# This file was autogenerated by uv via the following command:
|
2 |
+
# uv pip compile requirements.in -o requirements.txt
|
3 |
+
annotated-types==0.7.0
|
4 |
+
# via pydantic
|
5 |
black==24.4.2
|
6 |
+
# via -r requirements.in
|
7 |
+
blinker==1.8.2
|
8 |
+
# via flask
|
9 |
+
cachelib==0.9.0
|
10 |
+
# via flask-caching
|
11 |
+
certifi==2024.8.30
|
12 |
+
# via requests
|
13 |
+
charset-normalizer==3.3.2
|
14 |
+
# via requests
|
15 |
+
click==8.1.7
|
16 |
+
# via
|
17 |
+
# black
|
18 |
+
# flask
|
19 |
+
dash==2.18.0
|
20 |
+
# via
|
21 |
+
# dash-ag-grid
|
22 |
+
# dash-bootstrap-components
|
23 |
+
# vizro
|
24 |
+
dash-ag-grid==31.2.0
|
25 |
+
# via vizro
|
26 |
+
dash-bootstrap-components==1.6.0
|
27 |
+
# via vizro
|
28 |
+
dash-core-components==2.0.0
|
29 |
+
# via dash
|
30 |
+
dash-html-components==2.0.0
|
31 |
+
# via dash
|
32 |
+
dash-mantine-components==0.12.1
|
33 |
+
# via vizro
|
34 |
+
dash-table==5.0.0
|
35 |
+
# via dash
|
36 |
+
flask==3.0.3
|
37 |
+
# via
|
38 |
+
# dash
|
39 |
+
# flask-caching
|
40 |
+
flask-caching==2.3.0
|
41 |
+
# via vizro
|
42 |
+
gunicorn==23.0.0
|
43 |
+
# via -r requirements.in
|
44 |
+
idna==3.8
|
45 |
+
# via requests
|
46 |
+
importlib-metadata==8.4.0
|
47 |
+
# via
|
48 |
+
# dash
|
49 |
+
# flask
|
50 |
+
itsdangerous==2.2.0
|
51 |
+
# via flask
|
52 |
+
jinja2==3.1.4
|
53 |
+
# via flask
|
54 |
+
markupsafe==2.1.5
|
55 |
+
# via
|
56 |
+
# jinja2
|
57 |
+
# werkzeug
|
58 |
+
mypy-extensions==1.0.0
|
59 |
+
# via black
|
60 |
+
nest-asyncio==1.6.0
|
61 |
+
# via dash
|
62 |
+
numpy==2.0.2
|
63 |
+
# via pandas
|
64 |
+
packaging==24.1
|
65 |
+
# via
|
66 |
+
# black
|
67 |
+
# gunicorn
|
68 |
+
# plotly
|
69 |
+
pandas==2.2.2
|
70 |
+
# via vizro
|
71 |
+
pathspec==0.12.1
|
72 |
+
# via black
|
73 |
+
platformdirs==4.2.2
|
74 |
+
# via black
|
75 |
+
plotly==5.24.0
|
76 |
+
# via
|
77 |
+
# -r requirements.in
|
78 |
+
# dash
|
79 |
+
pydantic==2.8.2
|
80 |
+
# via vizro
|
81 |
+
pydantic-core==2.20.1
|
82 |
+
# via pydantic
|
83 |
+
python-dateutil==2.9.0.post0
|
84 |
+
# via pandas
|
85 |
+
pytz==2024.1
|
86 |
+
# via pandas
|
87 |
+
requests==2.32.3
|
88 |
+
# via dash
|
89 |
+
retrying==1.3.4
|
90 |
+
# via dash
|
91 |
+
ruff==0.6.3
|
92 |
+
# via vizro
|
93 |
+
setuptools==74.1.2
|
94 |
+
# via dash
|
95 |
+
six==1.16.0
|
96 |
+
# via
|
97 |
+
# python-dateutil
|
98 |
+
# retrying
|
99 |
+
tenacity==9.0.0
|
100 |
+
# via plotly
|
101 |
+
tomli==2.0.1
|
102 |
+
# via black
|
103 |
+
typing-extensions==4.12.2
|
104 |
+
# via
|
105 |
+
# black
|
106 |
+
# dash
|
107 |
+
# pydantic
|
108 |
+
# pydantic-core
|
109 |
+
tzdata==2024.1
|
110 |
+
# via pandas
|
111 |
+
urllib3==2.2.2
|
112 |
+
# via requests
|
113 |
+
vizro==0.1.21
|
114 |
+
# via -r requirements.in
|
115 |
+
werkzeug==3.0.4
|
116 |
+
# via
|
117 |
+
# dash
|
118 |
+
# flask
|
119 |
+
wrapt==1.16.0
|
120 |
+
# via vizro
|
121 |
+
zipp==3.20.1
|
122 |
+
# via importlib-metadata
|