refactor: update app code for domain-scoped schema migration
Some checks failed
CI / lint-and-test (pull_request) Has been cancelled
Some checks failed
CI / lint-and-test (pull_request) Has been cancelled
- Update dbt model references to use new schema naming (stg_toronto, int_toronto, mart_toronto) - Refactor figure factories to use consistent column naming from new schema - Update callbacks to work with refactored data structures - Add centralized design tokens module for consistent styling - Streamline CLAUDE.md documentation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,13 @@ from typing import Any
|
||||
import plotly.express as px
|
||||
import plotly.graph_objects as go
|
||||
|
||||
from portfolio_app.design import (
|
||||
PAPER_BG,
|
||||
PLOT_BG,
|
||||
TEXT_PRIMARY,
|
||||
TEXT_SECONDARY,
|
||||
)
|
||||
|
||||
|
||||
def create_choropleth_figure(
|
||||
geojson: dict[str, Any] | None,
|
||||
@@ -55,9 +62,9 @@ def create_choropleth_figure(
|
||||
margin={"l": 0, "r": 0, "t": 40, "b": 0},
|
||||
title=title or "Toronto Housing Map",
|
||||
height=500,
|
||||
paper_bgcolor="rgba(0,0,0,0)",
|
||||
plot_bgcolor="rgba(0,0,0,0)",
|
||||
font_color="#c9c9c9",
|
||||
paper_bgcolor=PAPER_BG,
|
||||
plot_bgcolor=PLOT_BG,
|
||||
font_color=TEXT_PRIMARY,
|
||||
)
|
||||
fig.add_annotation(
|
||||
text="No geometry data available. Complete QGIS digitization to enable map.",
|
||||
@@ -66,7 +73,7 @@ def create_choropleth_figure(
|
||||
x=0.5,
|
||||
y=0.5,
|
||||
showarrow=False,
|
||||
font={"size": 14, "color": "#888888"},
|
||||
font={"size": 14, "color": TEXT_SECONDARY},
|
||||
)
|
||||
return fig
|
||||
|
||||
@@ -98,17 +105,17 @@ def create_choropleth_figure(
|
||||
margin={"l": 0, "r": 0, "t": 40, "b": 0},
|
||||
title=title,
|
||||
height=500,
|
||||
paper_bgcolor="rgba(0,0,0,0)",
|
||||
plot_bgcolor="rgba(0,0,0,0)",
|
||||
font_color="#c9c9c9",
|
||||
paper_bgcolor=PAPER_BG,
|
||||
plot_bgcolor=PLOT_BG,
|
||||
font_color=TEXT_PRIMARY,
|
||||
coloraxis_colorbar={
|
||||
"title": {
|
||||
"text": color_column.replace("_", " ").title(),
|
||||
"font": {"color": "#c9c9c9"},
|
||||
"font": {"color": TEXT_PRIMARY},
|
||||
},
|
||||
"thickness": 15,
|
||||
"len": 0.7,
|
||||
"tickfont": {"color": "#c9c9c9"},
|
||||
"tickfont": {"color": TEXT_PRIMARY},
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user