Spaces:
Running
Running
File size: 4,398 Bytes
42ee455 b699ae9 42ee455 b699ae9 42ee455 b699ae9 42ee455 b699ae9 22b0b94 b699ae9 22b0b94 b699ae9 22b0b94 b699ae9 22b0b94 b699ae9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
"""Spatial charts."""
import vizro.models as vm
from pages._pages_utils import PAGE_GRID, make_code_clipboard_from_py_file
from pages.examples import bubble_map, choropleth, dot_map
choropleth_page = vm.Page(
title="Choropleth",
path="spatial/choropleth",
layout=vm.Layout(grid=PAGE_GRID),
components=[
vm.Card(
text="""
#### What is a choropleth map?
A choropleth map is a map in which geographical areas are colored, shaded or patterned in relation to a
specific data variable.
#### When should I use it?
Use a chloropleth map when you wish to show how a measurement varies across a geographic area, or to show
variability or patterns within a region. Typically, you will blend one color into another, take a color
shade from light to dark, or introduce patterns to depict the variation in the data.
Be aware that it may be difficult for your audience to accurately read or compare values on the map
depicted by color.
"""
),
vm.Graph(figure=choropleth.fig),
vm.Tabs(
tabs=[
vm.Container(
title="Vizro dashboard",
components=[make_code_clipboard_from_py_file("choropleth.py", mode="vizro")],
),
vm.Container(
title="Plotly figure",
components=[make_code_clipboard_from_py_file("choropleth.py", mode="plotly")],
),
]
),
],
)
dot_map_page = vm.Page(
title="Dot map",
path="spatial/dot-map",
layout=vm.Layout(grid=PAGE_GRID),
components=[
vm.Card(
text="""
#### What is a dot map?
A dot map, or scatter map, uses dots to represent the value of a specific variable at geographic locations.
#### When should I use it?
Use a dot map to visually display the distribution and concentration of data points across a geographic
area. It's ideal for showing the frequency or density of an attribute, helping to identify patterns,
clusters, or anomalies.
Dot maps offer a clear visual impression of spatial distributions, but overlapping dots can make it hard to
distinguish individual data points in dense areas. Consider adding opacity to your dots to improve clarity.
"""
),
vm.Graph(
figure=dot_map.fig,
),
vm.Tabs(
tabs=[
vm.Container(
title="Vizro dashboard", components=[make_code_clipboard_from_py_file("dot_map.py", mode="vizro")]
),
vm.Container(
title="Plotly figure",
components=[make_code_clipboard_from_py_file("dot_map.py", mode="plotly")],
),
]
),
],
)
bubble_map_page = vm.Page(
title="Bubble map",
path="spatial/bubble-map",
layout=vm.Layout(grid=PAGE_GRID),
components=[
vm.Card(
text="""
#### What is a bubble map?
A bubble map uses bubbles of varying sizes to represent the value of a specific variable at geographic
locations.
#### When should I use it?
Use a bubble map to show the distribution, concentration, and size of data points on a map.
It's great for highlighting patterns, clusters, and anomalies.
Bubble maps clearly display spatial distributions and magnitudes, but overlapping bubbles can obscure
details in crowded areas. Adjust the opacity and size of your bubbles to enhance clarity.
"""
),
vm.Graph(figure=bubble_map.fig),
vm.Tabs(
tabs=[
vm.Container(
title="Vizro dashboard",
components=[make_code_clipboard_from_py_file("bubble_map.py", mode="vizro")],
),
vm.Container(
title="Plotly figure",
components=[make_code_clipboard_from_py_file("bubble_map.py", mode="plotly")],
),
]
),
],
)
pages = [choropleth_page, dot_map_page, bubble_map_page]
|