@opendata-ai/openchart-core 2.7.0 → 2.8.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 +26 -1
- package/dist/index.js +1368 -43
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/types/index.ts +1 -0
- package/src/types/spec.ts +28 -2
package/package.json
CHANGED
package/src/types/index.ts
CHANGED
package/src/types/spec.ts
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* with editorial extensions for chrome, annotations, responsive, and dark mode.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
// Re-import for use in LegendConfig (avoids circular by importing from sibling)
|
|
12
|
-
import type { LegendPosition } from '../responsive/breakpoints';
|
|
11
|
+
// Re-import for use in LegendConfig and overrides (avoids circular by importing from sibling)
|
|
12
|
+
import type { Breakpoint, LegendPosition } from '../responsive/breakpoints';
|
|
13
13
|
import type { ColumnConfig } from './table';
|
|
14
14
|
|
|
15
15
|
// ---------------------------------------------------------------------------
|
|
@@ -395,6 +395,8 @@ export interface LegendConfig {
|
|
|
395
395
|
position?: LegendPosition;
|
|
396
396
|
/** Pixel offset for fine-tuning legend position. */
|
|
397
397
|
offset?: AnnotationOffset;
|
|
398
|
+
/** Whether to show the legend. Defaults to true. Set to false to hide. */
|
|
399
|
+
show?: boolean;
|
|
398
400
|
}
|
|
399
401
|
|
|
400
402
|
// ---------------------------------------------------------------------------
|
|
@@ -416,6 +418,24 @@ export interface SeriesStyle {
|
|
|
416
418
|
opacity?: number;
|
|
417
419
|
}
|
|
418
420
|
|
|
421
|
+
/**
|
|
422
|
+
* Breakpoint-conditional overrides for chart specs.
|
|
423
|
+
*
|
|
424
|
+
* Allows specifying different chrome, labels, legend, or annotations
|
|
425
|
+
* per breakpoint. Merged shallowly into the base spec at compile time
|
|
426
|
+
* when the container matches the breakpoint.
|
|
427
|
+
*/
|
|
428
|
+
export interface ChartSpecOverride {
|
|
429
|
+
/** Override editorial chrome at this breakpoint. */
|
|
430
|
+
chrome?: Chrome;
|
|
431
|
+
/** Override label configuration at this breakpoint. */
|
|
432
|
+
labels?: LabelConfig;
|
|
433
|
+
/** Override legend configuration at this breakpoint. */
|
|
434
|
+
legend?: LegendConfig;
|
|
435
|
+
/** Override annotations at this breakpoint. */
|
|
436
|
+
annotations?: Annotation[];
|
|
437
|
+
}
|
|
438
|
+
|
|
419
439
|
/**
|
|
420
440
|
* Chart specification: the primary input for standard chart types.
|
|
421
441
|
*
|
|
@@ -448,6 +468,12 @@ export interface ChartSpec {
|
|
|
448
468
|
hiddenSeries?: string[];
|
|
449
469
|
/** Per-series visual overrides, keyed by series name (the color field value). */
|
|
450
470
|
seriesStyles?: Record<string, SeriesStyle>;
|
|
471
|
+
/**
|
|
472
|
+
* Breakpoint-conditional overrides. Keys are breakpoint names.
|
|
473
|
+
* At compile time, if the container matches a breakpoint, its overrides
|
|
474
|
+
* are shallow-merged into the spec before layout computation.
|
|
475
|
+
*/
|
|
476
|
+
overrides?: Partial<Record<Breakpoint, ChartSpecOverride>>;
|
|
451
477
|
}
|
|
452
478
|
|
|
453
479
|
/**
|