@opendata-ai/openchart-core 8.3.1 → 8.4.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.
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "watermark": {
48
48
  "type": "boolean",
49
- "description": "Whether to show the tryOpenData.ai watermark. Defaults to true."
49
+ "description": "Whether to show the OpenData watermark. Defaults to true."
50
50
  },
51
51
  "search": {
52
52
  "type": "boolean",
@@ -76,9 +76,38 @@
76
76
  "type": "boolean",
77
77
  "description": "Whether to stick the first column during horizontal scroll."
78
78
  },
79
+ "density": {
80
+ "$ref": "#/definitions/TableDensity",
81
+ "description": "Row density: `'condensed'` (40px rows), `'regular'` (48px, default), `'relaxed'` (56px). An explicit value always wins over the responsive auto-condense."
82
+ },
83
+ "striped": {
84
+ "type": "boolean",
85
+ "description": "Zebra striping on body rows. Defaults to false (hairlines only)."
86
+ },
87
+ "sort": {
88
+ "$ref": "#/definitions/SortState",
89
+ "description": "Initial sort. Falls back to the first inline-bar column, descending."
90
+ },
91
+ "totalRow": {
92
+ "anyOf": [
93
+ {
94
+ "type": "boolean"
95
+ },
96
+ {
97
+ "type": "object",
98
+ "properties": {
99
+ "label": {
100
+ "type": "string"
101
+ }
102
+ },
103
+ "additionalProperties": false
104
+ }
105
+ ],
106
+ "description": "Sticky footer summing every quantitative column over the filtered rows (the whole result set, not just the current page). `true` uses the label \"Total\"."
107
+ },
79
108
  "compact": {
80
109
  "type": "boolean",
81
- "description": "Compact mode: reduced padding and font sizes."
110
+ "deprecated": "Use `density: 'condensed'`. Still honored, with a warning."
82
111
  },
83
112
  "responsive": {
84
113
  "type": "boolean",
@@ -132,7 +161,26 @@
132
161
  },
133
162
  "format": {
134
163
  "type": "string",
135
- "description": "Number/date format string (d3-format or d3-time-format), or semantic keyword `'percent'` / `'currency'`. e.g. \",.0f\", \"%Y-%m-%d\", \"percent\". Tables always show full precision (no compact notation)."
164
+ "description": "Number/date format string (d3-format or d3-time-format), or a semantic keyword: `'percent'`, `'currency'`, `'ordinal'`, `'compact'`. e.g. \",.0f\", \"%Y-%m-%d\", \"percent\".\n\nTables show full precision by default; `'compact'` opts a column into the chart-surface abbreviation (1.2k, 3.4M)."
165
+ },
166
+ "type": {
167
+ "type": "string",
168
+ "enum": [
169
+ "quantitative",
170
+ "nominal",
171
+ "ordinal",
172
+ "temporal"
173
+ ],
174
+ "description": "Field type, Vega-Lite style. Drives alignment (quantitative right, everything else left) and which columns the total row sums. Inferred from the data when omitted."
175
+ },
176
+ "priority": {
177
+ "type": "number",
178
+ "enum": [
179
+ 1,
180
+ 2,
181
+ 3
182
+ ],
183
+ "description": "Mobile priority for cards mode (below 400px): 1 renders first and spans the row, 2 renders as a label/value pair, 3 is hidden. Defaults to 2 (1 for the first column)."
136
184
  },
137
185
  "heatmap": {
138
186
  "$ref": "#/definitions/HeatmapColumnConfig",
@@ -154,6 +202,17 @@
154
202
  "type": "boolean",
155
203
  "description": "Flag: render the cell value as a country flag emoji or image."
156
204
  },
205
+ "delta": {
206
+ "anyOf": [
207
+ {
208
+ "type": "boolean"
209
+ },
210
+ {
211
+ "$ref": "#/definitions/DeltaColumnConfig"
212
+ }
213
+ ],
214
+ "description": "Delta: render the value as a signed, colored change chip (up 2.4%)."
215
+ },
157
216
  "categoryColors": {
158
217
  "$ref": "#/definitions/CategoryColorsConfig",
159
218
  "description": "Category colors: color-code the cell based on its categorical value."
@@ -167,7 +226,7 @@
167
226
  "key"
168
227
  ],
