@opendata-ai/openchart-core 9.2.2 → 9.3.0

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/dist/index.d.ts CHANGED
@@ -1953,7 +1953,7 @@ interface ChartLayout {
1953
1953
  };
1954
1954
  /** Resolved animation config. Present only when animation is enabled. */
1955
1955
  animation?: ResolvedAnimation;
1956
- /** Whether the OpenData watermark is enabled. */
1956
+ /** Whether the OpenChart watermark is enabled. */
1957
1957
  watermark: boolean;
1958
1958
  /** Display mode controlling chrome/axes/legend stripping. `'sparkline'` produces an edge-to-edge mini chart. */
1959
1959
  display: Display;
@@ -2166,7 +2166,7 @@ interface TableLayout {
2166
2166
  theme: ResolvedTheme;
2167
2167
  /** Resolved animation config. Present only when animation is enabled. */
2168
2168
  animation?: ResolvedAnimation;
2169
- /** Whether the OpenData watermark is enabled. */
2169
+ /** Whether the OpenChart watermark is enabled. */
2170
2170
  watermark: boolean;
2171
2171
  }
2172
2172
  /** A resolved graph node with computed position and visual properties. */
@@ -2348,7 +2348,7 @@ interface SankeyLayout {
2348
2348
  };
2349
2349
  /** Resolved animation config. Present only when animation is enabled. */
2350
2350
  animation?: ResolvedAnimation;
2351
- /** Whether the OpenData watermark is enabled. */
2351
+ /** Whether the OpenChart watermark is enabled. */
2352
2352
  watermark: boolean;
2353
2353
  /** Real text measurement function from the adapter (for accurate SVG text wrapping). */
2354
2354
  measureText?: MeasureTextFn;
@@ -2758,7 +2758,7 @@ interface CompileOptions {
2758
2758
  * layered, and sparkline charts.
2759
2759
  */
2760
2760
  renderer?: 'auto' | 'svg' | 'canvas';
2761
- /** Whether to show the OpenData watermark. Defaults to true. */
2761
+ /** Whether to show the OpenChart watermark. Defaults to true. */
2762
2762
  watermark?: boolean;
2763
2763
  /**
2764
2764
  * Enable development-time diagnostics (WCAG contrast warnings via
@@ -4091,7 +4091,7 @@ interface Chrome {
4091
4091
  /**
4092
4092
  * Right-anchored brand block on the footer row. Visually balances the
4093
4093
  * source/byline left-anchored text.
4094
- * When set, suppresses the default `OpenData` watermark for this chart.
4094
+ * When set, suppresses the default `OpenChart` watermark for this chart.
4095
4095
  */
4096
4096
  brand?: string | ChromeText;
4097
4097
  }
