antonymilne Claude commited on
Commit
c62cec4
Β·
1 Parent(s): ed14a62

Fix argument ordering in Container definitions

Browse files

Reorder arguments to follow consistent pattern:
- title
- layout
- components
- controls
- variant (always last)

Fixes all pages: overview, regions, customers, products

πŸ€– Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>

Files changed (1) hide show
  1. app.py +20 -20
app.py CHANGED
@@ -96,6 +96,7 @@ overview_page = vm.Page(
96
  vm.Container(
97
  id="kpi-cards",
98
  title="πŸ’‘ Click on a KPI card to update the charts below.",
 
99
  components=[
100
  create_kpi_card_figure(sales_kpi_df, "Sales", "bar_chart"),
101
  create_kpi_card_figure(profit_kpi_df, "Profit", "money_bag"),
@@ -104,7 +105,6 @@ overview_page = vm.Page(
104
  customer_kpi_df, "Customers", "group", metric_value="Customer ID", is_currency=False
105
  )
106
  ],
107
- layout=vm.Grid(grid=[[0, 1, 2, 3]])
108
  ),
109
  create_chart_container_with_nav(
110
  id="line_month",
@@ -166,6 +166,12 @@ regions_page = vm.Page(
166
  variant="filled"
167
  ),
168
  vm.Container(
 
 
 
 
 
 
169
  controls=[
170
  vm.Parameter(
171
  targets=["pg2-chart-1.top_n"],
@@ -179,12 +185,6 @@ regions_page = vm.Page(
179
  targets=["pg2-chart-1.y"],
180
  )
181
  ],
182
- components=[
183
- vm.Graph(
184
- id="pg2-chart-1",
185
- figure=bar_chart_top_n(superstore_df, x="Sales", y="City")
186
- )
187
- ],
188
  variant="filled",
189
  )
190
  ],
@@ -222,11 +222,6 @@ customers_page = vm.Page(
222
  components=[
223
  vm.Container(
224
  layout=vm.Grid(grid=[[0, 1]]),
225
- controls=[
226
- vm.Filter(column="Region", selector=vm.Checklist(title="Choose region")),
227
- vm.Filter(column="Segment", selector=vm.Checklist(title="Choose segment")),
228
- vm.Filter(column="Category", selector=vm.Checklist(title="Choose category"))
229
- ],
230
  components=[
231
  vm.AgGrid(
232
  id="table-2",
@@ -239,6 +234,11 @@ customers_page = vm.Page(
239
  ),
240
  vm.Graph(id="pg3_pareto_chart", figure=pareto_customers_chart(superstore_df, highlight_customer=None))
241
  ],
 
 
 
 
 
242
  )
243
  ],
244
  controls=[
@@ -256,6 +256,13 @@ products_page = vm.Page(
256
  title="Products",
257
  components=[
258
  vm.Container(
 
 
 
 
 
 
 
259
  components=[
260
  vm.Container(
261
  components=[
@@ -292,14 +299,7 @@ products_page = vm.Page(
292
  ],
293
  variant="filled",
294
  )
295
- ],
296
- layout=vm.Grid(
297
- grid=[
298
- [0, 0, 2, 2],
299
- [1, 1, 2, 2],
300
- [1, 1, 2, 2]
301
- ]
302
- )
303
  )
304
  ],
305
  controls=[
 
96
  vm.Container(
97
  id="kpi-cards",
98
  title="πŸ’‘ Click on a KPI card to update the charts below.",
99
+ layout=vm.Grid(grid=[[0, 1, 2, 3]]),
100
  components=[
101
  create_kpi_card_figure(sales_kpi_df, "Sales", "bar_chart"),
102
  create_kpi_card_figure(profit_kpi_df, "Profit", "money_bag"),
 
105
  customer_kpi_df, "Customers", "group", metric_value="Customer ID", is_currency=False
106
  )
107
  ],
 
108
  ),
109
  create_chart_container_with_nav(
110
  id="line_month",
 
166
  variant="filled"
167
  ),
168
  vm.Container(
169
+ components=[
170
+ vm.Graph(
171
+ id="pg2-chart-1",
172
+ figure=bar_chart_top_n(superstore_df, x="Sales", y="City")
173
+ )
174
+ ],
175
  controls=[
176
  vm.Parameter(
177
  targets=["pg2-chart-1.top_n"],
 
185
  targets=["pg2-chart-1.y"],
186
  )
187
  ],
 
 
 
 
 
 
188
  variant="filled",
189
  )
190
  ],
 
222
  components=[
223
  vm.Container(
224
  layout=vm.Grid(grid=[[0, 1]]),
 
 
 
 
 
225
  components=[
226
  vm.AgGrid(
227
  id="table-2",
 
234
  ),
235
  vm.Graph(id="pg3_pareto_chart", figure=pareto_customers_chart(superstore_df, highlight_customer=None))
236
  ],
237
+ controls=[
238
+ vm.Filter(column="Region", selector=vm.Checklist(title="Choose region")),
239
+ vm.Filter(column="Segment", selector=vm.Checklist(title="Choose segment")),
240
+ vm.Filter(column="Category", selector=vm.Checklist(title="Choose category"))
241
+ ],
242
  )
243
  ],
244
  controls=[
 
256
  title="Products",
257
  components=[
258
  vm.Container(
259
+ layout=vm.Grid(
260
+ grid=[
261
+ [0, 0, 2, 2],
262
+ [1, 1, 2, 2],
263
+ [1, 1, 2, 2]
264
+ ]
265
+ ),
266
  components=[
267
  vm.Container(
268
  components=[
 
299
  ],
300
  variant="filled",
301
  )
302
+ ]
 
 
 
 
 
 
 
303
  )
304
  ],
305
  controls=[