169
228
  "additionalProperties": false,
170
- "description": "Configuration for a single table column.\n\nAt minimum, `key` identifies the data field. All other properties control display, sorting, formatting, and visual features.\n\nOnly one visual feature (heatmap, bar, sparkline, image, flag, categoryColors) should be active per column. If multiple are provided, the engine picks the first one in this precedence order: sparkline > bar > heatmap > image > flag > categoryColors."
229
+ "description": "Configuration for a single table column.\n\nAt minimum, `key` identifies the data field. All other properties control display, sorting, formatting, and visual features.\n\nOnly one visual feature (heatmap, bar, sparkline, delta, image, flag, categoryColors) should be active per column. If multiple are provided, the engine picks the first one in this precedence order: sparkline > bar > delta > heatmap > image > flag > categoryColors."
171
230
  },
172
231
  "HeatmapColumnConfig": {
173
232
  "type": "object",
@@ -237,6 +296,27 @@
237
296
  "color": {
238
297
  "type": "string",
239
298
  "description": "Sparkline color. Uses the first categorical palette color if omitted."
299
+ },
300
+ "domain": {
301
+ "anyOf": [
302
+ {
303
+ "type": "string",
304
+ "const": "shared"
305
+ },
306
+ {
307
+ "type": "string",
308
+ "const": "row"
309
+ },
310
+ {
311
+ "type": "array",
312
+ "items": {
313
+ "type": "number"
314
+ },
315
+ "minItems": 2,
316
+ "maxItems": 2
317
+ }
318
+ ],
319
+ "description": "Value domain each row's sparkline is normalized against.\n\n- `'shared'` (default): one extent computed across every row, so row heights are comparable down the column.\n- `'row'`: each row normalized against its own min/max, which maximises shape at the cost of comparability (use for small-magnitude series).\n- `[min, max]`: an explicit extent."
240
320
  }
241
321
  },
242
322
  "additionalProperties": false,
@@ -261,6 +341,17 @@
261
341
  "additionalProperties": false,
262
342
  "description": "Image cell configuration for a table column."
263
343
  },
344
+ "DeltaColumnConfig": {
345
+ "type": "object",
346
+ "properties": {
347
+ "invert": {
348
+ "type": "boolean",
349
+ "description": "Flip the color valence: negative values read as positive. Use for metrics where down is good (churn, latency, cost)."
350
+ }
351
+ },
352
+ "additionalProperties": false,
353
+ "description": "Delta (change) chip configuration for a table column."
354
+ },
264
355
  "CategoryColorsConfig": {
265
356
  "type": "object",
266
357
  "additionalProperties": {
@@ -346,7 +437,7 @@
346
437
  "$ref": "#/definitions/ChromeText"
347
438
  }
348
439
  ],
349
- "description": "Right-anchored brand block on the footer row, paired with a small accent dot to its left. Visually balances the source/byline left-anchored text. When set, suppresses the default `tryOpenData.ai` watermark for this chart."
440
+ "description": "Right-anchored brand block on the footer row, paired with a small accent dot to its left. Visually balances the source/byline left-anchored text. When set, suppresses the default `OpenData` watermark for this chart."
350
441
  }
351
442
  },
352
443
  "additionalProperties": false,
@@ -435,7 +526,18 @@
435
526
  "items": {
436
527
  "type": "string"
437
528
  },
438
- "description": "Categorical palette for nominal data (array of CSS color strings)."
529
+ "description": "Categorical stroke palette for nominal data (array of CSS color strings)."
530
+ },
531
+ "categoricalFill": {
532
+ "type": "array",
533
+ "items": {
534
+ "type": "string"
535
+ },
536
+ "description": "Categorical palette for area-filling marks (bar, area, arc, waffle, calendar, rect). Defaults to `categorical` when only that is set."
537
+ },
538
+ "hairline": {
539
+ "$ref": "#/definitions/TokenValue",
540
+ "description": "Hairline color for axis lines and separators. Accepts a TokenValue for light/dark pairs."
439
541
  },