@@ -5168,7 +5168,7 @@ interface BaseChartSpec<TData extends DataRow = DataRow> {
5168
5168
  /** Theme configuration overrides. */
5169
5169
  theme?: ThemeConfig;
5170
5170
  /**
5171
- * Whether to show the OpenData watermark. Defaults to true; auto-hides
5171
+ * Whether to show the OpenChart watermark. Defaults to true; auto-hides
5172
5172
  * when the container is under 200px tall (the cramped height class) unless
5173
5173
  * explicitly set.
5174
5174
  */
@@ -5410,7 +5410,7 @@ interface TableSpec {
5410
5410
  chrome?: Chrome;
5411
5411
  /** Theme configuration overrides. */
5412
5412
  theme?: ThemeConfig;
5413
- /** Whether to show the OpenData watermark. Defaults to true. */
5413
+ /** Whether to show the OpenChart watermark. Defaults to true. */
5414
5414
  watermark?: boolean;
5415
5415
  /** Enable client-side search/filter. */
5416
5416
  search?: boolean;
@@ -5620,7 +5620,7 @@ interface GraphSpec {
5620
5620
  interactive?: boolean;
5621
5621
  counts?: boolean;
5622
5622
  };
5623
- /** Whether to show the OpenData watermark. Defaults to true. */
5623
+ /** Whether to show the OpenChart watermark. Defaults to true. */
5624
5624
  watermark?: boolean;
5625
5625
  /**
5626
5626
  * Render in two or three dimensions. Defaults to `2` (the Canvas renderer).
@@ -5743,7 +5743,7 @@ interface LayerSpec<TData extends DataRow = DataRow> {
5743
5743
  responsive?: boolean | ResponsiveConfig;
5744
5744
  /** Theme configuration overrides. */
5745
5745
  theme?: ThemeConfig;
5746
- /** Whether to show the OpenData watermark. Defaults to true. */
5746
+ /** Whether to show the OpenChart watermark. Defaults to true. */
5747
5747
  watermark?: boolean;
5748
5748
  /** Resolution strategy for shared scales/axes/legends. */
5749
5749
  resolve?: ResolveConfig;
@@ -5833,7 +5833,7 @@ interface SankeySpec {
5833
5833
  legend?: LegendConfig;
5834
5834
  /** Theme configuration overrides. */
5835
5835
  theme?: ThemeConfig;
5836
- /** Whether to show the OpenData watermark. Defaults to true. */
5836
+ /** Whether to show the OpenChart watermark. Defaults to true. */
5837
5837
  watermark?: boolean;
5838
5838
  /**
5839
5839
  * Motion. On by default: the entrance plays once the visualization scrolls
@@ -5918,7 +5918,7 @@ interface TileMapSpec {
5918
5918
  legend?: LegendConfig;
5919
5919
  /** Theme configuration overrides. */
5920
5920
  theme?: ThemeConfig;
5921
- /** Whether to show the OpenData watermark. Defaults to true. */
5921
+ /** Whether to show the OpenChart watermark. Defaults to true. */
5922
5922
  watermark?: boolean;
5923
5923
  /**
5924
5924
  * Motion. On by default: the entrance plays once the visualization scrolls
@@ -6100,7 +6100,7 @@ interface GeoMapSpec {
6100
6100
  legend?: LegendConfig;
6101
6101
  /** Theme configuration overrides. */
6102
6102
  theme?: ThemeConfig;
6103
- /** Whether to show the OpenData watermark. Defaults to true. */
6103
+ /** Whether to show the OpenChart watermark. Defaults to true. */
6104
6104
  watermark?: boolean;
6105
6105
  /** Optional point/symbol layer rendered above choropleth features. */
6106
6106
  points?: GeoMapPointsLayer;
@@ -6149,7 +6149,7 @@ interface BarListSpec {
6149
6149
  chrome?: Chrome;
6150
6150
  /** Theme configuration overrides. */
6151
6151
  theme?: ThemeConfig;
6152
- /** Whether to show the OpenData watermark. Defaults to true. */
6152
+ /** Whether to show the OpenChart watermark. Defaults to true. */
6153
6153
  watermark?: boolean;
6154
6154
  /**
6155
6155
  * Motion. On by default: the entrance plays once the visualization scrolls
@@ -6306,7 +6306,7 @@ interface RaceSpec {
6306
6306
  theme?: ThemeConfig;
6307
6307
  /** Accessibility overrides. Omit to use generated metadata. */
6308
6308
  a11y?: A11yConfig;
6309
- /** Whether to show the OpenData watermark. Defaults to true. */
6309
+ /** Whether to show the OpenChart watermark. Defaults to true. */
6310
6310
  watermark?: boolean;
6311
6311
  /** Fixed render width in pixels. Defaults to container-driven sizing. */
6312
6312
  width?: number;
@@ -6711,6 +6711,15 @@ type ElementRef = {
6711
6711
  index: number;
6712
6712
  /** Root-relative RFC 6901 JSON Pointer to the authored object this ref identifies (e.g. `/layer/0/annotations/2`, `/chrome/title`). Always set on refs the chart emits or returns; legend refs point at `/legend`. Edited properties are addressed by `EditOp.path`. */
6713
6713
  path?: string;
6714
+ } | {
6715
+ /** A table column, as a table in `select` mode emits it. */
6716
+ type: 'column';
6717
+ /** The column's data key. */
6718
+ key: string;
6719
+ /** Position in the spec's `columns` array; tells two columns with one key apart. */
6720
+ index: number;
6721
+ /** `/columns/<index>` */
6722
+ path?: string;
6714
6723
  };
6715
6724
  /** Helper constructors for ergonomic ElementRef creation. */
6716
6725
  declare const elementRef: {
@@ -6720,6 +6729,7 @@ declare const elementRef: {
6720
6729
  readonly chrome: (key: ChromeKey, path?: string) => ElementRef;
6721
6730
  readonly legend: (path?: string) => ElementRef;
6722
6731
  readonly legendEntry: (series: string, index: number, path?: string) => ElementRef;
6732
+ readonly column: (key: string, index: number, path?: string) => ElementRef;
6723
6733
  };
6724
6734
  /**
6725
6735
  * Event fired when a user interacts with a data mark (bar, point, line segment, etc.).
@@ -7676,7 +7686,7 @@ declare function computeChrome(chrome: Chrome | undefined, theme: ResolvedTheme,
7676
7686
  */
7677
7687
  declare function estimateTextWidth(text: string, fontSize: number, fontWeight?: number): number;
7678
7688
  /**
7679
- * Width reserved for the "OpenData" brand watermark in the bottom-right corner.
7689
+ * Width reserved for the "OpenChart" brand watermark in the bottom-right corner.
7680
7690
  */
7681
7691
  declare const BRAND_RESERVE_WIDTH = 130;
7682
7692
  /** Font size of the brand watermark (px). Shared between layout and renderer. */
package/dist/index.js CHANGED
@@ -391,6 +391,12 @@ var elementRef = {
391
391
  series,
392
392
  index,
393
393
  ...path !== void 0 ? { path } : {}
394
+ }),
395
+ column: (key, index, path) => ({
396
+ type: "column",
397
+ key,
398
+ index,
399
+ ...path !== void 0 ? { path } : {}
394
400
  })
395
401
  };
396
402
 
@@ -2726,10 +2732,10 @@ function measuredWatermark(theme, width, pad, y, measureText) {
2726
2732
  lineHeight: 1.3
2727
2733
  };
2728
2734
  return {
2729
- text: "OpenData",
2735
+ text: "OpenChart",
2730
2736
  x: width - pad,
2731
2737
  y,
2732
- maxWidth: measureText?.("OpenData", BRAND_FONT_SIZE, 600).width ?? "OpenData".length * estimateCharWidth(BRAND_FONT_SIZE, 600),
2738
+ maxWidth: measureText?.("OpenChart", BRAND_FONT_SIZE, 600).width ?? "OpenChart".length * estimateCharWidth(BRAND_FONT_SIZE, 600),
2733
2739
  style
2734
2740
  };
2735
2741
  }
@@ -4359,14 +4365,14 @@ var ROLE_DEFS = /* @__PURE__ */ (() => [
4359
4365
  {
4360
4366
  name: "label",
4361
4367
  scope: "chart",
4362
- comment: "Data labels (bar values, line end labels) fade in place once their mark has\nlanded: when the bar at the label's --oc-mark-index reaches 0.97. Lines\nshare the bar's duration and curve, so the bar anchor stands in for them.\nLabels never move during the entrance.",
4368
+ comment: "Data labels (bar values, line end labels) fade in place once their mark has\nlanded: when the bar at the label's --oc-mark-index reaches 0.995, within a\npixel of its end, so a label never shows while its bar is still growing.\nLines share the bar's duration and curve, so the bar anchor stands in for\nthem. Labels never move during the entrance.",
4363
4369
  selectors: [".oc-mark-label"],
4364
4370
  emit: "shorthand",
4365
4371
  keyframe: "oc-enter-fade-only",
4366
4372
  timing: AUTHOR,
4367
4373
  durationBasis: "phase",
4368
4374
  duration: fixed(LABEL_FADE_MS),
4369
- delay: { after: when("bar", 0.97), stagger: "mark" }
4375
+ delay: { after: when("bar", 0.995), stagger: "mark" }
4370
4376
  },
4371
4377
  {
4372
4378
  name: "arc-label",