Li Nguyen commited on
Commit
64e7b89
·
1 Parent(s): 88f1954

Update demo

Browse files
app.py CHANGED
@@ -5,7 +5,6 @@ from typing import Union
5
  import dash_bootstrap_components as dbc
6
  import vizro.models as vm
7
  from chart_groups import ALL_CHART_GROUP, CHART_GROUPS, ChartGroup, IncompletePage
8
- from custom_components import FlexContainer, Markdown
9
  from dash import get_asset_url, html
10
  from vizro import Vizro
11
 
@@ -46,10 +45,11 @@ def make_homepage_container(chart_group: ChartGroup) -> vm.Container:
46
  # deviation-butterfly, which both have title "Butterfly", correspond to a single card.
47
  return vm.Container(
48
  title=chart_group.name,
49
- layout=vm.Layout(grid=[[0, 1, 1]], col_gap="40px"),
50
  components=[
51
- Markdown(text=chart_group.intro_text, classname="intro-text"),
52
- FlexContainer(
 
53
  components=[
54
  make_chart_card(page)
55
  for page in sorted(
@@ -115,7 +115,7 @@ app.dash.layout.children.append(
115
  ["Made with ", html.Img(src=get_asset_url("logo.svg"), id="banner", alt="Vizro logo"), "vizro"],
116
  href="https://github.com/mckinsey/vizro",
117
  target="_blank",
118
- className="anchor-container",
119
  )
120
  )
121
 
 
5
  import dash_bootstrap_components as dbc
6
  import vizro.models as vm
7
  from chart_groups import ALL_CHART_GROUP, CHART_GROUPS, ChartGroup, IncompletePage
 
8
  from dash import get_asset_url, html
9
  from vizro import Vizro
10
 
 
45
  # deviation-butterfly, which both have title "Butterfly", correspond to a single card.
46
  return vm.Container(
47
  title=chart_group.name,
48
+ layout=vm.Grid(grid=[[0, 1, 1]], col_gap="40px"),
49
  components=[
50
+ vm.Text(text=chart_group.intro_text, extra={"className": "intro-text"}),
51
+ vm.Container(
52
+ layout=vm.Flex(direction="row", wrap=True),
53
  components=[
54
  make_chart_card(page)
55
  for page in sorted(
 
115
  ["Made with ", html.Img(src=get_asset_url("logo.svg"), id="banner", alt="Vizro logo"), "vizro"],
116
  href="https://github.com/mckinsey/vizro",
117
  target="_blank",
118
+ class_name="anchor-container",
119
  )
120
  )
121
 
assets/css/custom.css CHANGED
@@ -1,73 +1,43 @@
1
- #page-header {
2
- padding-left: 8px;
3
- }
4
-
5
- #left-main {
6
- width: 288px;
7
  }
8
 
9
  img[src*="#chart-icon"] {
10
  width: 100%;
11
  }
12
 
13
- .open-in-new {
 
14
  font-size: inherit;
15
  margin-left: 4px;
16
- vertical-align: middle;
17
  }
18
 
19
- .code-clipboard {
20
- float: right;
21
- font-size: 20px;
22
- }
23
-
24
- .code-clipboard pre {
25
- font-family: monospace;
26
- margin-bottom: 12px;
27
- }
28
 
29
  .code-clipboard-container {
30
- background: var(--surfaces-bg-card);
31
- max-height: 500px;
32
- overflow: auto;
33
- padding: 1rem;
34
- position: relative;
35
- }
36
-
37
- .code-clipboard-container .pycafe-link {
38
- margin-bottom: 12px;
39
- }
40
-
41
- .code-clipboard-container::-webkit-scrollbar-thumb {
42
- border-color: var(--surfaces-bg-card);
43
- }
44
-
45
- .flex-container {
46
  display: flex;
47
- flex-wrap: wrap;
48
- gap: 24px;
49
- justify-content: flex-start;
50
  }
51
 
52
- .flex-container h4 {
53
  color: var(--text-secondary);
54
  margin: 0;
55
  padding-top: 12px;
56
  text-align: center;
57
  }
58
 
59
- .flex-container .card {
60
  height: 232px;
61
  margin: 0 0 auto;
62
  opacity: 0.3;
63
  width: 176px;
64
  }
65
 
66
- .flex-container .card-nav {
67
  opacity: 1;
68
  }
69
 
70
- .flex-container .card img {
71
  width: 100%;
72
  }
73
 
@@ -78,6 +48,7 @@ img[src*="#chart-icon"] {
78
 
79
  .intro-text h4 {
80
  color: var(--text-secondary);
 
81
  }
82
 
83
  .intro-text p {
@@ -113,3 +84,7 @@ img[src*="#chart-icon"] {
113
  img#banner {
114
  height: 16px;
115
  }
 
 
 
 
 
1
+ #header {
2
+ padding-left: 4px;
 
 
 
 
3
  }
4
 
5
  img[src*="#chart-icon"] {
6
  width: 100%;
7
  }
8
 
9
+ /* PyCafe Link Button Icon */
10
+ .material-symbols-outlined .open-in-new {
11
  font-size: inherit;
12
  margin-left: 4px;
 
13
  }
14
 
 
 
 
 
 
 
 
 
 
15
 
16
  .code-clipboard-container {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  display: flex;
18
+ flex-direction: column;
19
+ gap: 12px;
 
20
  }
21
 
22
+ .flex-item h4 {
23
  color: var(--text-secondary);
24
  margin: 0;
25
  padding-top: 12px;
26
  text-align: center;
27
  }
28
 
29
+ .flex-item .card {
30
  height: 232px;
31
  margin: 0 0 auto;
32
  opacity: 0.3;
33
  width: 176px;
34
  }
35
 
36
+ .flex-item .card-nav {
37
  opacity: 1;
38
  }
39
 
40
+ .flex-item .card img {
41
  width: 100%;
42
  }
43
 
 
48
 
49
  .intro-text h4 {
50
  color: var(--text-secondary);
51
+ margin: 0;
52
  }
53
 
54
  .intro-text p {
 
84
  img#banner {
85
  height: 16px;
86
  }
87
+
88
+ .mantine-CodeHighlight-controls {
89
+ background: transparent;
90
+ }
custom_components.py CHANGED
@@ -4,23 +4,21 @@ from typing import Literal
4
  from urllib.parse import quote
5
 
6
  import dash_bootstrap_components as dbc
 
7
  import vizro.models as vm
8
- from dash import dcc, html
9
- from pydantic import Field
10
 
11
 
12
  class CodeClipboard(vm.VizroBaseModel):
13
- """Code snippet with a copy to clipboard button."""
14
 
15
  type: Literal["code_clipboard"] = "code_clipboard"
16
  code: str
17
  mode: Literal["vizro", "plotly"]
18
- language: str = ""
19
 
20
  def build(self):
21
- """Returns the code clipboard component inside an accordion."""
22
- markdown_code = "\n".join([f"```{self.language}", self.code, "```"])
23
-
24
  pycafe_link = dbc.Button(
25
  [
26
  "Edit code live on PyCafe",
@@ -28,48 +26,19 @@ class CodeClipboard(vm.VizroBaseModel):
28
  ],
29
  href=f"https://py.cafe/snippet/vizro/v1#code={quote(self.code)}",
30
  target="_blank",
31
- className="pycafe-link",
32
  )
33
 
34
  return html.Div(
35
  [
36
  pycafe_link if self.mode == "vizro" else None,
37
- dcc.Clipboard(target_id=self.id, className="code-clipboard"),
38
- dcc.Markdown(markdown_code, id=self.id),
 
 
39
  ],
40
  className="code-clipboard-container",
41
  )
42
 
43
 
44
- class Markdown(vm.VizroBaseModel):
45
- """Markdown component."""
46
-
47
- type: Literal["markdown"] = "markdown"
48
- text: str = Field(
49
- ..., description="Markdown string to create card title/text that should adhere to the CommonMark Spec."
50
- )
51
- classname: str = ""
52
-
53
- def build(self):
54
- """Returns a markdown component with an optional classname."""
55
- return dcc.Markdown(
56
- id=self.id, children=self.text, dangerously_allow_html=False, className=self.classname, link_target="_blank"
57
- )
58
-
59
-
60
- class FlexContainer(vm.Container):
61
- """Custom flex `Container`."""
62
-
63
- type: Literal["flex_container"] = "flex_container"
64
- title: str = None # Title exists in vm.Container but we don't want to use it here.
65
-
66
- def build(self):
67
- """Returns a flex container."""
68
- return html.Div(
69
- id=self.id, children=[component.build() for component in self.components], className="flex-container"
70
- )
71
-
72
-
73
- vm.Container.add_type("components", FlexContainer)
74
- vm.Container.add_type("components", Markdown)
75
  vm.Container.add_type("components", CodeClipboard)
 
4
  from urllib.parse import quote
5
 
6
  import dash_bootstrap_components as dbc
7
+ import dash_mantine_components as dmc
8
  import vizro.models as vm
9
+ from dash import html
 
10
 
11
 
12
  class CodeClipboard(vm.VizroBaseModel):
13
+ """Code clipboard based on `dmc.CodeHighlight` with optional PyCafe link."""
14
 
15
  type: Literal["code_clipboard"] = "code_clipboard"
16
  code: str
17
  mode: Literal["vizro", "plotly"]
18
+ language: str = "python"
19
 
20
  def build(self):
21
+ """Build and return the complete code clipboard component."""
 
 
22
  pycafe_link = dbc.Button(
23
  [
24
  "Edit code live on PyCafe",
 
26
  ],
27
  href=f"https://py.cafe/snippet/vizro/v1#code={quote(self.code)}",
28
  target="_blank",
29
+ class_name="pycafe-link",
30
  )
31
 
32
  return html.Div(
33
  [
34
  pycafe_link if self.mode == "vizro" else None,
35
+ dmc.CodeHighlight(
36
+ code=self.code,
37
+ language=self.language,
38
+ ),
39
  ],
40
  className="code-clipboard-container",
41
  )
42
 
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  vm.Container.add_type("components", CodeClipboard)
pages/_factories.py CHANGED
@@ -16,7 +16,7 @@ def butterfly_factory(group: str):
16
  id=f"{group}-butterfly",
17
  path=f"{group}/butterfly",
18
  title="Butterfly",
19
- layout=vm.Layout(grid=PAGE_GRID),
20
  components=[
21
  vm.Card(
22
  text="""
@@ -59,7 +59,7 @@ def connected_scatter_factory(group: str):
59
  id=f"{group}-connected-scatter",
60
  path=f"{group}/connected-scatter",
61
  title="Connected scatter",
62
- layout=vm.Layout(grid=PAGE_GRID),
63
  components=[
64
  vm.Card(
65
  text="""
@@ -102,7 +102,7 @@ def column_and_line_factory(group: str):
102
  id=f"{group}-column-and-line",
103
  path=f"{group}/column-and-line",
104
  title="Column and line",
105
- layout=vm.Layout(grid=PAGE_GRID),
106
  components=[
107
  vm.Card(
108
  text="""
@@ -143,7 +143,7 @@ def waterfall_factory(group: str):
143
  id=f"{group}-waterfall",
144
  path=f"{group}/waterfall",
145
  title="Waterfall",
146
- layout=vm.Layout(grid=PAGE_GRID),
147
  components=[
148
  vm.Card(
149
  text="""
@@ -187,7 +187,7 @@ def lollipop_factory(group: str):
187
  id=f"{group}-lollipop",
188
  path=f"{group}/lollipop",
189
  title="Lollipop",
190
- layout=vm.Layout(grid=PAGE_GRID),
191
  components=[
192
  vm.Card(
193
  text="""
 
16
  id=f"{group}-butterfly",
17
  path=f"{group}/butterfly",
18
  title="Butterfly",
19
+ layout=vm.Grid(grid=PAGE_GRID),
20
  components=[
21
  vm.Card(
22
  text="""
 
59
  id=f"{group}-connected-scatter",
60
  path=f"{group}/connected-scatter",
61
  title="Connected scatter",
62
+ layout=vm.Grid(grid=PAGE_GRID),
63
  components=[
64
  vm.Card(
65
  text="""
 
102
  id=f"{group}-column-and-line",
103
  path=f"{group}/column-and-line",
104
  title="Column and line",
105
+ layout=vm.Grid(grid=PAGE_GRID),
106
  components=[
107
  vm.Card(
108
  text="""
 
143
  id=f"{group}-waterfall",
144
  path=f"{group}/waterfall",
145
  title="Waterfall",
146
+ layout=vm.Grid(grid=PAGE_GRID),
147
  components=[
148
  vm.Card(
149
  text="""
 
187
  id=f"{group}-lollipop",
188
  path=f"{group}/lollipop",
189
  title="Lollipop",
190
+ layout=vm.Grid(grid=PAGE_GRID),
191
  components=[
192
  vm.Card(
193
  text="""
pages/correlation.py CHANGED
@@ -9,7 +9,7 @@ from pages.examples import bubble, scatter, scatter_matrix
9
  scatter_page = vm.Page(
10
  title="Scatter",
11
  path="correlation/scatter",
12
- layout=vm.Layout(grid=PAGE_GRID),
13
  components=[
14
  vm.Card(
15
  text="""
@@ -49,7 +49,7 @@ connected_scatter_page = connected_scatter_factory("correlation")
49
  scatter_matrix_page = vm.Page(
50
  title="Scatter matrix",
51
  path="correlation/scatter-matrix",
52
- layout=vm.Layout(grid=PAGE_GRID),
53
  components=[
54
  vm.Card(
55
  text="""
@@ -89,7 +89,7 @@ scatter_matrix_page = vm.Page(
89
  bubble_page = vm.Page(
90
  title="Bubble",
91
  path="correlation/bubble",
92
- layout=vm.Layout(grid=PAGE_GRID),
93
  components=[
94
  vm.Card(
95
  text="""
 
9
  scatter_page = vm.Page(
10
  title="Scatter",
11
  path="correlation/scatter",
12
+ layout=vm.Grid(grid=PAGE_GRID),
13
  components=[
14
  vm.Card(
15
  text="""
 
49
  scatter_matrix_page = vm.Page(
50
  title="Scatter matrix",
51
  path="correlation/scatter-matrix",
52
+ layout=vm.Grid(grid=PAGE_GRID),
53
  components=[
54
  vm.Card(
55
  text="""
 
89
  bubble_page = vm.Page(
90
  title="Bubble",
91
  path="correlation/bubble",
92
+ layout=vm.Grid(grid=PAGE_GRID),
93
  components=[
94
  vm.Card(
95
  text="""
pages/deviation.py CHANGED
@@ -12,7 +12,7 @@ butterfly_page = butterfly_factory("deviation")
12
  diverging_bar_page = vm.Page(
13
  title="Diverging bar",
14
  path="deviation/diverging-bar",
15
- layout=vm.Layout(grid=PAGE_GRID),
16
  components=[
17
  vm.Card(
18
  text="""
@@ -54,7 +54,7 @@ diverging_bar_page = vm.Page(
54
  diverging_stacked_bar_page = vm.Page(
55
  title="Diverging stacked bar",
56
  path="deviation/diverging-stacked-bar",
57
- layout=vm.Layout(grid=PAGE_GRID),
58
  components=[
59
  vm.Card(
60
  text="""
 
12
  diverging_bar_page = vm.Page(
13
  title="Diverging bar",
14
  path="deviation/diverging-bar",
15
+ layout=vm.Grid(grid=PAGE_GRID),
16
  components=[
17
  vm.Card(
18
  text="""
 
54
  diverging_stacked_bar_page = vm.Page(
55
  title="Diverging stacked bar",
56
  path="deviation/diverging-stacked-bar",
57
+ layout=vm.Grid(grid=PAGE_GRID),
58
  components=[
59
  vm.Card(
60
  text="""
pages/distribution.py CHANGED
@@ -9,7 +9,7 @@ from pages.examples import boxplot, dumbbell, histogram, violin
9
  violin_page = vm.Page(
10
  title="Violin",
11
  path="distribution/violin",
12
- layout=vm.Layout(grid=PAGE_GRID),
13
  components=[
14
  vm.Card(
15
  text="""
@@ -45,7 +45,7 @@ violin_page = vm.Page(
45
  boxplot_page = vm.Page(
46
  title="Boxplot",
47
  path="distribution/boxplot",
48
- layout=vm.Layout(grid=PAGE_GRID),
49
  components=[
50
  vm.Card(
51
  text="""
@@ -87,7 +87,7 @@ butterfly_page = butterfly_factory("distribution")
87
  histogram_page = vm.Page(
88
  title="Histogram",
89
  path="distribution/histogram",
90
- layout=vm.Layout(grid=PAGE_GRID),
91
  components=[
92
  vm.Card(
93
  text="""
@@ -124,7 +124,7 @@ histogram_page = vm.Page(
124
  dumbbell_page = vm.Page(
125
  title="Dumbbell",
126
  path="distribution/dumbbell",
127
- layout=vm.Layout(grid=PAGE_GRID),
128
  components=[
129
  vm.Card(
130
  text="""
 
9
  violin_page = vm.Page(
10
  title="Violin",
11
  path="distribution/violin",
12
+ layout=vm.Grid(grid=PAGE_GRID),
13
  components=[
14
  vm.Card(
15
  text="""
 
45
  boxplot_page = vm.Page(
46
  title="Boxplot",
47
  path="distribution/boxplot",
48
+ layout=vm.Grid(grid=PAGE_GRID),
49
  components=[
50
  vm.Card(
51
  text="""
 
87
  histogram_page = vm.Page(
88
  title="Histogram",
89
  path="distribution/histogram",
90
+ layout=vm.Grid(grid=PAGE_GRID),
91
  components=[
92
  vm.Card(
93
  text="""
 
124
  dumbbell_page = vm.Page(
125
  title="Dumbbell",
126
  path="distribution/dumbbell",
127
+ layout=vm.Grid(grid=PAGE_GRID),
128
  components=[
129
  vm.Card(
130
  text="""
pages/examples/violin.py CHANGED
@@ -2,4 +2,4 @@ import vizro.plotly.express as px
2
 
3
  tips = px.data.tips()
4
 
5
- fig = px.violin(tips, y="total_bill", x="day", color="day", box=True)
 
2
 
3
  tips = px.data.tips()
4
 
5
+ fig = px.violin(tips, y="tip", x="day", color="day", box=True)
pages/flow.py CHANGED
@@ -9,7 +9,7 @@ from pages.examples import sankey
9
  sankey_page = vm.Page(
10
  title="Sankey",
11
  path="flow/sankey",
12
- layout=vm.Layout(grid=PAGE_GRID),
13
  components=[
14
  vm.Card(
15
  text="""
 
9
  sankey_page = vm.Page(
10
  title="Sankey",
11
  path="flow/sankey",
12
+ layout=vm.Grid(grid=PAGE_GRID),
13
  components=[
14
  vm.Card(
15
  text="""
pages/magnitude.py CHANGED
@@ -9,7 +9,7 @@ from pages.examples import bar, magnitude_column, paired_bar, paired_column, par
9
  bar_page = vm.Page(
10
  title="Bar",
11
  path="magnitude/bar",
12
- layout=vm.Layout(grid=PAGE_GRID),
13
  components=[
14
  vm.Card(
15
  text="""
@@ -50,7 +50,7 @@ column_page = vm.Page(
50
  id="magnitude-column",
51
  path="magnitude/column",
52
  title="Column",
53
- layout=vm.Layout(grid=PAGE_GRID),
54
  components=[
55
  vm.Card(
56
  text="""
@@ -88,7 +88,7 @@ column_page = vm.Page(
88
  paired_bar_page = vm.Page(
89
  title="Paired bar",
90
  path="magnitude/paired-bar",
91
- layout=vm.Layout(grid=PAGE_GRID),
92
  components=[
93
  vm.Card(
94
  text="""
@@ -129,7 +129,7 @@ paired_bar_page = vm.Page(
129
  paired_column_page = vm.Page(
130
  title="Paired column",
131
  path="magnitude/paired-column",
132
- layout=vm.Layout(grid=PAGE_GRID),
133
  components=[
134
  vm.Card(
135
  text="""
@@ -170,7 +170,7 @@ paired_column_page = vm.Page(
170
  parallel_coordinates_page = vm.Page(
171
  path="magnitude/parallel-coordinates ",
172
  title="Parallel coordinates",
173
- layout=vm.Layout(grid=PAGE_GRID),
174
  components=[
175
  vm.Card(
176
  text="""
@@ -209,7 +209,7 @@ parallel_coordinates_page = vm.Page(
209
  radar_page = vm.Page(
210
  path="magnitude/radar",
211
  title="Radar",
212
- layout=vm.Layout(grid=PAGE_GRID),
213
  components=[
214
  vm.Card(
215
  text="""
 
9
  bar_page = vm.Page(
10
  title="Bar",
11
  path="magnitude/bar",
12
+ layout=vm.Grid(grid=PAGE_GRID),
13
  components=[
14
  vm.Card(
15
  text="""
 
50
  id="magnitude-column",
51
  path="magnitude/column",
52
  title="Column",
53
+ layout=vm.Grid(grid=PAGE_GRID),
54
  components=[
55
  vm.Card(
56
  text="""
 
88
  paired_bar_page = vm.Page(
89
  title="Paired bar",
90
  path="magnitude/paired-bar",
91
+ layout=vm.Grid(grid=PAGE_GRID),
92
  components=[
93
  vm.Card(
94
  text="""
 
129
  paired_column_page = vm.Page(
130
  title="Paired column",
131
  path="magnitude/paired-column",
132
+ layout=vm.Grid(grid=PAGE_GRID),
133
  components=[
134
  vm.Card(
135
  text="""
 
170
  parallel_coordinates_page = vm.Page(
171
  path="magnitude/parallel-coordinates ",
172
  title="Parallel coordinates",
173
+ layout=vm.Grid(grid=PAGE_GRID),
174
  components=[
175
  vm.Card(
176
  text="""
 
209
  radar_page = vm.Page(
210
  path="magnitude/radar",
211
  title="Radar",
212
+ layout=vm.Grid(grid=PAGE_GRID),
213
  components=[
214
  vm.Card(
215
  text="""
pages/part_to_whole.py CHANGED
@@ -9,7 +9,7 @@ from pages.examples import donut, funnel, pie, stacked_bar, stacked_column, tree
9
  pie_page = vm.Page(
10
  title="Pie",
11
  path="part-to-whole/pie",
12
- layout=vm.Layout(grid=PAGE_GRID),
13
  components=[
14
  vm.Card(
15
  text="""
@@ -50,7 +50,7 @@ pie_page = vm.Page(
50
  donut_page = vm.Page(
51
  title="Donut",
52
  path="part-to-whole/donut",
53
- layout=vm.Layout(grid=PAGE_GRID),
54
  components=[
55
  vm.Card(
56
  text="""
@@ -87,7 +87,7 @@ donut_page = vm.Page(
87
  treemap_page = vm.Page(
88
  title="Treemap",
89
  path="part-to-whole/treemap",
90
- layout=vm.Layout(grid=PAGE_GRID),
91
  components=[
92
  vm.Card(
93
  text="""
@@ -126,7 +126,7 @@ treemap_page = vm.Page(
126
  stacked_bar_page = vm.Page(
127
  title="Stacked bar",
128
  path="part-to-whole/stacked-bar",
129
- layout=vm.Layout(grid=PAGE_GRID),
130
  components=[
131
  vm.Card(
132
  text="""
@@ -168,7 +168,7 @@ stacked_bar_page = vm.Page(
168
  stacked_column_page = vm.Page(
169
  title="Stacked column",
170
  path="part-to-whole/stacked-column",
171
- layout=vm.Layout(grid=PAGE_GRID),
172
  components=[
173
  vm.Card(
174
  text="""
@@ -210,7 +210,7 @@ stacked_column_page = vm.Page(
210
  funnel_page = vm.Page(
211
  title="Funnel",
212
  path="part-to-whole/funnel",
213
- layout=vm.Layout(grid=PAGE_GRID),
214
  components=[
215
  vm.Card(
216
  text="""
 
9
  pie_page = vm.Page(
10
  title="Pie",
11
  path="part-to-whole/pie",
12
+ layout=vm.Grid(grid=PAGE_GRID),
13
  components=[
14
  vm.Card(
15
  text="""
 
50
  donut_page = vm.Page(
51
  title="Donut",
52
  path="part-to-whole/donut",
53
+ layout=vm.Grid(grid=PAGE_GRID),
54
  components=[
55
  vm.Card(
56
  text="""
 
87
  treemap_page = vm.Page(
88
  title="Treemap",
89
  path="part-to-whole/treemap",
90
+ layout=vm.Grid(grid=PAGE_GRID),
91
  components=[
92
  vm.Card(
93
  text="""
 
126
  stacked_bar_page = vm.Page(
127
  title="Stacked bar",
128
  path="part-to-whole/stacked-bar",
129
+ layout=vm.Grid(grid=PAGE_GRID),
130
  components=[
131
  vm.Card(
132
  text="""
 
168
  stacked_column_page = vm.Page(
169
  title="Stacked column",
170
  path="part-to-whole/stacked-column",
171
+ layout=vm.Grid(grid=PAGE_GRID),
172
  components=[
173
  vm.Card(
174
  text="""
 
210
  funnel_page = vm.Page(
211
  title="Funnel",
212
  path="part-to-whole/funnel",
213
+ layout=vm.Grid(grid=PAGE_GRID),
214
  components=[
215
  vm.Card(
216
  text="""
pages/ranking.py CHANGED
@@ -9,7 +9,7 @@ from pages.examples import ordered_bar, ordered_column
9
  ordered_bar_page = vm.Page(
10
  title="Ordered bar",
11
  path="ranking/ordered-bar",
12
- layout=vm.Layout(grid=PAGE_GRID),
13
  components=[
14
  vm.Card(
15
  text="""
@@ -48,7 +48,7 @@ ordered_bar_page = vm.Page(
48
  ordered_column_page = vm.Page(
49
  title="Ordered column",
50
  path="ranking/ordered-column",
51
- layout=vm.Layout(grid=PAGE_GRID),
52
  components=[
53
  vm.Card(
54
  text="""
 
9
  ordered_bar_page = vm.Page(
10
  title="Ordered bar",
11
  path="ranking/ordered-bar",
12
+ layout=vm.Grid(grid=PAGE_GRID),
13
  components=[
14
  vm.Card(
15
  text="""
 
48
  ordered_column_page = vm.Page(
49
  title="Ordered column",
50
  path="ranking/ordered-column",
51
+ layout=vm.Grid(grid=PAGE_GRID),
52
  components=[
53
  vm.Card(
54
  text="""
pages/spatial.py CHANGED
@@ -8,7 +8,7 @@ from pages.examples import bubble_map, choropleth, dot_map
8
  choropleth_page = vm.Page(
9
  title="Choropleth",
10
  path="spatial/choropleth",
11
- layout=vm.Layout(grid=PAGE_GRID),
12
  components=[
13
  vm.Card(
14
  text="""
@@ -49,7 +49,7 @@ choropleth_page = vm.Page(
49
  dot_map_page = vm.Page(
50
  title="Dot map",
51
  path="spatial/dot-map",
52
- layout=vm.Layout(grid=PAGE_GRID),
53
  components=[
54
  vm.Card(
55
  text="""
@@ -89,7 +89,7 @@ dot_map_page = vm.Page(
89
  bubble_map_page = vm.Page(
90
  title="Bubble map",
91
  path="spatial/bubble-map",
92
- layout=vm.Layout(grid=PAGE_GRID),
93
  components=[
94
  vm.Card(
95
  text="""
 
8
  choropleth_page = vm.Page(
9
  title="Choropleth",
10
  path="spatial/choropleth",
11
+ layout=vm.Grid(grid=PAGE_GRID),
12
  components=[
13
  vm.Card(
14
  text="""
 
49
  dot_map_page = vm.Page(
50
  title="Dot map",
51
  path="spatial/dot-map",
52
+ layout=vm.Grid(grid=PAGE_GRID),
53
  components=[
54
  vm.Card(
55
  text="""
 
89
  bubble_map_page = vm.Page(
90
  title="Bubble map",
91
  path="spatial/bubble-map",
92
+ layout=vm.Grid(grid=PAGE_GRID),
93
  components=[
94
  vm.Card(
95
  text="""
pages/time.py CHANGED
@@ -12,7 +12,7 @@ from pages.examples import area, gantt, heatmap, line, sparkline, stepped_line,
12
  line_page = vm.Page(
13
  title="Line",
14
  path="time/line",
15
- layout=vm.Layout(grid=PAGE_GRID),
16
  components=[
17
  vm.Card(
18
  text="""
@@ -52,7 +52,7 @@ column_page = vm.Page(
52
  id="time-column",
53
  path="time/column",
54
  title="Column",
55
- layout=vm.Layout(grid=PAGE_GRID),
56
  components=[
57
  vm.Card(
58
  text="""
@@ -90,7 +90,7 @@ column_page = vm.Page(
90
  area_page = vm.Page(
91
  title="Area",
92
  path="time/area",
93
- layout=vm.Layout(grid=PAGE_GRID),
94
  components=[
95
  vm.Card(
96
  text="""
@@ -131,7 +131,7 @@ column_and_line_page = column_and_line_factory("time")
131
  stepped_line_page = vm.Page(
132
  title="Stepped line",
133
  path="time/stepped-line",
134
- layout=vm.Layout(grid=PAGE_GRID),
135
  components=[
136
  vm.Card(
137
  text="""
@@ -168,7 +168,7 @@ stepped_line_page = vm.Page(
168
  heatmap_page = vm.Page(
169
  title="Heatmap",
170
  path="time/heatmap",
171
- layout=vm.Layout(grid=PAGE_GRID),
172
  components=[
173
  vm.Card(
174
  text="""
@@ -205,7 +205,7 @@ heatmap_page = vm.Page(
205
  gantt_page = vm.Page(
206
  title="Gantt",
207
  path="time/gantt",
208
- layout=vm.Layout(grid=PAGE_GRID),
209
  components=[
210
  vm.Card(
211
  text="""
@@ -245,7 +245,7 @@ gantt_page = vm.Page(
245
  sparkline_page = vm.Page(
246
  title="Sparkline",
247
  path="time/sparkline",
248
- layout=vm.Layout(grid=PAGE_GRID),
249
  components=[
250
  vm.Card(
251
  text="""
 
12
  line_page = vm.Page(
13
  title="Line",
14
  path="time/line",
15
+ layout=vm.Grid(grid=PAGE_GRID),
16
  components=[
17
  vm.Card(
18
  text="""
 
52
  id="time-column",
53
  path="time/column",
54
  title="Column",
55
+ layout=vm.Grid(grid=PAGE_GRID),
56
  components=[
57
  vm.Card(
58
  text="""
 
90
  area_page = vm.Page(
91
  title="Area",
92
  path="time/area",
93
+ layout=vm.Grid(grid=PAGE_GRID),
94
  components=[
95
  vm.Card(
96
  text="""
 
131
  stepped_line_page = vm.Page(
132
  title="Stepped line",
133
  path="time/stepped-line",
134
+ layout=vm.Grid(grid=PAGE_GRID),
135
  components=[
136
  vm.Card(
137
  text="""
 
168
  heatmap_page = vm.Page(
169
  title="Heatmap",
170
  path="time/heatmap",
171
+ layout=vm.Grid(grid=PAGE_GRID),
172
  components=[
173
  vm.Card(
174
  text="""
 
205
  gantt_page = vm.Page(
206
  title="Gantt",
207
  path="time/gantt",
208
+ layout=vm.Grid(grid=PAGE_GRID),
209
  components=[
210
  vm.Card(
211
  text="""
 
245
  sparkline_page = vm.Page(
246
  title="Sparkline",
247
  path="time/sparkline",
248
+ layout=vm.Grid(grid=PAGE_GRID),
249
  components=[
250
  vm.Card(
251
  text="""
requirements.in CHANGED
@@ -3,5 +3,5 @@ autoflake==2.3.1
3
  black==24.4.2
4
  isort==5.13.2
5
  plotly==6.0.0
6
- vizro==0.1.28
7
  gunicorn
 
3
  black==24.4.2
4
  isort==5.13.2
5
  plotly==6.0.0
6
+ vizro==0.1.44
7
  gunicorn
requirements.txt CHANGED
@@ -22,23 +22,18 @@ click==8.1.7
22
  # via
23
  # black
24
  # flask
25
- dash==2.18.1
26
  # via
27
  # dash-ag-grid
28
  # dash-bootstrap-components
 
29
  # vizro
30
- dash-ag-grid==31.2.0
31
  # via vizro
32
- dash-bootstrap-components==1.6.0
33
  # via vizro
34
- dash-core-components==2.0.0
35
- # via dash
36
- dash-html-components==2.0.0
37
- # via dash
38
- dash-mantine-components==0.12.1
39
  # via vizro
40
- dash-table==5.0.0
41
- # via dash
42
  flask==3.0.3
43
  # via
44
  # dash
@@ -74,6 +69,7 @@ packaging==24.1
74
  # black
75
  # gunicorn
76
  # plotly
 
77
  pandas==2.2.3
78
  # via vizro
79
  pathspec==0.12.1
@@ -114,7 +110,7 @@ tzdata==2024.2
114
  # via pandas
115
  urllib3==2.2.3
116
  # via requests
117
- vizro==0.1.28
118
  # via -r requirements.in
119
  werkzeug==3.0.6
120
  # via
 
22
  # via
23
  # black
24
  # flask
25
+ dash==3.1.1
26
  # via
27
  # dash-ag-grid
28
  # dash-bootstrap-components
29
+ # dash-mantine-components
30
  # vizro
31
+ dash-ag-grid==32.3.0
32
  # via vizro
33
+ dash-bootstrap-components==2.0.3
34
  # via vizro
35
+ dash-mantine-components==2.1.0
 
 
 
 
36
  # via vizro
 
 
37
  flask==3.0.3
38
  # via
39
  # dash
 
69
  # black
70
  # gunicorn
71
  # plotly
72
+ # vizro
73
  pandas==2.2.3
74
  # via vizro
75
  pathspec==0.12.1
 
110
  # via pandas
111
  urllib3==2.2.3
112
  # via requests
113
+ vizro==0.1.44
114
  # via -r requirements.in
115
  werkzeug==3.0.6
116
  # via