@juspay/svelte-ui-components 2.85.0 → 2.87.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/AreaChart/AreaChart.svelte +229 -131
- package/dist/AreaChart/properties.d.ts +6 -0
- package/dist/BarChart/BarChart.svelte +421 -288
- package/dist/BarChart/properties.d.ts +6 -0
- package/dist/DualAxisBarChart/DualAxisBarChart.svelte +339 -222
- package/dist/DualAxisBarChart/properties.d.ts +4 -0
- package/dist/FunnelChart/FunnelChart.svelte +182 -83
- package/dist/FunnelChart/properties.d.ts +2 -0
- package/dist/LineChart/LineChart.svelte +396 -210
- package/dist/LineChart/properties.d.ts +9 -0
- package/dist/Sheet/Sheet.svelte +52 -20
- package/dist/Sheet/properties.d.ts +8 -0
- package/dist/_chart/Axis.svelte +32 -15
- package/dist/_chart/ChartTooltip.svelte +127 -49
- package/dist/_chart/Legend.svelte +36 -6
- package/dist/_chart/geometry.d.ts +28 -18
- package/dist/_chart/geometry.js +47 -42
- package/dist/_chart/interactions.d.ts +20 -0
- package/dist/_chart/interactions.js +34 -0
- package/dist/_chart/labels.d.ts +76 -0
- package/dist/_chart/labels.js +213 -0
- package/dist/_chart/measure.d.ts +12 -0
- package/dist/_chart/measure.js +46 -0
- package/dist/_chart/scales.d.ts +1 -1
- package/dist/_chart/scales.js +7 -2
- package/dist/_chart/tooltipPosition.d.ts +22 -0
- package/dist/_chart/tooltipPosition.js +49 -0
- package/dist/_chart/types.d.ts +29 -1
- package/package.json +1 -1
package/dist/_chart/types.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export type LinearScale = {
|
|
|
39
39
|
(value: number): number;
|
|
40
40
|
domain: [number, number];
|
|
41
41
|
range: [number, number];
|
|
42
|
-
ticks: (count?: number) => number[];
|
|
42
|
+
ticks: (count?: number, integer?: boolean) => number[];
|
|
43
43
|
invert: (pixel: number) => number;
|
|
44
44
|
};
|
|
45
45
|
export type BandScale = {
|
|
@@ -124,6 +124,14 @@ export type TooltipData = {
|
|
|
124
124
|
export type LegendItem = {
|
|
125
125
|
label: string;
|
|
126
126
|
color: string;
|
|
127
|
+
/** True when the series is toggled off via an interactive legend. */
|
|
128
|
+
hidden?: boolean;
|
|
129
|
+
};
|
|
130
|
+
/** Data-space anchor for point/category-anchored tooltips (coords are container px). */
|
|
131
|
+
export type TooltipAnchor = {
|
|
132
|
+
x: number;
|
|
133
|
+
y: number;
|
|
134
|
+
side: 'top' | 'right' | 'bottom' | 'left';
|
|
127
135
|
};
|
|
128
136
|
export type ChartContainerProperties = {
|
|
129
137
|
width?: number;
|
|
@@ -143,18 +151,38 @@ export type AxisProperties = {
|
|
|
143
151
|
showGridlines?: boolean;
|
|
144
152
|
gridlineLength?: number;
|
|
145
153
|
label?: string;
|
|
154
|
+
/** Rotate horizontal-axis tick labels -45° (crowding fallback). */
|
|
155
|
+
rotateTicks?: boolean;
|
|
156
|
+
/** Render every Nth tick label (tick marks always render). */
|
|
157
|
+
tickEvery?: number;
|
|
158
|
+
/** y-offset of the bottom axis title (grows when tick labels rotate). */
|
|
159
|
+
labelOffset?: number;
|
|
160
|
+
/** Clamp linear tick steps to whole numbers (category axes). */
|
|
161
|
+
integerTicks?: boolean;
|
|
146
162
|
classes?: string;
|
|
147
163
|
};
|
|
148
164
|
export type ChartTooltipProperties = {
|
|
149
165
|
data: TooltipData | null;
|
|
150
166
|
mouseX?: number;
|
|
151
167
|
mouseY?: number;
|
|
168
|
+
/** When set, the tooltip anchors to this point instead of following the cursor. */
|
|
169
|
+
anchor?: TooltipAnchor | null;
|
|
170
|
+
/** Render into document.body with position:fixed, clamped to the viewport. */
|
|
171
|
+
portal?: boolean;
|
|
172
|
+
/** The positioned chart wrapper; required to convert coords in portal mode. */
|
|
173
|
+
originEl?: HTMLElement | null;
|
|
174
|
+
/** Strip the tooltip card chrome (used when `content` supplies its own UI). */
|
|
175
|
+
unstyled?: boolean;
|
|
176
|
+
/** Custom content rendered inside the positioned (and clamped) wrapper. */
|
|
177
|
+
content?: Snippet;
|
|
152
178
|
customSnippet?: Snippet<[TooltipData]>;
|
|
153
179
|
classes?: string;
|
|
154
180
|
};
|
|
155
181
|
export type LegendProperties = {
|
|
156
182
|
items: LegendItem[];
|
|
157
183
|
position?: 'top' | 'bottom';
|
|
184
|
+
/** When provided, items render as toggle buttons and call back with their index. */
|
|
185
|
+
onToggle?: (index: number) => void;
|
|
158
186
|
customSnippet?: Snippet<[LegendItem[]]>;
|
|
159
187
|
classes?: string;
|
|
160
188
|
};
|