440
542
  "sequential": {
441
543
  "type": "object",
@@ -546,15 +648,15 @@
546
648
  "properties": {
547
649
  "normal": {
548
650
  "type": "number",
549
- "description": "Normal text weight. Default: 450."
651
+ "description": "Normal text weight. Default: 400."
550
652
  },
551
653
  "medium": {
552
654
  "type": "number",
553
- "description": "Medium text weight. Default: 550."
655
+ "description": "Medium text weight. Default: 500."
554
656
  },
555
657
  "semibold": {
556
658
  "type": "number",
557
- "description": "Semibold text weight. Default: 590."
659
+ "description": "Semibold text weight. Default: 600."
558
660
  },
559
661
  "bold": {
560
662
  "type": "number",
@@ -680,6 +782,30 @@
680
782
  "additionalProperties": false,
681
783
  "description": "Per-element chrome style overrides. Pass a plain string for color-only (backward-compatible), or a ChromeThemeOverride object for full typography control (color, fontSize, fontWeight, lineHeight)."
682
784
  },
785
+ "rule": {
786
+ "type": "object",
787
+ "properties": {
788
+ "color": {
789
+ "$ref": "#/definitions/TokenValue",
790
+ "description": "Rule color. Accepts a TokenValue for light/dark pairs."
791
+ },
792
+ "width": {
793
+ "type": "number",
794
+ "description": "Rule length in pixels."
795
+ },
796
+ "thickness": {
797
+ "type": "number",
798
+ "description": "Rule height in pixels."
799
+ }
800
+ },
801
+ "required": [
802
+ "color",
803
+ "width",
804
+ "thickness"
805
+ ],
806
+ "additionalProperties": false,
807
+ "description": "Editorial rule above the chrome block: a short colored bar (the Economist/FT masthead device). Omit for no rule."
808
+ },
683
809
  "seriesStrategy": {
684
810
  "$ref": "#/definitions/SeriesStrategy",
685
811
  "description": "Series color assignment strategy. Default: 'palette' (full categorical palette always, zero visual drift)."
@@ -752,6 +878,38 @@
752
878
  ],
753
879
  "description": "Dark mode behavior.\n\n- `\"auto\"` - Checks the `prefers-color-scheme` media query to detect the user's system-level preference. This does NOT detect class-based dark mode toggles (e.g. `document.documentElement.classList.toggle('dark')`). If your app uses class-based dark mode, use VizThemeProvider with `\"force\"` or `\"off\"` instead of `\"auto\"` and toggle based on your app's state.\n- `\"force\"` - Always render in dark mode regardless of system preference.\n- `\"off\"` - Always render in light mode (default).\n\nAll components (Chart, Sankey, Graph) inherit darkMode from VizThemeProvider when no explicit prop is passed."
754
880
  },
881
+ "TableDensity": {
882
+ "type": "string",
883
+ "enum": [
884
+ "condensed",
885
+ "regular",
886
+ "relaxed"
887
+ ],
888
+ "description": "Row density for tables. Maps to 40 / 48 / 56px row heights."
889
+ },
890
+ "SortState": {
891
+ "type": "object",
892
+ "properties": {
893
+ "column": {
894
+ "type": "string",
895
+ "description": "Column key being sorted."
896
+ },
897
+ "direction": {
898
+ "type": "string",
899
+ "enum": [
900
+ "asc",
901
+ "desc"
902
+ ],
903
+ "description": "Sort direction."
904
+ }
905
+ },
906
+ "required": [
907
+ "column",
908
+ "direction"
909
+ ],
910
+ "additionalProperties": false,
911
+ "description": "Sort state for the table."
912
+ },
755
913
  "AnimationSpec": {
756
914
  "anyOf": [
757
915
  {