@lostgradient/cinder 0.22.0 → 0.23.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 (164) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/components.json +1 -1
  3. package/dist/_internal/chart/chart-bar-model.d.ts +24 -0
  4. package/dist/_internal/chart/chart-cartesian-model.d.ts +16 -0
  5. package/dist/_internal/chart/chart-layout.d.ts +23 -0
  6. package/dist/_internal/chart/chart-model-utilities.d.ts +157 -0
  7. package/dist/_internal/chart/chart-scale.d.ts +37 -0
  8. package/dist/_internal/chart/chart-utilities.d.ts +7 -164
  9. package/dist/_internal/chart/heatmap-utilities.d.ts +5 -4
  10. package/dist/components/_internal/chart-tooltip.css +21 -0
  11. package/dist/components/_internal/chart-tooltip.svelte.d.ts +11 -0
  12. package/dist/components/approval-card/index.js +5 -5
  13. package/dist/components/area-chart/area-chart.css +27 -23
  14. package/dist/components/area-chart/area-chart.schema.js +38 -1
  15. package/dist/components/area-chart/area-chart.types.d.ts +6 -2
  16. package/dist/components/area-chart/index.js +1589 -768
  17. package/dist/components/badge/badge.css +2 -2
  18. package/dist/components/badge/badge.schema.js +2 -2
  19. package/dist/components/badge/badge.types.d.ts +3 -3
  20. package/dist/components/badge/index.js +4 -4
  21. package/dist/components/bar-chart/bar-chart.css +27 -21
  22. package/dist/components/bar-chart/bar-chart.schema.js +38 -1
  23. package/dist/components/bar-chart/bar-chart.types.d.ts +7 -3
  24. package/dist/components/bar-chart/index.js +1544 -740
  25. package/dist/components/chart.types.d.ts +98 -2
  26. package/dist/components/json-schema-editor/index.js +4 -4
  27. package/dist/components/line-chart/index.js +1587 -785
  28. package/dist/components/line-chart/line-chart.css +25 -24
  29. package/dist/components/line-chart/line-chart.schema.js +38 -1
  30. package/dist/components/line-chart/line-chart.types.d.ts +6 -2
  31. package/dist/components/matrix-chart/index.js +1038 -429
  32. package/dist/components/matrix-chart/matrix-chart.css +12 -6
  33. package/dist/components/matrix-chart/matrix-chart.schema.js +26 -1
  34. package/dist/components/matrix-chart/matrix-chart.types.d.ts +5 -1
  35. package/dist/components/payload-inspector/index.js +4 -4
  36. package/dist/components/run-step-timeline/index.js +6 -6
  37. package/dist/components/sparkbar/index.js +1291 -4
  38. package/dist/components/sparkbar/sparkbar.css +5 -4
  39. package/dist/components/sparkbar/sparkbar.schema.js +26 -1
  40. package/dist/components/sparkbar/sparkbar.types.d.ts +5 -0
  41. package/dist/components/spectrogram/index.js +1076 -437
  42. package/dist/components/spectrogram/spectrogram.css +7 -6
  43. package/dist/components/spectrogram/spectrogram.schema.js +26 -1
  44. package/dist/components/spectrogram/spectrogram.types.d.ts +5 -1
  45. package/dist/components/spectrum-chart/index.js +1037 -423
  46. package/dist/components/spectrum-chart/spectrum-chart.css +8 -7
  47. package/dist/components/spectrum-chart/spectrum-chart.schema.js +26 -1
  48. package/dist/components/spectrum-chart/spectrum-chart.types.d.ts +5 -1
  49. package/dist/components/statistic/index.js +1284 -2
  50. package/dist/components/statistic/statistic.css +6 -5
  51. package/dist/components/statistic/statistic.schema.js +26 -1
  52. package/dist/components/statistic/statistic.types.d.ts +5 -0
  53. package/dist/components/statistic-group/index.js +1284 -2
  54. package/dist/components/waveform/index.js +1004 -404
  55. package/dist/components/waveform/waveform.css +8 -7
  56. package/dist/components/waveform/waveform.schema.js +26 -1
  57. package/dist/components/waveform/waveform.types.d.ts +5 -1
  58. package/dist/index.d.ts +1 -1
  59. package/dist/index.js +17730 -16540
  60. package/dist/server/components/approval-card/index.js +3 -3
  61. package/dist/server/components/area-chart/index.js +3 -3
  62. package/dist/server/components/badge/index.js +2 -2
  63. package/dist/server/components/bar-chart/index.js +3 -3
  64. package/dist/server/components/json-schema-editor/index.js +2 -2
  65. package/dist/server/components/line-chart/index.js +3 -3
  66. package/dist/server/components/matrix-chart/index.js +3 -3
  67. package/dist/server/components/payload-inspector/index.js +3 -3
  68. package/dist/server/components/run-step-timeline/index.js +2 -2
  69. package/dist/server/components/sparkbar/index.js +3 -2
  70. package/dist/server/components/spectrogram/index.js +3 -3
  71. package/dist/server/components/spectrum-chart/index.js +2 -2
  72. package/dist/server/components/statistic/index.js +4 -3
  73. package/dist/server/components/statistic-group/index.js +4 -3
  74. package/dist/server/components/waveform/index.js +2 -2
  75. package/dist/server/index.js +21 -21
  76. package/dist/server/{index.server-3dkwzkd3.js → index.server-10r7yf13.js} +110 -27
  77. package/dist/server/{index.server-93943z3e.js → index.server-151dt1tx.js} +1 -1
  78. package/dist/server/{index.server-pp2n6def.js → index.server-2y0xz53g.js} +37 -14
  79. package/dist/server/{index.server-bd8rcgf0.js → index.server-4hvjet4z.js} +1 -1
  80. package/dist/server/{index.server-bsm39gpy.js → index.server-5d83fkyg.js} +75 -21
  81. package/dist/server/{index.server-4wweyb2e.js → index.server-8dh2rtnc.js} +1 -1
  82. package/dist/server/{index.server-abqbstkt.js → index.server-9gj583qs.js} +41 -14
  83. package/dist/server/{index.server-2nmwsacy.js → index.server-9scm7zf9.js} +4 -4
  84. package/dist/server/{index.server-5j6jv7rm.js → index.server-9vwxyy06.js} +108 -29
  85. package/dist/server/{index.server-abjsjsw8.js → index.server-afpjvfz1.js} +111 -35
  86. package/dist/server/{index.server-86sw5ea6.js → index.server-dw9bz17h.js} +4 -4
  87. package/dist/server/{index.server-d26jzn2m.js → index.server-en31rprd.js} +3 -3
  88. package/dist/server/{index.server-dx58qant.js → index.server-f3a0ecqg.js} +72 -9
  89. package/dist/server/{index.server-d63pwytk.js → index.server-kz8aeeq5.js} +18 -10
  90. package/dist/server/index.server-mmmrgvyd.js +1274 -0
  91. package/dist/server/{index.server-1221p7e4.js → index.server-scahngwv.js} +13 -1
  92. package/dist/server/{index.server-nj8kk5bv.js → index.server-t73q59c1.js} +1 -1
  93. package/dist/server/{index.server-5schb2vt.js → index.server-tdrncj5e.js} +16 -6
  94. package/dist/server/{index.server-wm8957be.js → index.server-veqke4sq.js} +10 -1
  95. package/dist/server/{index.server-fphvzcfb.js → index.server-wqajghn9.js} +1 -1
  96. package/dist/server/{index.server-yd9shwqq.js → index.server-zjcjzcv6.js} +1 -1
  97. package/package.json +1 -1
  98. package/src/_internal/chart/chart-bar-model.ts +330 -0
  99. package/src/_internal/chart/chart-cartesian-model.ts +450 -0
  100. package/src/_internal/chart/chart-interaction.svelte.ts +25 -6
  101. package/src/_internal/chart/chart-layout.ts +348 -0
  102. package/src/_internal/chart/chart-model-utilities.ts +357 -0
  103. package/src/_internal/chart/chart-scale.ts +487 -0
  104. package/src/_internal/chart/chart-utilities.ts +22 -1078
  105. package/src/_internal/chart/heatmap-utilities.ts +21 -17
  106. package/src/components/_internal/chart-tooltip.css +21 -0
  107. package/src/components/_internal/chart-tooltip.svelte +44 -0
  108. package/src/components/approval-card/approval-card.svelte +1 -1
  109. package/src/components/area-chart/area-chart.css +27 -23
  110. package/src/components/area-chart/area-chart.examples.json +1 -1
  111. package/src/components/area-chart/area-chart.schema.json +37 -0
  112. package/src/components/area-chart/area-chart.schema.ts +40 -0
  113. package/src/components/area-chart/area-chart.svelte +103 -35
  114. package/src/components/area-chart/area-chart.types.ts +7 -1
  115. package/src/components/badge/badge.css +2 -2
  116. package/src/components/badge/badge.schema.json +1 -1
  117. package/src/components/badge/badge.schema.ts +1 -1
  118. package/src/components/badge/badge.svelte +2 -2
  119. package/src/components/badge/badge.types.ts +3 -3
  120. package/src/components/bar-chart/bar-chart.css +27 -21
  121. package/src/components/bar-chart/bar-chart.schema.json +37 -0
  122. package/src/components/bar-chart/bar-chart.schema.ts +40 -0
  123. package/src/components/bar-chart/bar-chart.svelte +94 -33
  124. package/src/components/bar-chart/bar-chart.types.ts +9 -2
  125. package/src/components/chart.types.ts +112 -2
  126. package/src/components/line-chart/line-chart.css +25 -24
  127. package/src/components/line-chart/line-chart.examples.json +1 -1
  128. package/src/components/line-chart/line-chart.schema.json +37 -0
  129. package/src/components/line-chart/line-chart.schema.ts +40 -0
  130. package/src/components/line-chart/line-chart.svelte +95 -40
  131. package/src/components/line-chart/line-chart.types.ts +7 -1
  132. package/src/components/matrix-chart/matrix-chart.css +12 -6
  133. package/src/components/matrix-chart/matrix-chart.schema.json +25 -0
  134. package/src/components/matrix-chart/matrix-chart.schema.ts +25 -0
  135. package/src/components/matrix-chart/matrix-chart.svelte +30 -12
  136. package/src/components/matrix-chart/matrix-chart.types.ts +5 -1
  137. package/src/components/run-step-timeline/run-step-timeline.svelte +2 -2
  138. package/src/components/sparkbar/sparkbar.css +5 -4
  139. package/src/components/sparkbar/sparkbar.schema.json +25 -0
  140. package/src/components/sparkbar/sparkbar.schema.ts +26 -0
  141. package/src/components/sparkbar/sparkbar.svelte +8 -1
  142. package/src/components/sparkbar/sparkbar.types.ts +5 -0
  143. package/src/components/spectrogram/spectrogram.css +7 -6
  144. package/src/components/spectrogram/spectrogram.schema.json +25 -0
  145. package/src/components/spectrogram/spectrogram.schema.ts +25 -0
  146. package/src/components/spectrogram/spectrogram.svelte +73 -28
  147. package/src/components/spectrogram/spectrogram.types.ts +5 -1
  148. package/src/components/spectrum-chart/spectrum-chart.css +8 -7
  149. package/src/components/spectrum-chart/spectrum-chart.schema.json +25 -0
  150. package/src/components/spectrum-chart/spectrum-chart.schema.ts +26 -0
  151. package/src/components/spectrum-chart/spectrum-chart.svelte +38 -12
  152. package/src/components/spectrum-chart/spectrum-chart.types.ts +5 -1
  153. package/src/components/statistic/statistic.css +6 -5
  154. package/src/components/statistic/statistic.schema.json +25 -0
  155. package/src/components/statistic/statistic.schema.ts +26 -0
  156. package/src/components/statistic/statistic.svelte +6 -1
  157. package/src/components/statistic/statistic.types.ts +5 -0
  158. package/src/components/waveform/waveform.css +8 -7
  159. package/src/components/waveform/waveform.schema.json +25 -0
  160. package/src/components/waveform/waveform.schema.ts +26 -0
  161. package/src/components/waveform/waveform.svelte +16 -3
  162. package/src/components/waveform/waveform.types.ts +5 -1
  163. package/src/index.ts +8 -0
  164. package/dist/server/index.server-6vbpz6dd.js +0 -690
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # @lostgradient/cinder
2
2
 
