@opendata-ai/openchart-engine 6.10.0 → 6.12.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 +9 -10
- package/dist/index.js +148 -59
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/__test-fixtures__/specs.ts +3 -0
- package/src/charts/bar/compute.ts +9 -5
- package/src/charts/bar/labels.ts +2 -1
- package/src/charts/column/compute.ts +9 -5
- package/src/charts/column/labels.ts +2 -1
- package/src/charts/dot/labels.ts +6 -2
- package/src/charts/line/area.ts +3 -2
- package/src/charts/line/compute.ts +5 -2
- package/src/charts/pie/compute.ts +24 -3
- package/src/charts/rule/index.ts +6 -3
- package/src/charts/scatter/compute.ts +2 -1
- package/src/charts/text/index.ts +6 -3
- package/src/charts/tick/index.ts +6 -3
- package/src/charts/utils.ts +3 -3
- package/src/compile.ts +27 -14
- package/src/compiler/__tests__/normalize.test.ts +110 -0
- package/src/compiler/normalize.ts +20 -1
- package/src/compiler/types.ts +4 -0
- package/src/graphs/compile-graph.ts +8 -0
- package/src/graphs/types.ts +2 -0
- package/src/layout/dimensions.ts +3 -0
- package/src/layout/scales.ts +2 -2
- package/src/legend/compute.ts +3 -1
- package/src/sankey/compile-sankey.ts +12 -2
- package/src/sankey/types.ts +1 -0
- package/src/tables/compile-table.ts +5 -0
- package/src/tooltips/compute.ts +11 -6
package/dist/index.d.ts
CHANGED
|
@@ -101,6 +101,8 @@ interface GraphCompilation {
|
|
|
101
101
|
};
|
|
102
102
|
/** Force simulation configuration. */
|
|
103
103
|
simulationConfig: SimulationConfig;
|
|
104
|
+
/** Whether to show the brand watermark. */
|
|
105
|
+
watermark: boolean;
|
|
104
106
|
}
|
|
105
107
|
|
|
106
108
|
/**
|
|
@@ -212,6 +214,8 @@ interface NormalizedChartSpec {
|
|
|
212
214
|
responsive: boolean;
|
|
213
215
|
theme: ThemeConfig;
|
|
214
216
|
darkMode: DarkMode;
|
|
217
|
+
/** Whether the tryOpenData.ai watermark is enabled. */
|
|
218
|
+
watermark: boolean;
|
|
215
219
|
/** Series names to hide from rendering. */
|
|
216
220
|
hiddenSeries: string[];
|
|
217
221
|
/** Per-series visual style overrides. */
|
|
@@ -226,6 +230,7 @@ interface NormalizedTableSpec {
|
|
|
226
230
|
chrome: NormalizedChrome;
|
|
227
231
|
theme: ThemeConfig;
|
|
228
232
|
darkMode: DarkMode;
|
|
233
|
+
watermark: boolean;
|
|
229
234
|
search: boolean;
|
|
230
235
|
pagination: boolean | {
|
|
231
236
|
pageSize: number;
|
|
@@ -247,6 +252,7 @@ interface NormalizedGraphSpec {
|
|
|
247
252
|
annotations: Annotation[];
|
|
248
253
|
theme: ThemeConfig;
|
|
249
254
|
darkMode: DarkMode;
|
|
255
|
+
watermark: boolean;
|
|
250
256
|
}
|
|
251
257
|
/** Discriminated union of all normalized spec types. */
|
|
252
258
|
type NormalizedSpec = NormalizedChartSpec | NormalizedTableSpec | NormalizedGraphSpec | NormalizedSankeySpec;
|
|
@@ -303,6 +309,7 @@ interface NormalizedSankeySpec {
|
|
|
303
309
|
legend?: LegendConfig;
|
|
304
310
|
theme: ThemeConfig;
|
|
305
311
|
darkMode: DarkMode;
|
|
312
|
+
watermark: boolean;
|
|
306
313
|
animation?: AnimationSpec;
|
|
307
314
|
valueFormat?: string;
|
|
308
315
|
linkOpacity?: number;
|
|
@@ -354,14 +361,6 @@ declare function validateSpec(spec: unknown): ValidationResult;
|
|
|
354
361
|
*/
|
|
355
362
|
declare function compile(spec: unknown): CompileResult;
|
|
356
363
|
|
|
357
|
-
/**
|
|
358
|
-
* Scale computation from encoding spec + data.
|
|
359
|
-
*
|
|
360
|
-
* Creates D3 scales that map data values to pixel positions.
|
|
361
|
-
* Temporal -> scaleTime(), quantitative -> scaleLinear(),
|
|
362
|
-
* nominal/ordinal -> scaleBand() or scaleOrdinal(), depending on context.
|
|
363
|
-
*/
|
|
364
|
-
|
|
365
364
|
/** Continuous D3 scales (linear, time, log, pow, sqrt, symlog) that support .ticks() and .nice(). */
|
|
366
365
|
type D3ContinuousScale = ScaleLinear<number, number> | ScaleTime<number, number> | ScaleLogarithmic<number, number> | ScalePower<number, number> | ScaleSymLog<number, number>;
|
|
367
366
|
/** Discretizing D3 scales (quantile, quantize, threshold). */
|
|
@@ -392,8 +391,8 @@ interface ResolvedScales {
|
|
|
392
391
|
y?: ResolvedScale;
|
|
393
392
|
color?: ResolvedScale;
|
|
394
393
|
size?: ResolvedScale;
|
|
395
|
-
/** Default color for single-series charts (first categorical palette color). */
|
|
396
|
-
defaultColor?: string;
|
|
394
|
+
/** Default color for single-series charts (first categorical palette color or markDef.fill gradient). */
|
|
395
|
+
defaultColor?: string | _opendata_ai_openchart_core.GradientDef;
|
|
397
396
|
}
|
|
398
397
|
|
|
399
398
|
/**
|