@opendata-ai/openchart-core 6.24.1 → 6.25.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 +24 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/types/layout.ts +20 -0
- package/src/types/spec.ts +4 -0
package/package.json
CHANGED
package/src/types/layout.ts
CHANGED
|
@@ -220,6 +220,8 @@ export interface LineMark {
|
|
|
220
220
|
aria: MarkAria;
|
|
221
221
|
/** Index for stagger animation ordering. */
|
|
222
222
|
animationIndex?: number;
|
|
223
|
+
/** Which y-scale produced this mark ('y' = left, 'y2' = right). */
|
|
224
|
+
yScale?: 'y' | 'y2';
|
|
223
225
|
}
|
|
224
226
|
|
|
225
227
|
/**
|
|
@@ -262,6 +264,8 @@ export interface AreaMark {
|
|
|
262
264
|
aria: MarkAria;
|
|
263
265
|
/** Index for stagger animation ordering. */
|
|
264
266
|
animationIndex?: number;
|
|
267
|
+
/** Which y-scale produced this mark ('y' = left, 'y2' = right). */
|
|
268
|
+
yScale?: 'y' | 'y2';
|
|
265
269
|
}
|
|
266
270
|
|
|
267
271
|
/**
|
|
@@ -300,6 +304,8 @@ export interface RectMark {
|
|
|
300
304
|
stackGroup?: string;
|
|
301
305
|
/** Position of this segment within its stack group (0, 1, 2...). Set by engine for stacked bars. */
|
|
302
306
|
stackPos?: number;
|
|
307
|
+
/** Which y-scale produced this mark ('y' = left, 'y2' = right). */
|
|
308
|
+
yScale?: 'y' | 'y2';
|
|
303
309
|
}
|
|
304
310
|
|
|
305
311
|
/**
|
|
@@ -366,6 +372,8 @@ export interface PointMark {
|
|
|
366
372
|
aria: MarkAria;
|
|
367
373
|
/** Index for stagger animation ordering. */
|
|
368
374
|
animationIndex?: number;
|
|
375
|
+
/** Which y-scale produced this mark ('y' = left, 'y2' = right). */
|
|
376
|
+
yScale?: 'y' | 'y2';
|
|
369
377
|
}
|
|
370
378
|
|
|
371
379
|
/**
|
|
@@ -400,6 +408,8 @@ export interface TextMarkLayout {
|
|
|
400
408
|
aria: MarkAria;
|
|
401
409
|
/** Index for stagger animation ordering. */
|
|
402
410
|
animationIndex?: number;
|
|
411
|
+
/** Which y-scale produced this mark ('y' = left, 'y2' = right). */
|
|
412
|
+
yScale?: 'y' | 'y2';
|
|
403
413
|
}
|
|
404
414
|
|
|
405
415
|
/**
|
|
@@ -430,6 +440,8 @@ export interface RuleMarkLayout {
|
|
|
430
440
|
aria: MarkAria;
|
|
431
441
|
/** Index for stagger animation ordering. */
|
|
432
442
|
animationIndex?: number;
|
|
443
|
+
/** Which y-scale produced this mark ('y' = left, 'y2' = right). */
|
|
444
|
+
yScale?: 'y' | 'y2';
|
|
433
445
|
}
|
|
434
446
|
|
|
435
447
|
/**
|
|
@@ -458,6 +470,8 @@ export interface TickMarkLayout {
|
|
|
458
470
|
aria: MarkAria;
|
|
459
471
|
/** Index for stagger animation ordering. */
|
|
460
472
|
animationIndex?: number;
|
|
473
|
+
/** Which y-scale produced this mark ('y' = left, 'y2' = right). */
|
|
474
|
+
yScale?: 'y' | 'y2';
|
|
461
475
|
}
|
|
462
476
|
|
|
463
477
|
/** Discriminated union of all mark types. */
|
|
@@ -505,6 +519,8 @@ export interface ResolvedLabel {
|
|
|
505
519
|
};
|
|
506
520
|
/** Background color behind the label text. */
|
|
507
521
|
background?: string;
|
|
522
|
+
/** Whether to show the paint-order stroke halo. Default true. */
|
|
523
|
+
halo?: boolean;
|
|
508
524
|
}
|
|
509
525
|
|
|
510
526
|
// ---------------------------------------------------------------------------
|
|
@@ -652,6 +668,8 @@ export interface ChartLayout {
|
|
|
652
668
|
axes: {
|
|
653
669
|
x?: AxisLayout;
|
|
654
670
|
y?: AxisLayout;
|
|
671
|
+
/** Right-side y-axis for independent-scale layers (dual-axis charts). */
|
|
672
|
+
y2?: AxisLayout;
|
|
655
673
|
};
|
|
656
674
|
/** Data marks: the visual representation of data points. */
|
|
657
675
|
marks: Mark[];
|
|
@@ -1074,6 +1092,8 @@ export interface CompileOptions {
|
|
|
1074
1092
|
* If not provided, the engine falls back to heuristic estimation.
|
|
1075
1093
|
*/
|
|
1076
1094
|
measureText?: MeasureTextFn;
|
|
1095
|
+
/** Extra pixels to reserve on the right margin for a secondary y-axis. Set by compileLayer when resolve.scale.y is 'independent'. */
|
|
1096
|
+
rightAxisReserve?: number;
|
|
1077
1097
|
}
|
|
1078
1098
|
|
|
1079
1099
|
/** Extended compile options for table visualizations. */
|
package/src/types/spec.ts
CHANGED
|
@@ -238,6 +238,8 @@ export interface AxisConfig {
|
|
|
238
238
|
titlePadding?: number;
|
|
239
239
|
/** Padding between tick labels and axis. */
|
|
240
240
|
labelPadding?: number;
|
|
241
|
+
/** Color override for axis tick labels and title. Useful in dual-axis charts to match axis color to its series. */
|
|
242
|
+
labelColor?: string;
|
|
241
243
|
}
|
|
242
244
|
|
|
243
245
|
/** Scale configuration for an encoding channel. */
|
|
@@ -563,6 +565,8 @@ export interface TextAnnotation extends AnnotationBase {
|
|
|
563
565
|
};
|
|
564
566
|
/** Background color behind the text. Useful for readability over chart lines. */
|
|
565
567
|
background?: string;
|
|
568
|
+
/** Whether to show the paint-order stroke halo behind text. Default true. Set false for white text on colored backgrounds. */
|
|
569
|
+
halo?: boolean;
|
|
566
570
|
}
|
|
567
571
|
|
|
568
572
|
/**
|