3
+ ## 0.23.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1254](https://github.com/stevekinney/cinder/pull/1254) [`0db00f8`](https://github.com/stevekinney/cinder/commit/0db00f891e94ab9c9c4776af1608654b03003de0) Thanks [@stevekinney](https://github.com/stevekinney)! - feat(badge)!: rename `monochrome` to `monospace` ([#1251](https://github.com/stevekinney/cinder/issues/1251))
8
+
9
+ BREAKING: Badge's `monochrome` prop is renamed to `monospace`, and the
10
+ `data-cinder-monochrome` attribute (CSS/test hook) to
11
+ `data-cinder-monospace`. No compatibility alias — cinder is pre-release.
12
+
13
+ The prop has always rendered the badge label in a monospace font (version
14
+ strings, error codes, commit SHAs); the `monochrome` name came from the
15
+ 0.22 no-abbreviations sweep expanding the old `mono` to the wrong full
16
+ word — "monochrome" is color vocabulary, not typeface vocabulary.
17
+ `check:prop-conventions` now bans both `mono` and `monochrome` with
18
+ pointed messages, so a stale name fails the gate instead of silently
19
+ type-erroring. Internal consumers (RunStepTimeline's attempt badges,
20
+ ApprovalCard's environment badge) are migrated.
21
+
22
+ Also repaired in the same sweep-audit: comments and an identifier mangled
23
+ by the original blanket replace (`monorepoRoot` had become
24
+ `monochromerepoRoot` in `run-consumer-fixture.ts`, "monorepo root" had
25
+ become "monochromerepo root" in a toast-region test comment, and the
26
+ playground's `dx-spec__val--mono` class had become `--monochrome` while
27
+ still applying `--cinder-font-mono`).
28
+
29
+ - [#1248](https://github.com/stevekinney/cinder/pull/1248) [`649a5ee`](https://github.com/stevekinney/cinder/commit/649a5eea8056501f009aeee2b7f32e52ed67c595) Thanks [@stevekinney](https://github.com/stevekinney)! - Unify Cinder charts around a shared SVG scene model with measured guide spacing,
30
+ stable interaction targets, bounded high-cardinality rendering, opt-in tooltips,
31
+ custom mark snippets, and inheritable theme and palette overrides. Apply the
32
+ same theme contract across matrix, audio, Sparkbar, and Statistic displays.
33
+
3
34
  ## 0.22.0
4
35
 
5
36
  ### Minor Changes
package/components.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "manifestVersion": 1,
4
4
  "package": {
5
5
  "name": "@lostgradient/cinder",
6
- "version": "0.22.0",
6
+ "version": "0.23.0",
7
7
  "framework": "svelte",
8
8
  "frameworkVersionRange": ">=5.56.0 <6",
9
9
  "classPrefix": "cinder-",
@@ -0,0 +1,24 @@
1
+ import type { BarChartDatum, BarChartMode, BarChartOrientation, BarChartSeries, ChartAxisConfiguration, ChartTheme, ChartXAxisConfiguration } from '../../components/chart.types.ts';
2
+ import { type BarChartModel } from './chart-model-utilities.ts';
3
+ export declare function createBarModel(options: {
4
+ data: BarChartDatum[];
5
+ categoryKey: string;
6
+ series: BarChartSeries[];
7
+ hiddenSeriesIds: string[];
8
+ width: number;
9
+ height: number;
10
+ orientation: BarChartOrientation;
11
+ mode: BarChartMode;
12
+ xAxis?: ChartXAxisConfiguration | undefined;
13
+ yAxis?: ChartAxisConfiguration | undefined;
14
+ theme?: ChartTheme | undefined;
15
+ measureText?: boolean | undefined;
16
+ measurementElement?: Element | undefined;
17
+ measurementVersion?: number | undefined;
18
+ }): BarChartModel;
19
+ /**
20
+ * Locates the target closest to a (x, y) pointer. Uses binary search on the
21
+ * provided `axis` (defaults to `x`) — targets MUST be sorted ascending on that
22
+ * axis (createCartesianModel and createBarModel guarantee this). Falls back to
23
+ * a linear scan when targets are empty.
24
+ */
@@ -0,0 +1,16 @@
1
+ import type { ChartAxisConfiguration, ChartCartesianSeries, ChartTheme, ChartXAxisConfiguration } from '../../components/chart.types.ts';
2
+ import { type CartesianChartModel } from './chart-model-utilities.ts';
3
+ export declare function createCartesianModel(options: {
4
+ componentId: 'line-chart' | 'area-chart';
5
+ series: ChartCartesianSeries[];
6
+ hiddenSeriesIds: string[];
7
+ width: number;
8
+ height: number;
9
+ xAxis?: ChartXAxisConfiguration | undefined;
10
+ yAxis?: ChartAxisConfiguration | undefined;
11
+ stackedArea?: boolean;
12
+ theme?: ChartTheme | undefined;
13
+ measureText?: boolean | undefined;
14
+ measurementElement?: Element | undefined;
15
+ measurementVersion?: number | undefined;
16
+ }): CartesianChartModel;
@@ -0,0 +1,23 @@
1
+ import type { ChartAxisConfiguration, ChartXAxisConfiguration } from '../../components/chart.types.ts';
2
+ import type { ChartGeometry } from './chart-model-utilities.ts';
3
+ export declare const HORIZONTAL_CATEGORY_LABEL_GAP = 8;
4
+ export type ChartGeometryOptions = {
5
+ xTickLabels?: string[];
6
+ yTickLabels?: string[];
7
+ xAxis?: ChartXAxisConfiguration | undefined;
8
+ yAxis?: ChartAxisConfiguration | undefined;
9
+ marginLeft?: number | undefined;
10
+ /** Enable browser text measurement after mount; defaults to deterministic fallback metrics. */
11
+ measureText?: boolean | undefined;
12
+ /** Mounted chart root whose inherited typography should be used for browser measurement. */
13
+ measurementElement?: Element | undefined;
14
+ /** Invalidates cached measurements after web-font loading changes. */
15
+ measurementVersion?: number | undefined;
16
+ xTickPosition?: 'top' | 'bottom';
17
+ };
18
+ export declare function createChartGeometry(width: number, height: number, options?: ChartGeometryOptions): ChartGeometry;
19
+ export declare function createHorizontalCategoryLabelLayout(labels: string[], chartWidth: number, options?: Pick<ChartGeometryOptions, 'measureText' | 'measurementElement' | 'measurementVersion'>): {
20
+ labels: string[];
21
+ marginLeft: number;
22
+ };
23
+ export declare function observeChartFontLoading(onFontsChanged: () => void): () => void;
@@ -0,0 +1,157 @@
1
+ import type { ChartAxisConfiguration, ChartDataTableVisibility, ChartFormatterContext, ChartLegendPosition, ChartNumericValue, ChartPoint, ChartTheme, ChartXValue, ResolvedChartTheme } from '../../components/chart.types.ts';
2
+ export declare const chartPalette: readonly ["var(--cinder-chart-series-1)", "var(--cinder-chart-series-2)", "var(--cinder-chart-series-3)", "var(--cinder-chart-series-4)", "var(--cinder-chart-series-5)", "var(--cinder-chart-series-6)", "var(--cinder-chart-series-7)", "var(--cinder-chart-series-8)"];
3
+ /**
4
+ * Resolves a palette color for a series by index, wrapping around the palette.
5
+ * Exported so chart components can render legend swatches using the same
6
+ * resolved color the chart uses for the series itself.
7
+ */
8
+ export declare function chartPaletteColor(index: number, palette?: readonly string[]): string;
9
+ export declare function resolveChartTheme(theme?: ChartTheme | undefined): ResolvedChartTheme;
10
+ export declare function chartResourceId(idPrefix: string, resource: string, seriesId: string): string;
11
+ export type ChartMark = {
12
+ type: 'line';
13
+ data: ChartPoint[];
14
+ stroke?: string;
15
+ strokeWidth?: number;
16
+ } | {
17
+ type: 'area';
18
+ data: ChartPoint[];
19
+ fill?: string;
20
+ fillOpacity?: number;
21
+ } | {
22
+ type: 'bar';
23
+ data: ChartPoint[];
24
+ fill?: string;
25
+ } | {
26
+ type: 'point';
27
+ data: ChartPoint[];
28
+ fill?: string;
29
+ radius?: number;
30
+ };
31
+ export type NormalizedXValue = {
32
+ raw: ChartXValue;
33
+ key: string;
34
+ label: string;
35
+ comparable: string | number;
36
+ kind: 'string' | 'number' | 'date';
37
+ };
38
+ export type NormalizedPoint = {
39
+ seriesId: string;
40
+ seriesLabel: string;
41
+ color: string;
42
+ x: NormalizedXValue;
43
+ y: number | null;
44
+ originalY: ChartNumericValue;
45
+ index: number;
46
+ };
47
+ /**
48
+ * A point that has been placed in pixel space by the chart model. Components
49
+ * read `pixelX`/`pixelY` directly without a secondary lookup against targets;
50
+ * filled marks use `pixelY0` as their resolved lower baseline.
51
+ */
52
+ export type PlacedPoint = NormalizedPoint & {
53
+ pixelX: number;
54
+ pixelY: number;
55
+ pixelY0: number;
56
+ };
57
+ export type ChartTarget = {
58
+ id: string;
59
+ seriesId: string;
60
+ seriesLabel: string;
61
+ xLabel: string;
62
+ valueLabel: string;
63
+ x: number;
64
+ y: number;
65
+ width?: number;
66
+ height?: number;
67
+ color: string;
68
+ };
69
+ export type ChartGeometry = {
70
+ plotWidth: number;
71
+ plotHeight: number;
72
+ marginTop: number;
73
+ marginRight: number;
74
+ marginBottom: number;
75
+ marginLeft: number;
76
+ };
77
+ export type CartesianChartTableRow = {
78
+ id: string;
79
+ seriesId: string;
80
+ seriesLabel: string;
81
+ xLabel: string;
82
+ valueLabel: string;
83
+ };
84
+ export type BarChartTableRow = {
85
+ categoryKey: string;
86
+ categoryLabel: string;
87
+ values: Array<{
88
+ seriesId: string;
89
+ seriesLabel: string;
90
+ valueLabel: string;
91
+ }>;
92
+ };
93
+ export type ChartTableRow = CartesianChartTableRow | BarChartTableRow;
94
+ export type ChartSceneModel<TTableRow extends ChartTableRow = ChartTableRow> = {
95
+ geometry: ChartGeometry;
96
+ targets: ChartTarget[];
97
+ tableRows: TTableRow[];
98
+ empty: boolean;
99
+ };
100
+ /**
101
+ * An x-axis tick paired with its already-scaled pixel position. Charts render
102
+ * labels at the model-provided `x` so labels and points stay aligned for
103
+ * numeric and date domains.
104
+ */
105
+ export type ChartXTick = {
106
+ label: string;
107
+ x: number;
108
+ };
109
+ export type CartesianChartModel = ChartSceneModel<CartesianChartTableRow> & {
110
+ /** Pre-scaled x-axis ticks. Render labels at `tick.x`, not by ordinal index. */
111
+ xTicks: ChartXTick[];
112
+ yTicks: number[];
113
+ normalizedSeries: Array<{
114
+ id: string;
115
+ label: string;
116
+ color: string;
117
+ points: PlacedPoint[];
118
+ path: string;
119
+ areaPath: string;
120
+ hidden: boolean;
121
+ }>;
122
+ /** Targets sorted by `x` (binary-search precondition for nearestTarget). */
123
+ yDomain: [number, number];
124
+ theme: ResolvedChartTheme;
125
+ marks: Array<{
126
+ seriesId: string;
127
+ descriptors: ChartMark[];
128
+ }>;
129
+ };
130
+ export type BarChartModel = ChartSceneModel<BarChartTableRow> & {
131
+ categories: NormalizedXValue[];
132
+ yTicks: number[];
133
+ categoryTicks: Array<{
134
+ categoryKey: string;
135
+ label: string;
136
+ fullLabel: string;
137
+ x: number;
138
+ y: number;
139
+ }>;
140
+ bars: import('../../components/chart.types.ts').BarChartPlacedBar[];
141
+ valueDomain: [number, number];
142
+ theme: ResolvedChartTheme;
143
+ };
144
+ export declare function assertValidChartNumber(componentId: string, rule: string, value: number, label: string): void;
145
+ export declare function assertValidNonNegativeInteger(componentId: string, rule: string, value: number, label: string): void;
146
+ export declare function assertValidTickCount(componentId: string, axis?: ChartAxisConfiguration): void;
147
+ export declare function dataTableClass(visibility: ChartDataTableVisibility): string | undefined;
148
+ export declare function formatDataTableCaption(caption: string, displayedRowCount: number, totalRowCount: number): string;
149
+ export declare function formatXValue(value: NormalizedXValue, axis: ChartAxisConfiguration | undefined, context: ChartFormatterContext): string;
150
+ export declare function formatNumericValue(value: number, axis: ChartAxisConfiguration | undefined, formatter: ((value: number, context: ChartFormatterContext) => string) | undefined, context: ChartFormatterContext): string;
151
+ export declare function normalizeXValue(value: ChartXValue): NormalizedXValue;
152
+ export declare function assertUniqueSeriesIds(componentId: string, series: Array<{
153
+ id: string;
154
+ }>): void;
155
+ export declare function toggleSeriesId(hiddenSeriesIds: string[], seriesId: string): string[];
156
+ export declare function nearestTarget(targets: readonly ChartTarget[], x: number, y: number, axis?: 'x' | 'y'): ChartTarget | undefined;
157
+ export declare function legendVisible(legendPosition: ChartLegendPosition, seriesCount: number): boolean;
@@ -0,0 +1,37 @@
1
+ import type { BarChartDatum, BarChartSeries, ChartNumericValue } from '../../components/chart.types.ts';
2
+ import type { NormalizedXValue, PlacedPoint } from './chart-model-utilities.ts';
3
+ export declare const MAXIMUM_RENDERED_SERIES_POINTS = 2000;
4
+ export type LayerDecimationSelection = {
5
+ sourceIndex: number;
6
+ forceGapLayerIndices: readonly number[];
7
+ };
8
+ export declare function decimationIndices(points: PlacedPoint[], maximumPoints?: number): number[];
9
+ export declare function decimationIndicesForLayers(layers: ReadonlyArray<ReadonlyArray<number | null>>, maximumPoints?: number): LayerDecimationSelection[];
10
+ export declare function decimatePlacedPoints(points: PlacedPoint[], maximumPoints?: number): PlacedPoint[];
11
+ export declare function normalizeNumericValue(componentId: string, seriesId: string, xLabel: string, value: ChartNumericValue): number | null;
12
+ export declare function sortXValues(values: NormalizedXValue[]): NormalizedXValue[];
13
+ export declare function createPaddedDomain(values: number[]): [number, number];
14
+ export type LinearScale = ((value: number) => number) & {
15
+ ticks: (count: number) => number[];
16
+ };
17
+ export type BandlikeScale = ((value: string) => number | undefined) & {
18
+ bandwidth?: () => number;
19
+ };
20
+ export type BandScale = ((value: string) => number | undefined) & {
21
+ bandwidth: () => number;
22
+ };
23
+ export declare function createLinearScale(domain: [number, number], range: [number, number]): LinearScale;
24
+ export declare function createPointScale(domain: string[], range: [number, number], padding: number): BandlikeScale;
25
+ export declare function createBandScale(domain: string[], range: [number, number], padding: number): BandScale;
26
+ export declare function createNumericDomain(values: NormalizedXValue[]): [number, number];
27
+ export declare function createTicks(domain: [number, number], count: number): number[];
28
+ export declare function createLinePath(points: Array<{
29
+ x: number;
30
+ y: number | null;
31
+ }>): string;
32
+ export declare function createAreaPath(points: Array<{
33
+ x: number;
34
+ y: number | null;
35
+ y0?: number;
36
+ }>, baseline: number | undefined): string;
37
+ export declare function createStackedBarDomainValues(datumByKey: Map<string, BarChartDatum>, categories: NormalizedXValue[], series: BarChartSeries[]): number[];
@@ -1,164 +1,7 @@
1
- import type { BarChartDatum, BarChartMode, BarChartOrientation, BarChartSeries, ChartAxisConfiguration, ChartCartesianSeries, ChartDataTableVisibility, ChartFormatterContext, ChartLegendPosition, ChartNumericValue, ChartXValue } from '../../components/chart.types.ts';
2
- export declare const chartPalette: readonly ["var(--cinder-chart-series-1)", "var(--cinder-chart-series-2)", "var(--cinder-chart-series-3)", "var(--cinder-chart-series-4)", "var(--cinder-chart-series-5)", "var(--cinder-chart-series-6)", "var(--cinder-chart-series-7)", "var(--cinder-chart-series-8)"];
3
- /**
4
- * Resolves a palette color for a series by index, wrapping around the palette.
5
- * Exported so chart components can render legend swatches using the same
6
- * resolved color the chart uses for the series itself.
7
- */
8
- export declare function chartPaletteColor(index: number): string;
9
- export type NormalizedXValue = {
10
- raw: ChartXValue;
11
- key: string;
12
- label: string;
13
- comparable: string | number;
14
- kind: 'string' | 'number' | 'date';
15
- };
16
- export type NormalizedPoint = {
17
- seriesId: string;
18
- seriesLabel: string;
19
- color: string;
20
- x: NormalizedXValue;
21
- y: number | null;
22
- originalY: ChartNumericValue;
23
- index: number;
24
- };
25
- /**
26
- * A point that has been placed in pixel space by the chart model. Components
27
- * read `pixelX`/`pixelY` directly without a secondary lookup against targets.
28
- */
29
- export type PlacedPoint = NormalizedPoint & {
30
- pixelX: number;
31
- pixelY: number;
32
- };
33
- export type ChartTarget = {
34
- id: string;
35
- seriesId: string;
36
- seriesLabel: string;
37
- xLabel: string;
38
- valueLabel: string;
39
- x: number;
40
- y: number;
41
- width?: number;
42
- height?: number;
43
- color: string;
44
- };
45
- export type ChartGeometry = {
46
- plotWidth: number;
47
- plotHeight: number;
48
- marginTop: number;
49
- marginRight: number;
50
- marginBottom: number;
51
- marginLeft: number;
52
- };
53
- /**
54
- * An x-axis tick paired with its already-scaled pixel position. Charts render
55
- * labels at the model-provided `x` so labels and points stay aligned for
56
- * numeric and date domains.
57
- */
58
- export type ChartXTick = {
59
- label: string;
60
- x: number;
61
- };
62
- export type CartesianChartModel = {
63
- geometry: ChartGeometry;
64
- /** Pre-scaled x-axis ticks. Render labels at `tick.x`, not by ordinal index. */
65
- xTicks: ChartXTick[];
66
- yTicks: number[];
67
- normalizedSeries: Array<{
68
- id: string;
69
- label: string;
70
- color: string;
71
- points: PlacedPoint[];
72
- path: string;
73
- areaPath: string;
74
- hidden: boolean;
75
- }>;
76
- tableRows: Array<{
77
- id: string;
78
- seriesLabel: string;
79
- xLabel: string;
80
- valueLabel: string;
81
- }>;
82
- /** Targets sorted by `x` (binary-search precondition for nearestTarget). */
83
- targets: ChartTarget[];
84
- empty: boolean;
85
- yDomain: [number, number];
86
- };
87
- export type BarChartModel = {
88
- geometry: ChartGeometry;
89
- categories: NormalizedXValue[];
90
- yTicks: number[];
91
- categoryTicks: Array<{
92
- categoryKey: string;
93
- label: string;
94
- fullLabel: string;
95
- x: number;
96
- y: number;
97
- }>;
98
- bars: Array<{
99
- id: string;
100
- seriesId: string;
101
- seriesLabel: string;
102
- categoryLabel: string;
103
- valueLabel: string;
104
- x: number;
105
- y: number;
106
- width: number;
107
- height: number;
108
- color: string;
109
- hidden: boolean;
110
- }>;
111
- tableRows: Array<{
112
- categoryKey: string;
113
- categoryLabel: string;
114
- values: Array<{
115
- seriesId: string;
116
- seriesLabel: string;
117
- valueLabel: string;
118
- }>;
119
- }>;
120
- targets: ChartTarget[];
121
- empty: boolean;
122
- valueDomain: [number, number];
123
- };
124
- export declare function assertValidChartNumber(componentId: string, rule: string, value: number, label: string): void;
125
- export declare function assertValidNonNegativeInteger(componentId: string, rule: string, value: number, label: string): void;
126
- export declare function assertValidTickCount(componentId: string, axis?: ChartAxisConfiguration): void;
127
- export declare function dataTableClass(visibility: ChartDataTableVisibility): string | undefined;
128
- export declare function formatXValue(value: NormalizedXValue, axis: ChartAxisConfiguration | undefined, context: ChartFormatterContext): string;
129
- export declare function formatNumericValue(value: number, axis: ChartAxisConfiguration | undefined, formatter: ((value: number, context: ChartFormatterContext) => string) | undefined, context: ChartFormatterContext): string;
130
- export declare function normalizeXValue(value: ChartXValue): NormalizedXValue;
131
- export declare function assertUniqueSeriesIds(componentId: string, series: Array<{
132
- id: string;
133
- }>): void;
134
- export declare function toggleSeriesId(hiddenSeriesIds: string[], seriesId: string): string[];
135
- export declare function createCartesianModel(options: {
136
- componentId: 'line-chart' | 'area-chart';
137
- series: ChartCartesianSeries[];
138
- hiddenSeriesIds: string[];
139
- width: number;
140
- height: number;
141
- xAxis?: ChartAxisConfiguration | undefined;
142
- yAxis?: ChartAxisConfiguration | undefined;
143
- stackedArea?: boolean;
144
- }): CartesianChartModel;
145
- export declare function createBarModel(options: {
146
- data: BarChartDatum[];
147
- categoryKey: string;
148
- series: BarChartSeries[];
149
- hiddenSeriesIds: string[];
150
- width: number;
151
- height: number;
152
- orientation: BarChartOrientation;
153
- mode: BarChartMode;
154
- xAxis?: ChartAxisConfiguration | undefined;
155
- yAxis?: ChartAxisConfiguration | undefined;
156
- }): BarChartModel;
157
- /**
158
- * Locates the target closest to a (x, y) pointer. Uses binary search on the
159
- * provided `axis` (defaults to `x`) — targets MUST be sorted ascending on that
160
- * axis (createCartesianModel and createBarModel guarantee this). Falls back to
161
- * a linear scan when targets are empty.
162
- */
163
- export declare function nearestTarget(targets: readonly ChartTarget[], x: number, y: number, axis?: 'x' | 'y'): ChartTarget | undefined;
164
- export declare function legendVisible(legendPosition: ChartLegendPosition, seriesCount: number): boolean;
1
+ export { createBarModel } from './chart-bar-model.ts';
2
+ export { createCartesianModel } from './chart-cartesian-model.ts';
3
+ export { createChartGeometry, observeChartFontLoading } from './chart-layout.ts';
4
+ export type { ChartGeometryOptions } from './chart-layout.ts';
5
+ export * from './chart-model-utilities.ts';
6
+ export { MAXIMUM_RENDERED_SERIES_POINTS, createAreaPath, createBandScale, createLinePath, createLinearScale, createNumericDomain, createPaddedDomain, createPointScale, createStackedBarDomainValues, createTicks, decimatePlacedPoints, decimationIndices, normalizeNumericValue, sortXValues, } from './chart-scale.ts';
7
+ export type { BandScale, BandlikeScale, LinearScale } from './chart-scale.ts';
@@ -52,9 +52,10 @@ export declare function normalizeHeatmapValue(value: number, domain: HeatmapDoma
52
52
  * colour below the midpoint and a warm colour above it, both fading to the inset
53
53
  * surface at the neutral midpoint.
54
54
  */
55
- export declare function heatmapCellFill(value: number | null, domain: HeatmapDomain, scale?: HeatmapColorScale): string;
55
+ export declare function heatmapCellFill(value: number | null, domain: HeatmapDomain, scale?: HeatmapColorScale, palette?: readonly string[], background?: string): string;
56
56
  /**
57
- * Choose a readable label colour for a cell: a light colour over high-intensity
58
- * (dark) fills, a dark colour over low-intensity (light) fills.
57
+ * Provide the opaque source colour used by the MatrixChart's difference blend.
58
+ * The browser composites this against the actual rendered cell, so arbitrary
59
+ * custom palettes remain readable without guessing their luminance in JavaScript.
59
60
  */
60
- export declare function heatmapLabelFill(value: number | null, domain: HeatmapDomain, scale?: HeatmapColorScale): string;
61
+ export declare function heatmapLabelFill(value: number | null, muted?: string): string;
@@ -0,0 +1,21 @@
1
+ @layer cinder.tokens, cinder.foundation, cinder.components, cinder.utilities;
2
+ @layer cinder.components {
3
+ .cinder-chart-tooltip-anchor {
4
+ position: absolute;
5
+ width: 1px;
6
+ height: 1px;
7
+ pointer-events: none;
8
+ }
9
+
10
+ .cinder-chart-tooltip {
11
+ display: grid;
12
+ gap: var(--cinder-space-1);
13
+ color: inherit;
14
+ font-size: var(--cinder-text-sm);
15
+ }
16
+
17
+ .cinder-chart-tooltip strong,
18
+ .cinder-chart-tooltip span {
19
+ display: block;
20
+ }
21
+ }
@@ -0,0 +1,11 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { ChartGeometry, ChartTarget } from '../chart.types.ts';
3
+ type $$ComponentProps = {
4
+ id: string;
5
+ target?: ChartTarget | undefined;
6
+ geometry: ChartGeometry;
7
+ content?: boolean | Snippet<[ChartTarget]> | undefined;
8
+ };
9
+ declare const ChartTooltip: import("svelte").Component<$$ComponentProps, {}, "">;
10
+ type ChartTooltip = ReturnType<typeof ChartTooltip>;
11
+ export default ChartTooltip;
@@ -3432,7 +3432,7 @@ var rest_excludes2 = new Set([
3432
3432
  "$$legacy",
3433
3433
  "variant",
3434
3434
  "size",
3435
- "monochrome",
3435
+ "monospace",
3436
3436
  "subscriptionState",
3437
3437
  "class",
3438
3438
  "children"
@@ -3449,7 +3449,7 @@ function Badge($$anchor, $$props) {
3449
3449
  expired: { variant: "danger", label: "Expired" },
3450
3450
  refunded: { variant: "neutral", label: "Refunded" }
3451
3451
  };
3452
- let variant = $14.prop($$props, "variant", 3, "neutral"), size = $14.prop($$props, "size", 3, "md"), monochrome = $14.prop($$props, "monochrome", 3, false), rest = $14.rest_props($$props, rest_excludes2);
3452
+ let variant = $14.prop($$props, "variant", 3, "neutral"), size = $14.prop($$props, "size", 3, "md"), monospace = $14.prop($$props, "monospace", 3, false), rest = $14.rest_props($$props, rest_excludes2);
3453
3453
  const subscriptionStateConfiguration = $14.derived(() => $$props.subscriptionState === undefined ? undefined : subscriptionStateConfigurations[$$props.subscriptionState]);
3454
3454
  const resolvedVariant = $14.derived(() => $14.get(subscriptionStateConfiguration)?.variant ?? variant());
3455
3455
  var span = root_1();
@@ -3457,7 +3457,7 @@ function Badge($$anchor, $$props) {
3457
3457
  class: $0,
3458
3458
  "data-cinder-variant": $14.get(resolvedVariant),
3459
3459
  "data-cinder-size": size(),
3460
- "data-cinder-monochrome": monochrome() ? "" : undefined,
3460
+ "data-cinder-monospace": monospace() ? "" : undefined,
3461
3461
  "data-cinder-subscription-state": $$props.subscriptionState,
3462
3462
  ...rest
3463
3463
  }), [() => classNames("cinder-badge", $$props.class)]);
@@ -6867,7 +6867,7 @@ function Approval_card($$anchor, $$props) {
6867
6867
  var node_18 = $31.child(li_1);
6868
6868
  Badge(node_18, {
6869
6869
  size: "sm",
6870
- monochrome: true,
6870
+ monospace: true,
6871
6871
  children: ($$anchor6, $$slotProps3) => {
6872
6872
  $31.next();
6873
6873
  var text_8 = $31.text();
@@ -6987,4 +6987,4 @@ export {
6987
6987
  Approval_card as ApprovalCard
6988
6988
  };
6989
6989
 
6990
- //# debugId=92C527AA9181798764756E2164756E21
6990
+ //# debugId=6AAC007F2EEFBA9B64756E2164756E21