You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: responsive layout improvements for narrow viewports
Tighten spacing on small screens so charts maximize data area:
- Consolidate legend gap logic into shared legendGap() helper
- Extract COMPACT_WIDTH constant (420px) to eliminate magic numbers
- Clamp y-axis label margins so long categories don't starve chart area
- Truncate overflowing y-axis labels with ellipsis + title for a11y
- Clamp dot chart baseline to scale range when domain excludes zero
- Allow tick thinning even with explicit tickCount (D3 log scales overshoot)
- Order legend entries by explicit domain for author-controlled truncation
- Move applyTextStyle to inline styles so engine values override CSS defaults
- Document mark properties and gradients in spec reference
@@ -67,6 +68,65 @@ type DataRow = Record<string, unknown>;
67
68
68
69
A plain object with string keys. Values can be numbers, strings, dates, nulls, arrays (for sparklines), or booleans. The engine inspects values at runtime to validate encoding types.
69
70
71
+
### Mark properties
72
+
73
+
The `type` field on ChartSpec accepts either a string (`'line'`) or an object with additional mark configuration. In LayerSpec children, this field is called `mark`.
|`stops`|`GradientStop[]`| (required) | Color stops with offset (0-1), color, and optional opacity. |
125
+
|`x1`, `y1`|`number`|`0`, `0`| Start point in [0,1] normalized space. |
126
+
|`x2`, `y2`|`number`|`0`, `1`| End point. Default is top-to-bottom. |
127
+
128
+
**Area chart fill behavior:** Single-series area charts apply a default `fillOpacity` of 0.15 to the area fill (the stroke is drawn at full opacity). Stacked areas use 0.7. The gradient stop `opacity` values multiply with this default, so a stop at `opacity: 1` with the area default produces an effective opacity of 0.15. Design gradient stops accordingly, or use a LayerSpec with separate line and area marks for full control.
0 commit comments