@opendata-ai/openchart-core 7.0.0 → 7.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opendata-ai/openchart-core",
3
- "version": "7.0.0",
3
+ "version": "7.0.3",
4
4
  "description": "Types, theme, colors, accessibility, and utilities for openchart",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Riley Hilliard",
@@ -106,17 +106,20 @@ function _luminanceFromHex(color: string): number {
106
106
  */
107
107
  export function adaptTheme(theme: ResolvedTheme): ResolvedTheme {
108
108
  const inputBg = theme.colors.background;
109
- // Treat transparent as "already dark" to preserve user intent
110
- const alreadyDark = inputBg === 'transparent' || _luminanceFromHex(inputBg) < 0.2;
111
-
112
- // If the theme already has a dark background, preserve user-provided colors
113
- // instead of overwriting with library defaults.
109
+ // "transparent" preserves the background token but must still adopt dark
110
+ // text/gridline/axis colors the container is dark, not the chart canvas.
111
+ const isTransparent = inputBg === 'transparent';
112
+ const alreadyDark = isTransparent || _luminanceFromHex(inputBg) < 0.2;
113
+
114
+ // Preserve user-supplied background (including transparent) but always
115
+ // apply dark-mode text/axis/gridline colors so labels are readable on the
116
+ // dark host surface.
114
117
  const darkBg = alreadyDark ? inputBg : DARK_BG;
115
- const darkText = alreadyDark ? theme.colors.text : DARK_TEXT;
116
- const darkGridline = alreadyDark ? theme.colors.gridline : 'rgba(255,255,255,0.05)';
118
+ const darkText = DARK_TEXT;
119
+ const darkGridline = 'rgba(255,255,255,0.05)';
117
120
  // axis is also tick-label fill — needs WCAG AA contrast on dark bg.
118
121
  // Zinc-400 (`#a1a1aa`) hits ~6:1 against #09090b.
119
- const darkAxis = alreadyDark ? theme.colors.axis : '#a1a1aa';
122
+ const darkAxis = '#a1a1aa';
120
123
  const darkMuted = ACHROMATIC_RAMP.fgMuted;
121
124
 
122
125
  // Categorical palette is pinned to design-system tokens. The same vibrant
package/src/types/spec.ts CHANGED
@@ -1502,6 +1502,8 @@ export interface LayerSpec<TData extends DataRow = DataRow> {
1502
1502
  resolve?: ResolveConfig;
1503
1503
  /** Hidden series names. */
1504
1504
  hiddenSeries?: string[];
1505
+ /** Endpoint labels column, inherited by child layers that don't set their own. */
1506
+ endpointLabels?: boolean | EndpointLabelsConfig;
1505
1507
  /** Animation configuration. */
1506
1508
  animation?: AnimationSpec;
1507
1509
  }