@blueprint-chart/lib 1.8.3 → 2.0.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.
Files changed (50) hide show
  1. package/dist/charts/axis-options.d.ts +3 -0
  2. package/dist/charts/canvas/canvas.d.ts +2 -5
  3. package/dist/charts/category-label-line.d.ts +16 -0
  4. package/dist/charts/chart-helpers.d.ts +2 -3
  5. package/dist/charts/chart-options.d.ts +2 -0
  6. package/dist/charts/contrast.d.ts +4 -3
  7. package/dist/charts/date-parse.d.ts +6 -0
  8. package/dist/charts/frame/frame.d.ts +6 -0
  9. package/dist/charts/parse-data.d.ts +2 -0
  10. package/dist/charts/plugins/highlight.d.ts +9 -3
  11. package/dist/charts/scale-helpers.d.ts +15 -8
  12. package/dist/charts/series-helpers.d.ts +22 -1
  13. package/dist/charts/stack-helpers.d.ts +1 -1
  14. package/dist/charts/themes/index.d.ts +6 -0
  15. package/dist/charts/types.d.ts +10 -4
  16. package/dist/charts/value-label-fit.d.ts +31 -0
  17. package/dist/dsl/converter.d.ts +5 -0
  18. package/dist/dsl/quoting.d.ts +16 -0
  19. package/dist/dsl/types.d.ts +42 -0
  20. package/dist/dsl/validate.d.ts +6 -0
  21. package/dist/embed.js +1 -1
  22. package/dist/enums.d.ts +23 -0
  23. package/dist/index.d.ts +9 -1
  24. package/dist/index.js +615 -296
  25. package/dist/lib/lib.iife.js +44 -16
  26. package/dist/node-backend/index.js +3182 -2103
  27. package/dist/render/chart-a11y.d.ts +14 -0
  28. package/dist/render/frame-svg.d.ts +51 -0
  29. package/dist/render/index.d.ts +3 -0
  30. package/dist/render/post-render.d.ts +2 -0
  31. package/dist/{render-bpc-Bgb7rsgM.js → render-bpc-BWiUALXY.js} +3966 -2855
  32. package/dist/runtime/chart-css.d.ts +1 -1
  33. package/dist/runtime-DDhsXDn5.js +84 -0
  34. package/dist/runtime.js +2 -2
  35. package/dist/transforms/applyFilter.d.ts +2 -0
  36. package/dist/transforms/applyGroupBy.d.ts +2 -0
  37. package/dist/transforms/applyHideColumns.d.ts +2 -0
  38. package/dist/transforms/applyParse.d.ts +3 -0
  39. package/dist/transforms/applyRename.d.ts +2 -0
  40. package/dist/transforms/applySort.d.ts +2 -0
  41. package/dist/transforms/applyTranspose.d.ts +2 -0
  42. package/dist/transforms/index.d.ts +30 -0
  43. package/dist/transforms/parseOperations.d.ts +15 -0
  44. package/dist/transforms/shared.d.ts +4 -0
  45. package/dist/transforms/table.d.ts +22 -0
  46. package/dist/transforms/transformValue.d.ts +1 -0
  47. package/dist/transforms/types.d.ts +13 -0
  48. package/package.json +1 -1
  49. package/src/charts/chart.scss +29 -4
  50. package/dist/runtime-BnrDRLyH.js +0 -84
