@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/dist/index.d.ts
CHANGED
|
@@ -320,6 +320,8 @@ interface AxisConfig {
|
|
|
320
320
|
titlePadding?: number;
|
|
321
321
|
/** Padding between tick labels and axis. */
|
|
322
322
|
labelPadding?: number;
|
|
323
|
+
/** Color override for axis tick labels and title. Useful in dual-axis charts to match axis color to its series. */
|
|
324
|
+
labelColor?: string;
|
|
323
325
|
}
|
|
324
326
|
/** Scale configuration for an encoding channel. */
|
|
325
327
|
interface ScaleConfig {
|
|
@@ -606,6 +608,8 @@ interface TextAnnotation extends AnnotationBase {
|
|
|
606
608
|
};
|
|
607
609
|
/** Background color behind the text. Useful for readability over chart lines. */
|
|
608
610
|
background?: string;
|
|
611
|
+
/** Whether to show the paint-order stroke halo behind text. Default true. Set false for white text on colored backgrounds. */
|
|
612
|
+
halo?: boolean;
|
|
609
613
|
}
|
|
610
614
|
/**
|
|
611
615
|
* Range annotation highlighting a region of the chart.
|
|
@@ -1803,6 +1807,8 @@ interface LineMark {
|
|
|
1803
1807
|
aria: MarkAria;
|
|
1804
1808
|
/** Index for stagger animation ordering. */
|
|
1805
1809
|
animationIndex?: number;
|
|
1810
|
+
/** Which y-scale produced this mark ('y' = left, 'y2' = right). */
|
|
1811
|
+
yScale?: 'y' | 'y2';
|
|
1806
1812
|
}
|
|
1807
1813
|
/**
|
|
1808
1814
|
* Area mark: a filled region bounded by a top line and a baseline.
|
|
@@ -1844,6 +1850,8 @@ interface AreaMark {
|
|
|
1844
1850
|
aria: MarkAria;
|
|
1845
1851
|
/** Index for stagger animation ordering. */
|
|
1846
1852
|
animationIndex?: number;
|
|
1853
|
+
/** Which y-scale produced this mark ('y' = left, 'y2' = right). */
|
|
1854
|
+
yScale?: 'y' | 'y2';
|
|
1847
1855
|
}
|
|
1848
1856
|
/**
|
|
1849
1857
|
* Rect mark: a rectangle.
|
|
@@ -1881,6 +1889,8 @@ interface RectMark {
|
|
|
1881
1889
|
stackGroup?: string;
|
|
1882
1890
|
/** Position of this segment within its stack group (0, 1, 2...). Set by engine for stacked bars. */
|
|
1883
1891
|
stackPos?: number;
|
|
1892
|
+
/** Which y-scale produced this mark ('y' = left, 'y2' = right). */
|
|
1893
|
+
yScale?: 'y' | 'y2';
|
|
1884
1894
|
}
|
|
1885
1895
|
/**
|
|
1886
1896
|
* Arc mark: a pie/donut slice.
|
|
@@ -1945,6 +1955,8 @@ interface PointMark {
|
|
|
1945
1955
|
aria: MarkAria;
|
|
1946
1956
|
/** Index for stagger animation ordering. */
|
|
1947
1957
|
animationIndex?: number;
|
|
1958
|
+
/** Which y-scale produced this mark ('y' = left, 'y2' = right). */
|
|
1959
|
+
yScale?: 'y' | 'y2';
|
|
1948
1960
|
}
|
|
1949
1961
|
/**
|
|
1950
1962
|
* Text mark: data-positioned text label.
|
|
@@ -1978,6 +1990,8 @@ interface TextMarkLayout {
|
|
|
1978
1990
|
aria: MarkAria;
|
|
1979
1991
|
/** Index for stagger animation ordering. */
|
|
1980
1992
|
animationIndex?: number;
|
|
1993
|
+
/** Which y-scale produced this mark ('y' = left, 'y2' = right). */
|
|
1994
|
+
yScale?: 'y' | 'y2';
|
|
1981
1995
|
}
|
|
1982
1996
|
/**
|
|
1983
1997
|
* Rule mark: a line segment between two points.
|
|
@@ -2007,6 +2021,8 @@ interface RuleMarkLayout {
|
|
|
2007
2021
|
aria: MarkAria;
|
|
2008
2022
|
/** Index for stagger animation ordering. */
|
|
2009
2023
|
animationIndex?: number;
|
|
2024
|
+
/** Which y-scale produced this mark ('y' = left, 'y2' = right). */
|
|
2025
|
+
yScale?: 'y' | 'y2';
|
|
2010
2026
|
}
|
|
2011
2027
|
/**
|
|
2012
2028
|
* Tick mark: a short line segment at a data coordinate.
|
|
@@ -2034,6 +2050,8 @@ interface TickMarkLayout {
|
|
|
2034
2050
|
aria: MarkAria;
|
|
2035
2051
|
/** Index for stagger animation ordering. */
|
|
2036
2052
|
animationIndex?: number;
|
|
2053
|
+
/** Which y-scale produced this mark ('y' = left, 'y2' = right). */
|
|
2054
|
+
yScale?: 'y' | 'y2';
|
|
2037
2055
|
}
|
|
2038
2056
|
/** Discriminated union of all mark types. */
|
|
2039
2057
|
type Mark = LineMark | AreaMark | RectMark | ArcMark | PointMark | TextMarkLayout | RuleMarkLayout | TickMarkLayout;
|
|
@@ -2067,6 +2085,8 @@ interface ResolvedLabel {
|
|
|
2067
2085
|
};
|
|
2068
2086
|
/** Background color behind the label text. */
|
|
2069
2087
|
background?: string;
|
|
2088
|
+
/** Whether to show the paint-order stroke halo. Default true. */
|
|
2089
|
+
halo?: boolean;
|
|
2070
2090
|
}
|
|
2071
2091
|
/** A resolved annotation with computed pixel positions. */
|
|
2072
2092
|
interface ResolvedAnnotation {
|
|
@@ -2185,6 +2205,8 @@ interface ChartLayout {
|
|
|
2185
2205
|
axes: {
|
|
2186
2206
|
x?: AxisLayout;
|
|
2187
2207
|
y?: AxisLayout;
|
|
2208
|
+
/** Right-side y-axis for independent-scale layers (dual-axis charts). */
|
|
2209
|
+
y2?: AxisLayout;
|
|
2188
2210
|
};
|
|
2189
2211
|
/** Data marks: the visual representation of data points. */
|
|
2190
2212
|
marks: Mark[];
|
|
@@ -2579,6 +2601,8 @@ interface CompileOptions {
|
|
|
2579
2601
|
* If not provided, the engine falls back to heuristic estimation.
|
|
2580
2602
|
*/
|
|
2581
2603
|
measureText?: MeasureTextFn;
|
|
2604
|
+
/** Extra pixels to reserve on the right margin for a secondary y-axis. Set by compileLayer when resolve.scale.y is 'independent'. */
|
|
2605
|
+
rightAxisReserve?: number;
|
|
2582
2606
|
}
|
|
2583
2607
|
/** Extended compile options for table visualizations. */
|
|
2584
2608
|
interface CompileTableOptions extends CompileOptions {
|