refactor(charts): centralize typography, dashes, strokes; flip y-axis to right#4722
refactor(charts): centralize typography, dashes, strokes; flip y-axis to right#4722aseckin wants to merge 1 commit into
Conversation
… to right Introduce three token modules under front_end/src/constants/: - chart_typography (font family, sizes, pre-composed styles with tabular-nums) - chart_dash (named dash patterns: grid, cursor, quartile, threshold, timeline) - chart_stroke (stroke widths and point sizes for resolution markers) - chart_tokens (ChartThemeOverride type + resolveChartTokens helper) Fix malformed font-family in chart_theme.ts (was using `var(--font-inter-variable) var(--font-inter)` without commas, silently falling back to system font). Raise base theme fontSize to 10 (was dead code at 9) and add fontVariantNumeric: tabular-nums. Per-chart axis styles now spread CHART_FONT_STYLE.tick / .axisLabel so tabular-nums and font family land on the rendered SVG (Victory's per-axis style replaces theme tickLabels). Apply CHART_DASH tokens at every strokeDasharray site across chart components and primitives, unifying previously divergent values for cursor/grid/quartile/threshold lines. Flip y-axis orientation to "right" everywhere (fan_chart, numeric_chart, multiple_choice_chart, group_chart, continuous_area_chart for discrete/CDF). Drop the offsetX = chartWidth + 5 hack and the VictoryLabel x=chartWidth axisLabelComponent overrides. FanChart default variant padding swapped from left-heavy to right-heavy. Discrete y-axis in ContinuousAreaChart now positions at xDomain[1]. Unify FanChart resolution diamond stroke width (2.5) and point size (10) across default and index variants. Extend STYLE_PROPERTIES in svg_export.ts to preserve font-variant-numeric and a handful of other CSS properties that were being dropped during SVG download. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 Preview EnvironmentYour preview environment is ready!
Details
ℹ️ Preview Environment InfoIsolation:
Limitations:
Cleanup:
|
Introduce three token modules under front_end/src/constants/:
Fix malformed font-family in chart_theme.ts (was using
var(--font-inter-variable) var(--font-inter)without commas, silently falling back to system font). Raise base theme fontSize to 10 (was dead code at 9) and add fontVariantNumeric: tabular-nums.Per-chart axis styles now spread CHART_FONT_STYLE.tick / .axisLabel so tabular-nums and font family land on the rendered SVG (Victory's per-axis style replaces theme tickLabels). Apply CHART_DASH tokens at every strokeDasharray site across chart components and primitives, unifying previously divergent values for cursor/grid/quartile/threshold lines.
Flip y-axis orientation to "right" everywhere (fan_chart, numeric_chart, multiple_choice_chart, group_chart, continuous_area_chart for discrete/CDF). Drop the offsetX = chartWidth + 5 hack and the VictoryLabel x=chartWidth axisLabelComponent overrides. FanChart default variant padding swapped from left-heavy to right-heavy. Discrete y-axis in ContinuousAreaChart now positions at xDomain[1].
Unify FanChart resolution diamond stroke width (2.5) and point size (10) across default and index variants.
Extend STYLE_PROPERTIES in svg_export.ts to preserve font-variant-numeric and a handful of other CSS properties that were being dropped during SVG download.