@@ -0,0 +1,3 @@
1
+ import { ChartOptions, ChartTypeOptions } from './types';
2
+ export declare function buildVerticalAxisOptions(opts: Partial<ChartTypeOptions>): Partial<ChartOptions>;
3
+ export declare function buildHorizontalAxisOptions(opts: Partial<ChartTypeOptions>): Partial<ChartOptions>;
@@ -1,4 +1,4 @@
1
- import { Margin } from '../types';
1
+ import { AxisRange, Margin } from '../types';
2
2
  export interface CanvasElements {
3
3
  svg: SVGSVGElement;
4
4
  chartArea: SVGGElement;
@@ -20,10 +20,7 @@ export declare function computeMarginDelta(priorMargin: Pick<Margin, 'top' | 'le
20
20
  * Estimate the pixel width of the widest tick label for a vertical axis.
21
21
  * Uses an offscreen canvas for measurement, falling back to character-count estimation.
22
22
  */
23
- export declare function estimateVerticalLabelWidth(values: number[], range?: {
24
- min?: number;
25
- max?: number;
26
- }, numberFormat?: string | null, scaleType?: string): number;
23
+ export declare function estimateVerticalLabelWidth(values: number[], range?: AxisRange, numberFormat?: string | null, scaleType?: string): number;
27
24
  /**
28
25
  * Estimate the pixel width of the widest string label (for band/category axes).
29
26
  */
@@ -0,0 +1,16 @@
1
+ /** Height of the strip an inline category label is drawn in. */
2
+ export declare const CATEGORY_LABEL_HEIGHT = 13;
3
+ /**
4
+ * Height the inline category label may take out of `extent` — a band's
5
+ * thickness, or the plot height for column charts. Shrinks the strip, and then
6
+ * gives up on it, rather than letting the subtraction turn the bar's own extent
7
+ * negative: a rect with a negative height is not rendered at all, so a dense
8
+ * chart lost every one of its bars.
9
+ */
10
+ export declare function categoryLabelLineHeight(extent: number): number;
11
+ /**
12
+ * Whether a horizontal bar chart should draw its category labels above their
13
+ * bars instead of in the left gutter. An explicit `outside` keeps them in the
14
+ * gutter: the author asked for them there.
15
+ */
16
+ export declare function categoryLabelsNeedTheirOwnLine(containerWidth: number, verticalLabelPosition?: string): boolean;
@@ -1,3 +1,2 @@
1
- import { ChartData, ChartOptions, ChartTypeOptions } from './types';
2
- export declare function parseData(raw: string): ChartData;
3
- export declare function buildChartOptions(opts: Partial<ChartTypeOptions>, backgroundColor?: string): Partial<ChartOptions>;
1
+ export { parseData } from './parse-data';
2
+ export { buildChartOptions } from './chart-options';
@@ -0,0 +1,2 @@
1
+ import { ChartOptions, ChartTypeOptions } from './types';
2
+ export declare function buildChartOptions(opts: Partial<ChartTypeOptions>, backgroundColor?: string, chartType?: string): Partial<ChartOptions>;
@@ -28,9 +28,10 @@ export declare function resolveBackgroundColor(el?: Element | null): string;
28
28
  export declare function readableColor(color: string, bg?: string): string;
29
29
  /**
30
30
  * Adjusts an array of colors so that:
31
- * 1. Every color is readable against `bg` (WCAG contrast ratio >= 3).
32
- * 2. Adjacent colors are perceptually distinguishable (deltaE >= 12).
31
+ * 1. Every color is readable against `bg` (WCAG contrast ratio >= MIN_CONTRAST).
32
+ * 2. No color is perceptually close to any other (deltaE >= MIN_ADJACENT_DELTA_E).
33
33
  *
34
- * Only lightness is changed — hue and saturation are preserved.
34
+ * Lightness is changed first; hue rotates only when the lightness axis is
35
+ * exhausted, so a palette whose entries share a hue still comes out distinct.
35
36
  */
36
37
  export declare function adjustColorsForBackground(colors: string[], bg: string): string[];
@@ -6,6 +6,12 @@ export declare function parseDate(s: string): Date | null;
6
6
  * Jan 1 2020 rather than the number 2020.
7
7
  */
8
8
  export declare function parseDateOrNumber(s: string): number | undefined;
9
+ /**
10
+ * Parse a string as a plain number or, failing that, as a date (epoch ms).
11
+ * Numbers take precedence so a numeric axis bound like "2000" stays the
12
+ * number 2000 instead of Jan 1 2000.
13
+ */
14
+ export declare function parseNumberOrDate(s: string): number | undefined;
9
15
  export declare function detectDates(labels: string[]): {
10
16
  dates: Date[];
11
17
  granularity: DateGranularity;
@@ -5,4 +5,10 @@ export interface FrameElements {
5
5
  body: HTMLElement;
6
6
  footer: HTMLElement;
7
7
  }
8
+ /**
9
+ * Expand a CSS `padding` shorthand to its four sides. The stylesheet feeds each
10
+ * side into a separate shorthand slot, so a raw multi-value string would build
11
+ * an over-long declaration that the browser rejects outright.
12
+ */
13
+ export declare function expandPaddingShorthand(padding: string): [string, string, string, string];
8
14
  export declare function createFrame(container: HTMLElement, options?: FrameOptions | null): FrameElements;
@@ -0,0 +1,2 @@
1
+ import { ChartData } from './types';
2
+ export declare function parseData(raw: string): ChartData;
@@ -1,9 +1,15 @@
1
1
  /** Opacity applied to non-targeted marks when a highlight is active. */
2
2
  export declare const HIGHLIGHT_DIM_OPACITY = 0.35;
3
- /** Build the set of highlighted target keys from the DSL highlight directives. */
4
- export declare function highlightTargetSet(highlights?: {
3
+ /**
4
+ * Build the set of highlighted target keys from the DSL highlight directives,
5
+ * keeping only the ones present in `keys` (the mark keys the caller will draw).
6
+ * A target naming a renamed or misspelled category would otherwise leave a
7
+ * non-empty set that matches no mark, and `highlightOpacity` would dim
8
+ * everything instead of emphasising anything.
9
+ */
10
+ export declare function highlightTargetSet(highlights: {
5
11
  target: string;
6
- }[]): Set<string>;
12
+ }[] | undefined, keys: Iterable<string>): Set<string>;
7
13
  /**
8
14
  * Opacity for a mark given the active highlight targets:
9
15
  * no targets → `base`; this key targeted → `base`; otherwise → HIGHLIGHT_DIM_OPACITY.
@@ -1,12 +1,10 @@
1
+ import { AxisRange } from './types';
1
2
  import { ScaleType } from '../enums';
2
3
  /**
3
4
  * Filter chart labels (and corresponding data) by a horizontal axis range.
4
5
  * Returns the indices of labels that fall within [min, max].
5
6
  */
6
- export declare function filterLabelsByRange(labels: string[], range?: {
7
- min?: number;
8
- max?: number;
9
- }): number[];
7
+ export declare function filterLabelsByRange(labels: string[], range?: AxisRange): number[];
10
8
  export declare const DEFAULT_BAR_GAP = 60;
11
9
  /**
12
10
  * Convert a barGap (percentage of bar size) to a d3 scaleBand paddingInner value.
@@ -14,7 +12,16 @@ export declare const DEFAULT_BAR_GAP = 60;
14
12
  * to [0, 100]; non-finite or undefined values fall back to DEFAULT_BAR_GAP.
15
13
  */
16
14
  export declare function resolveBarGapPadding(barGap?: number): number;
17
- export declare function computeLinearDomain(values: number[], range?: {
18
- min?: number;
19
- max?: number;
20
- }, scaleType?: ScaleType): [number, number];
15
+ export declare function computeLinearDomain(values: number[], range?: AxisRange, scaleType?: ScaleType): [number, number];
16
+ /**
17
+ * Decade tick values (1, 10, 100, ...) for a logarithmic axis, or null when the
18
+ * scale is not logarithmic or holds no decade.
19
+ *
20
+ * d3's symlog scale generates ticks linearly, which on a log axis stacks every
21
+ * label into the top decade and emits a 0 that a log axis cannot represent.
22
+ * The domain floor is 0 once `.nice()` has run, so decades start at 1 there.
23
+ */
24
+ export declare function logTickValues(scale: {
25
+ domain: () => unknown[];
26
+ constant?: () => unknown;
27
+ }, maxTicks: number): number[] | null;
@@ -1,4 +1,25 @@
1
- import { SeriesOverride } from './types';
1
+ import { ChartData, SeriesOverride } from './types';
2
+ /**
3
+ * The series a multi-series renderer should draw. A `data` block with no
4
+ * `series` meta-row carries its numbers in `values` alone, which left the
5
+ * stacked, grouped and split renderers with an empty series list and nothing
6
+ * to draw. Such data is a stack, a group or a panel of one: it gets a single
7
+ * unnamed series, so every category still renders one bar.
8
+ */
9
+ export declare function seriesOrImplicit(data: ChartData): {
10
+ name: string;
11
+ values: number[];
12
+ }[];
13
+ /**
14
+ * Extend `colors` so it covers `count` series. `resolveSeriesColor` indexes
15
+ * modulo the palette length, so a chart with more series than the palette has
16
+ * colours paints two of them identically in both the plot and the legend;
17
+ * interpolating through LCH gives every series its own colour, the way the arc
18
+ * renderer already does for slices. Entries chroma cannot parse are dropped
19
+ * rather than fed to `chroma.scale`, which throws on them and would take the
20
+ * whole render down.
21
+ */
22
+ export declare function expandColorsToSeries(colors: string[], count: number): string[];
2
23
  export declare function resolveSeriesColor(name: string, index: number, colors: string[], overrides?: SeriesOverride[]): string;
3
24
  export declare function resolveSeriesDash(name: string, overrides?: SeriesOverride[]): string;
4
25
  export declare function resolveSeriesWidth(name: string, overrides?: SeriesOverride[]): number;
@@ -12,6 +12,6 @@ export interface StackedPoint {
12
12
  export declare function computeStack(data: ChartData): d3.Series<Record<string, number>, string>[];
13
13
  /**
14
14
  * Compute a stacked layout normalized to 100%.
15
- * Each category's values sum to 100.
15
+ * Each category's magnitudes sum to 100, negatives below the baseline.
16
16
  */
17
17
  export declare function computeStack100(data: ChartData): d3.Series<Record<string, number>, string>[];
@@ -0,0 +1,6 @@
1
+ export interface ThemeEntry {
2
+ name: string;
3
+ label: string;
4
+ description: string;
5
+ }
6
+ export declare function listThemes(): ThemeEntry[];
@@ -16,13 +16,19 @@ export interface ColorizeConfig {
16
16
  export interface HighlightConfig {
17
17
  target: string;
18
18
  }
19
+ /**
20
+ * An axis range bound. A string keeps the raw DSL value so each axis can parse
21
+ * it in its own unit space: a number on a value axis, a date on a
22
+ * date-detected category axis.
23
+ */
24
+ export interface AxisRange {
25
+ min?: number | string;
26
+ max?: number | string;
27
+ }
19
28
  export interface AxisOptions {
20
29
  direction?: AxisDirection;
21
30
  scaleType?: ScaleType;
22
- range?: {
23
- min?: number;
24
- max?: number;
25
- };
31
+ range?: AxisRange;
26
32
  ticks?: number[];
27
33
  showAxis?: boolean;
28
34
  showTicks?: boolean;
@@ -9,3 +9,34 @@ export interface ValueLabelFitInput {
9
9
  }
10
10
  export declare function estimateLabelWidth(text: string): number;
11
11
  export declare function shouldRenderValueLabel(input: ValueLabelFitInput): boolean;
12
+ /**
13
+ * Pixel width of a text's ink, never below the per-glyph floor: `measureText` is
14
+ * asked about 11px sans-serif while the chart renders in its own font, so an
15
+ * under-report is what lets a label cross a boundary it was measured to fit in.
16
+ */
17
+ export declare function estimateTextInk(text: string, font?: string): number;
18
+ export interface LabelViewport {
19
+ /** Plot extent in chart-area coordinates. */
20
+ width: number;
21
+ height: number;
22
+ /** Canvas margins around the plot, which the label may reach into. */
23
+ margin: {
24
+ top: number;
25
+ right: number;
26
+ bottom: number;
27
+ left: number;
28
+ };
29
+ }
30
+ /**
31
+ * Place a value label above a point mark, in chart-area coordinates, so its ink
32
+ * box stays inside the SVG viewport. Labels for line and area charts sit outside
33
+ * the plot clip, so nothing else stops the canvas edge from slicing one: a cut
34
+ * number reads as a smaller one, which is worse than a missing label.
35
+ *
36
+ * A mark the axis range excludes is labelled at the plot edge it was clipped to,
37
+ * matching what bar-horizontal does for the same case.
38
+ */
39
+ export declare function clampPointLabel(text: string, cx: number, cy: number, vp: LabelViewport): {
40
+ x: number;
41
+ y: number;
42
+ };
@@ -1,5 +1,10 @@
1
1
  import { PropertyNode, DataNode, SceneNode, ColorizeNode, HighlightNode, AnnotationNode, SeriesNode, AreaFillNode } from './types';
2
2
  import { ColorizeConfig, HighlightConfig, AnnotationConfig, AreaFillConfig, SeriesOverride } from '../charts/types';
3
+ /**
4
+ * A DSL boolean is case-insensitive: `validate.ts` lowercases before comparing,
5
+ * so `TRUE` passes validation and must resolve the same way here.
6
+ */
7
+ export declare const toBool: (v: unknown) => boolean;
3
8
  /**
4
9
  * Convert an array of AST property nodes into a key→value map.
5
10
  */
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Wrap a label, target, name or value in quotes for emission as DSL. Newlines
3
+ * and tabs are escaped rather than emitted raw: the data-string format read by
4
+ * `parseData` is line-oriented, so a raw newline inside a label costs the row.
5
+ */
6
+ export declare function quoteDslString(value: string): string;
7
+ /** Reverse of `quoteDslString`, for the escape set the grammar's `EscapeChar` accepts. */
8
+ export declare function unescapeDslString(value: string): string;
9
+ /** Strip the surrounding quotes of a quoted segment, if any, and unescape it. */
10
+ export declare function unquoteDslString(value: string): string;
11
+ /**
12
+ * Split on the commas that separate list entries, leaving alone the ones that
13
+ * belong to an entry: inside a quoted string (`"Paris, France"`) or inside a
14
+ * functional notation (`rgb(230,57,70)`).
15
+ */
16
+ export declare function splitTopLevelCommas(value: string): string[];
@@ -13,12 +13,18 @@ export interface PropertyNode {
13
13
  quotedKey?: boolean;
14
14
  /** `//` comment lines authored immediately above this node, text only (no `//`). */
15
15
  leadingComments?: string[];
16
+ /** `//` comment authored at the end of this node's own line, text only (no `//`). */
17
+ trailingComment?: string;
16
18
  }
17
19
  export interface DataNode {
18
20
  type: DslNodeType.Data;
19
21
  entries: PropertyNode[];
20
22
  /** `//` comment lines authored immediately above this node, text only (no `//`). */
21
23
  leadingComments?: string[];
24
+ /** `//` comment authored at the end of this node's own line, text only (no `//`). */
25
+ trailingComment?: string;
26
+ /** `//` comment lines authored after this block's last member, text only (no `//`). */
27
+ trailingComments?: string[];
22
28
  }
23
29
  export interface ColorizeNode {
24
30
  type: DslNodeType.Colorize;
@@ -27,6 +33,10 @@ export interface ColorizeNode {
27
33
  fromHighlight?: boolean;
28
34
  /** `//` comment lines authored immediately above this node, text only (no `//`). */
29
35
  leadingComments?: string[];
36
+ /** `//` comment authored at the end of this node's own line, text only (no `//`). */
37
+ trailingComment?: string;
38
+ /** `//` comment lines authored after this block's last member, text only (no `//`). */
39
+ trailingComments?: string[];
30
40
  }
31
41
  export interface HighlightNode {
32
42
  type: DslNodeType.Highlight;
@@ -34,6 +44,8 @@ export interface HighlightNode {
34
44
  properties: PropertyNode[];
35
45
  /** `//` comment lines authored immediately above this node, text only (no `//`). */
36
46
  leadingComments?: string[];
47
+ /** `//` comment authored at the end of this node's own line, text only (no `//`). */
48
+ trailingComment?: string;
37
49
  }
38
50
  export interface AreaFillNode {
39
51
  type: DslNodeType.AreaFill;
@@ -42,6 +54,10 @@ export interface AreaFillNode {
42
54
  properties: PropertyNode[];
43
55
  /** `//` comment lines authored immediately above this node, text only (no `//`). */
44
56
  leadingComments?: string[];
57
+ /** `//` comment authored at the end of this node's own line, text only (no `//`). */
58
+ trailingComment?: string;
59
+ /** `//` comment lines authored after this block's last member, text only (no `//`). */
60
+ trailingComments?: string[];
45
61
  }
46
62
  export interface PointAnnotationNode {
47
63
  type: DslNodeType.Annotation;
@@ -50,6 +66,10 @@ export interface PointAnnotationNode {
50
66
  properties: PropertyNode[];
51
67
  /** `//` comment lines authored immediately above this node, text only (no `//`). */
52
68
  leadingComments?: string[];
69
+ /** `//` comment authored at the end of this node's own line, text only (no `//`). */
70
+ trailingComment?: string;
71
+ /** `//` comment lines authored after this block's last member, text only (no `//`). */
72
+ trailingComments?: string[];
53
73
  }
54
74
  export interface RangeAnnotationNode {
55
75
  type: DslNodeType.Annotation;
@@ -57,6 +77,10 @@ export interface RangeAnnotationNode {
57
77
  properties: PropertyNode[];
58
78
  /** `//` comment lines authored immediately above this node, text only (no `//`). */
59
79
  leadingComments?: string[];
80
+ /** `//` comment authored at the end of this node's own line, text only (no `//`). */
81
+ trailingComment?: string;
82
+ /** `//` comment lines authored after this block's last member, text only (no `//`). */
83
+ trailingComments?: string[];
60
84
  }
61
85
  export interface FreeAnnotationNode {
62
86
  type: DslNodeType.Annotation;
@@ -64,6 +88,10 @@ export interface FreeAnnotationNode {
64
88
  properties: PropertyNode[];
65
89
  /** `//` comment lines authored immediately above this node, text only (no `//`). */
66
90
  leadingComments?: string[];
91
+ /** `//` comment authored at the end of this node's own line, text only (no `//`). */
92
+ trailingComment?: string;
93
+ /** `//` comment lines authored after this block's last member, text only (no `//`). */
94
+ trailingComments?: string[];
67
95
  }
68
96
  export type AnnotationNode = PointAnnotationNode | RangeAnnotationNode | FreeAnnotationNode;
69
97
  export interface SeriesNode {
@@ -72,6 +100,10 @@ export interface SeriesNode {
72
100
  properties: PropertyNode[];
73
101
  /** `//` comment lines authored immediately above this node, text only (no `//`). */
74
102
  leadingComments?: string[];
103
+ /** `//` comment authored at the end of this node's own line, text only (no `//`). */
104
+ trailingComment?: string;
105
+ /** `//` comment lines authored after this block's last member, text only (no `//`). */
106
+ trailingComments?: string[];
75
107
  }
76
108
  export interface SceneNode {
77
109
  type: DslNodeType.Scene;
@@ -86,6 +118,10 @@ export interface SceneNode {
86
118
  transforms: TransformNode[];
87
119
  /** `//` comment lines authored immediately above this node, text only (no `//`). */
88
120
  leadingComments?: string[];
121
+ /** `//` comment authored at the end of this node's own line, text only (no `//`). */
122
+ trailingComment?: string;
123
+ /** `//` comment lines authored after this block's last member, text only (no `//`). */
124
+ trailingComments?: string[];
89
125
  }
90
126
  export interface TransformNode {
91
127
  type: DslNodeType.Transform;
@@ -93,6 +129,10 @@ export interface TransformNode {
93
129
  properties: PropertyNode[];
94
130
  /** `//` comment lines authored immediately above this node, text only (no `//`). */
95
131
  leadingComments?: string[];
132
+ /** `//` comment authored at the end of this node's own line, text only (no `//`). */
133
+ trailingComment?: string;
134
+ /** `//` comment lines authored after this block's last member, text only (no `//`). */
135
+ trailingComments?: string[];
96
136
  }
97
137
  export interface ChartNode {
98
138
  type: DslNodeType.Chart;
@@ -106,4 +146,6 @@ export interface ChartNode {
106
146
  series: SeriesNode[];
107
147
  scenes: SceneNode[];
108
148
  transforms: TransformNode[];
149
+ /** `//` comment lines authored after this block's last member, text only (no `//`). */
150
+ trailingComments?: string[];
109
151
  }
@@ -23,6 +23,12 @@ export interface ValidationResult {
23
23
  * catches the `fromX`/`toX`-on-a-range bug.
24
24
  */
25
25
  export declare const POINT_ANNOTATION_KEYS: Set<string>;
26
+ /**
27
+ * Series override body property keys, derived from the keys
28
+ * convertSeriesOverrides() in converter.ts actually reads. Anything not listed
29
+ * never reaches SeriesOverride, so the renderer cannot honour it.
30
+ */
31
+ export declare const SERIES_OVERRIDE_KEYS: Set<string>;
26
32
  export declare const RANGE_ANNOTATION_KEYS: Set<string>;
27
33
  export declare const FREE_ANNOTATION_KEYS: Set<string>;
28
34
  /**
package/dist/embed.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, o as n, r, t as i } from "./runtime-BnrDRLyH.js";
1
+ import { a as e, i as t, o as n, r, t as i } from "./runtime-DDhsXDn5.js";
2
2
  export { r as ERROR_MESSAGE, t as RESIZE_MESSAGE, i as buildSrcdoc, e as isErrorMessage, n as readResizeHeight };
package/dist/enums.d.ts CHANGED
@@ -192,3 +192,26 @@ export declare enum DslNodeType {
192
192
  Transform = "transform",
193
193
  Chart = "chart"
194
194
  }
195
+ export declare enum TransformType {
196
+ Sort = "sort",
197
+ Filter = "filter",
198
+ HideColumns = "hide-columns",
199
+ Transpose = "transpose",
200
+ Parse = "parse",
201
+ Rename = "rename",
202
+ GroupBy = "group-by",
203
+ Computed = "computed"
204
+ }
205
+ export declare enum FilterCondition {
206
+ Equals = "equals",
207
+ NotEquals = "not-equals",
208
+ Contains = "contains",
209
+ GreaterThan = "greater-than",
210
+ LessThan = "less-than"
211
+ }
212
+ export declare enum ParseOperationCategory {
213
+ Type = "type",
214
+ String = "string",
215
+ Numeric = "numeric",
216
+ Date = "date"
217
+ }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { ChartType, AxisDirection, ScaleType, GridStyle, LabelPosition, LabelRotation, TickPosition, FrameSizing, CompassDirection, AnnotationLineStyle, StrokeStyle, AnnotationKind, RangeAnchor, Orientation, SymbolShape, SymbolShowOn, SymbolStyle, SortDirection, SortMode, LegendPosition, Anchor, ValueLabelPosition, CrosshairDirection, CrosshairStyle, StackMode, LineStyle, ChartOptionType, DirectLabelMode, Interpolation, DslNodeType, } from './enums';
1
+ export { ChartType, AxisDirection, ScaleType, GridStyle, LabelPosition, LabelRotation, TickPosition, FrameSizing, CompassDirection, AnnotationLineStyle, StrokeStyle, AnnotationKind, RangeAnchor, Orientation, SymbolShape, SymbolShowOn, SymbolStyle, SortDirection, SortMode, LegendPosition, Anchor, ValueLabelPosition, CrosshairDirection, CrosshairStyle, StackMode, LineStyle, ChartOptionType, DirectLabelMode, Interpolation, DslNodeType, TransformType, FilterCondition, ParseOperationCategory, } from './enums';
2
2
  export { ANNOTATION_KIND_KEYWORD } from './enums';
3
3
  export type { ChartData, ChartOptions, ChartRenderer, ChartOptionDef, ChartTypeOptions, ChartTypeOptionKey, ColorizeConfig, HighlightConfig, AxisOptions, FrameOptions, AreaFillConfig, AnnotationConfig, PointAnnotationConfig, RangeAnnotationConfig, FreeAnnotationConfig, AnnotationLineConfig, LineSymbolConfig, SeriesOverride, Margin, } from './charts/types';
4
4
  export { createFrame } from './charts/frame/frame';
@@ -19,6 +19,8 @@ export { getChartTypeDefaults, resolveChartTypeOptions } from './charts/resolve'
19
19
  export { resolveBarGapPadding, DEFAULT_BAR_GAP } from './charts/scale-helpers';
20
20
  export { resolvePalette, listPalettes } from './charts/palettes';
21
21
  export type { PaletteEntry } from './charts/palettes';
22
+ export { listThemes } from './charts/themes';
23
+ export type { ThemeEntry } from './charts/themes';
22
24
  export { resolveSeriesColor, resolveSeriesInterpolation, isSeriesHidden } from './charts/series-helpers';
23
25
  export { resolveBackgroundColor, adjustColorsForBackground, wcagContrastRatio, wcagLevel } from './charts/contrast';
24
26
  export { getTransitionDuration, snapshotForFadeOut, commitFadeOut, fadeIn } from './charts/motion';
@@ -27,15 +29,21 @@ export { getCvdFilterId, createCvdSvgFilter, simulateCvdColor, checkCvdColors }
27
29
  export type { CvdType, CvdIssue } from './charts/colorblind';
28
30
  export { parse } from './dsl/parser';
29
31
  export { serialize, compactSerialize, compactSerializeDeep } from './dsl/serializer';
32
+ export { quoteDslString } from './dsl/quoting';
33
+ export { toBool } from './dsl/converter';
30
34
  export { propertyMap, extractChartTypeOptions, dataEntriesToString, extractSceneOverrides, convertColorizes, convertHighlights, convertAreaFills, convertAnnotations, convertSeriesOverrides } from './dsl/converter';
31
35
  export type { AnnotationNode, PointAnnotationNode, RangeAnnotationNode, FreeAnnotationNode, AreaFillNode, ChartNode, DataNode, ColorizeNode, HighlightNode, PropertyNode, SceneNode, SeriesNode, TransformNode } from './dsl/types';
32
36
  export { validateChart } from './dsl/validate';
33
37
  export type { ValidationIssue, ValidationResult } from './dsl/validate';
38
+ export { TRANSFORM_TYPES, applyTransformSteps, applyTransformNodes, applyTransformNodesToChartData, transformNodesToSteps, transformValue, parseOperations, parseOperationMap, isTypeCompatible, getOutputType, NULL_VALUE, parseBpcData, serializeTableData, chartDataToTable, detectColumnTypes, cleanNumericValue, isDateValue, isNumberValue, } from './transforms';
39
+ export type { ParseOperation, TransformResult, TransformStep } from './transforms';
34
40
  export { samples } from './samples';
35
41
  export type { ChartSample } from './samples';
36
42
  export { renderBpc, renderChart, astToDefinition, resolveScene, render } from './render';
37
43
  export type { ChartDefinition, RenderOptions, ResolvedChartState, ChartHandle, RenderApiOptions, OutputOptions } from './render';
38
44
  export { ChartParseError, PngBrowserUnsupportedError, MissingNodeRenderDepsError } from './render';
45
+ export { buildFrameSvg } from './render';
46
+ export type { FrameSvgLayout, FrameSvgTextBlock, FrameSvgPlot, ChartAccessibility } from './render';
39
47
  export { buildSrcdoc } from './runtime/runtime';
40
48
  export { SceneTransition, getSceneTransition, featureJoin, snapshotLiveAttrs, BC_TRANSITION_NAME, } from './transitions';
41
49
  export type { CommitOptions, TransitionMode, SceneTransitionState, FeatureRole, FeatureJoinConfig, AttrMap, AttrValue, } from './transitions';