@rokkit/chart 1.0.0-next.155 → 1.0.0-next.159
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/package.json +1 -1
- package/LICENSE +0 -21
- package/dist/Plot/index.d.ts +0 -9
- package/dist/PlotState.svelte.d.ts +0 -75
- package/dist/crossfilter/createCrossFilter.svelte.d.ts +0 -13
- package/dist/elements/index.d.ts +0 -6
- package/dist/geoms/lib/areas.d.ts +0 -52
- package/dist/geoms/lib/bars.d.ts +0 -3
- package/dist/index.d.ts +0 -56
- package/dist/lib/brewer.d.ts +0 -9
- package/dist/lib/brewing/BoxBrewer.svelte.d.ts +0 -8
- package/dist/lib/brewing/CartesianBrewer.svelte.d.ts +0 -8
- package/dist/lib/brewing/PieBrewer.svelte.d.ts +0 -8
- package/dist/lib/brewing/QuartileBrewer.svelte.d.ts +0 -9
- package/dist/lib/brewing/ViolinBrewer.svelte.d.ts +0 -8
- package/dist/lib/brewing/axes.svelte.d.ts +0 -66
- package/dist/lib/brewing/bars.svelte.d.ts +0 -56
- package/dist/lib/brewing/brewer.svelte.d.ts +0 -114
- package/dist/lib/brewing/colors.d.ts +0 -26
- package/dist/lib/brewing/dimensions.svelte.d.ts +0 -35
- package/dist/lib/brewing/index.svelte.d.ts +0 -118
- package/dist/lib/brewing/legends.svelte.d.ts +0 -48
- package/dist/lib/brewing/marks/arcs.d.ts +0 -17
- package/dist/lib/brewing/marks/areas.d.ts +0 -31
- package/dist/lib/brewing/marks/bars.d.ts +0 -1
- package/dist/lib/brewing/marks/boxes.d.ts +0 -24
- package/dist/lib/brewing/marks/lines.d.ts +0 -24
- package/dist/lib/brewing/marks/points.d.ts +0 -55
- package/dist/lib/brewing/marks/violins.d.ts +0 -20
- package/dist/lib/brewing/patterns.d.ts +0 -14
- package/dist/lib/brewing/scales.d.ts +0 -28
- package/dist/lib/brewing/scales.svelte.d.ts +0 -24
- package/dist/lib/brewing/stats.d.ts +0 -23
- package/dist/lib/brewing/symbols.d.ts +0 -7
- package/dist/lib/brewing/types.d.ts +0 -162
- package/dist/lib/chart.d.ts +0 -38
- package/dist/lib/context.d.ts +0 -13
- package/dist/lib/grid.d.ts +0 -72
- package/dist/lib/keyboard-nav.d.ts +0 -15
- package/dist/lib/plot/chartProps.d.ts +0 -177
- package/dist/lib/plot/crossfilter.d.ts +0 -13
- package/dist/lib/plot/facet.d.ts +0 -24
- package/dist/lib/plot/frames.d.ts +0 -47
- package/dist/lib/plot/helpers.d.ts +0 -3
- package/dist/lib/plot/preset.d.ts +0 -29
- package/dist/lib/plot/scales.d.ts +0 -5
- package/dist/lib/plot/stat.d.ts +0 -32
- package/dist/lib/plot/types.d.ts +0 -89
- package/dist/lib/preset.d.ts +0 -30
- package/dist/lib/scales.svelte.d.ts +0 -35
- package/dist/lib/swatch.d.ts +0 -12
- package/dist/lib/ticks.d.ts +0 -36
- package/dist/lib/utils.d.ts +0 -61
- package/dist/lib/xscale.d.ts +0 -11
- package/dist/patterns/index.d.ts +0 -4
- package/dist/patterns/patterns.d.ts +0 -72
- package/dist/patterns/scale.d.ts +0 -30
- package/dist/symbols/constants/index.d.ts +0 -1
- package/dist/symbols/index.d.ts +0 -5
- package/src/patterns/README.md +0 -3
package/dist/lib/grid.d.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef GridPoint
|
|
3
|
-
* @property {number} x - x-coordinate of the point
|
|
4
|
-
* @property {number} y - y-coordinate of the point
|
|
5
|
-
* @property {number} r - radius of the point
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* @typedef SwatchGrid
|
|
9
|
-
* @property {number} width - width of the grid
|
|
10
|
-
* @property {number} height - height of the grid
|
|
11
|
-
* @property {GridPoint[]} data - data points of the grid
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* @tyoedef {Object} GridOptions
|
|
15
|
-
* @property {number} [pad=0] - The padding between the items
|
|
16
|
-
* @property {number} [columns=0] - The number of columns
|
|
17
|
-
* @property {number} [rows=0] - The number of rows
|
|
18
|
-
*/
|
|
19
|
-
/**
|
|
20
|
-
* Calculates a grid of centres to fit a list of items of `size` within the number of `columns` and `rows`.
|
|
21
|
-
*
|
|
22
|
-
* - Attempts to find a best fit square if both columns and rows are not specified
|
|
23
|
-
* - Value in columns is prioritized over rows for recalculating the grid
|
|
24
|
-
* - Supports padding between the items
|
|
25
|
-
*
|
|
26
|
-
* @param {number} count - number of items
|
|
27
|
-
* @param {number} size - size of the items
|
|
28
|
-
* @param {GridOptions} options - options for the grid
|
|
29
|
-
* @returns {SwatchGrid}
|
|
30
|
-
*/
|
|
31
|
-
export function swatchGrid(count: number, size: number, options: GridOptions): SwatchGrid;
|
|
32
|
-
/**
|
|
33
|
-
* Spreads values as patterns with colors from a palette
|
|
34
|
-
*
|
|
35
|
-
* @param {number[]} values - values to spread
|
|
36
|
-
* @param {string[]} patterns - patterns to spread
|
|
37
|
-
* @param {string[]} palette - colors to spread
|
|
38
|
-
* @returns {Record<number, { id: string, pattern: string, color: string }>}
|
|
39
|
-
*/
|
|
40
|
-
export function spreadValuesAsPatterns(values: number[], patterns: string[], palette: string[]): Record<number, {
|
|
41
|
-
id: string;
|
|
42
|
-
pattern: string;
|
|
43
|
-
color: string;
|
|
44
|
-
}>;
|
|
45
|
-
export type GridPoint = {
|
|
46
|
-
/**
|
|
47
|
-
* - x-coordinate of the point
|
|
48
|
-
*/
|
|
49
|
-
x: number;
|
|
50
|
-
/**
|
|
51
|
-
* - y-coordinate of the point
|
|
52
|
-
*/
|
|
53
|
-
y: number;
|
|
54
|
-
/**
|
|
55
|
-
* - radius of the point
|
|
56
|
-
*/
|
|
57
|
-
r: number;
|
|
58
|
-
};
|
|
59
|
-
export type SwatchGrid = {
|
|
60
|
-
/**
|
|
61
|
-
* - width of the grid
|
|
62
|
-
*/
|
|
63
|
-
width: number;
|
|
64
|
-
/**
|
|
65
|
-
* - height of the grid
|
|
66
|
-
*/
|
|
67
|
-
height: number;
|
|
68
|
-
/**
|
|
69
|
-
* - data points of the grid
|
|
70
|
-
*/
|
|
71
|
-
data: GridPoint[];
|
|
72
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Svelte action: arrow key navigation between sibling data elements within a geom.
|
|
3
|
-
*
|
|
4
|
-
* When applied to a focusable SVG element with `enabled=true`, ArrowLeft/ArrowRight
|
|
5
|
-
* move focus between elements sharing the same `[data-plot-geom]` container.
|
|
6
|
-
*
|
|
7
|
-
* Usage: `<circle use:keyboardNav={keyboard} ...>`
|
|
8
|
-
*
|
|
9
|
-
* @param {Element} node
|
|
10
|
-
* @param {boolean} enabled
|
|
11
|
-
*/
|
|
12
|
-
export function keyboardNav(node: Element, enabled: boolean): {
|
|
13
|
-
update(newEnabled: any): void;
|
|
14
|
-
destroy: () => any;
|
|
15
|
-
};
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Common props shared by all high-level chart wrappers.
|
|
3
|
-
*/
|
|
4
|
-
export type ChartProps = {
|
|
5
|
-
/**
|
|
6
|
-
* - Data array to visualize
|
|
7
|
-
*/
|
|
8
|
-
data?: Object[] | undefined;
|
|
9
|
-
/**
|
|
10
|
-
* - Field name for the X axis
|
|
11
|
-
*/
|
|
12
|
-
x?: string | undefined;
|
|
13
|
-
/**
|
|
14
|
-
* - Field name for the Y axis
|
|
15
|
-
*/
|
|
16
|
-
y?: string | undefined;
|
|
17
|
-
/**
|
|
18
|
-
* - Field name for fill color grouping (alias for color)
|
|
19
|
-
*/
|
|
20
|
-
fill?: string | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* - Field name for color grouping
|
|
23
|
-
*/
|
|
24
|
-
color?: string | undefined;
|
|
25
|
-
/**
|
|
26
|
-
* - Field name for pattern fill grouping
|
|
27
|
-
*/
|
|
28
|
-
pattern?: string | undefined;
|
|
29
|
-
/**
|
|
30
|
-
* - Aggregation stat: 'identity' | 'sum' | 'mean' | 'count' | 'min' | 'max' | 'median' | 'boxplot'
|
|
31
|
-
*/
|
|
32
|
-
stat?: string | undefined;
|
|
33
|
-
/**
|
|
34
|
-
* - SVG width in pixels
|
|
35
|
-
*/
|
|
36
|
-
width?: number | undefined;
|
|
37
|
-
/**
|
|
38
|
-
* - SVG height in pixels
|
|
39
|
-
*/
|
|
40
|
-
height?: number | undefined;
|
|
41
|
-
/**
|
|
42
|
-
* - Color mode: 'light' | 'dark'
|
|
43
|
-
*/
|
|
44
|
-
mode?: string | undefined;
|
|
45
|
-
/**
|
|
46
|
-
* - Whether to show grid lines
|
|
47
|
-
*/
|
|
48
|
-
grid?: boolean | undefined;
|
|
49
|
-
/**
|
|
50
|
-
* - Whether to show the legend
|
|
51
|
-
*/
|
|
52
|
-
legend?: boolean | undefined;
|
|
53
|
-
};
|
|
54
|
-
export type BarChartProps = Object;
|
|
55
|
-
export type PieChartProps = {
|
|
56
|
-
/**
|
|
57
|
-
* - Data array to visualize
|
|
58
|
-
*/
|
|
59
|
-
data?: Object[] | undefined;
|
|
60
|
-
/**
|
|
61
|
-
* - Field name for slice labels (drives color key)
|
|
62
|
-
*/
|
|
63
|
-
label?: string | undefined;
|
|
64
|
-
/**
|
|
65
|
-
* - Field name for slice values (theta)
|
|
66
|
-
*/
|
|
67
|
-
y?: string | undefined;
|
|
68
|
-
/**
|
|
69
|
-
* - Alternative to label for color grouping
|
|
70
|
-
*/
|
|
71
|
-
fill?: string | undefined;
|
|
72
|
-
/**
|
|
73
|
-
* - Inner radius as fraction of outer (0=pie, 0.5=donut)
|
|
74
|
-
*/
|
|
75
|
-
innerRadius?: number | undefined;
|
|
76
|
-
/**
|
|
77
|
-
* - Aggregation stat (default sum for pie charts)
|
|
78
|
-
*/
|
|
79
|
-
stat?: string | undefined;
|
|
80
|
-
/**
|
|
81
|
-
* - SVG width in pixels
|
|
82
|
-
*/
|
|
83
|
-
width?: number | undefined;
|
|
84
|
-
/**
|
|
85
|
-
* - SVG height in pixels
|
|
86
|
-
*/
|
|
87
|
-
height?: number | undefined;
|
|
88
|
-
/**
|
|
89
|
-
* - Color mode: 'light' | 'dark'
|
|
90
|
-
*/
|
|
91
|
-
mode?: string | undefined;
|
|
92
|
-
/**
|
|
93
|
-
* - Whether to show the legend
|
|
94
|
-
*/
|
|
95
|
-
legend?: boolean | undefined;
|
|
96
|
-
};
|
|
97
|
-
export type BoxViolinChartProps = {
|
|
98
|
-
/**
|
|
99
|
-
* - Data array to visualize
|
|
100
|
-
*/
|
|
101
|
-
data?: Object[] | undefined;
|
|
102
|
-
/**
|
|
103
|
-
* - Field name for the category axis (groups)
|
|
104
|
-
*/
|
|
105
|
-
x?: string | undefined;
|
|
106
|
-
/**
|
|
107
|
-
* - Field name for the value axis (raw observations)
|
|
108
|
-
*/
|
|
109
|
-
y?: string | undefined;
|
|
110
|
-
/**
|
|
111
|
-
* - Field name for fill color; when different from x, sub-groups within each x-band (like grouped bars); lighter shade used for body, darker shade for whiskers/outline
|
|
112
|
-
*/
|
|
113
|
-
fill?: string | undefined;
|
|
114
|
-
/**
|
|
115
|
-
* - SVG width in pixels
|
|
116
|
-
*/
|
|
117
|
-
width?: number | undefined;
|
|
118
|
-
/**
|
|
119
|
-
* - SVG height in pixels
|
|
120
|
-
*/
|
|
121
|
-
height?: number | undefined;
|
|
122
|
-
/**
|
|
123
|
-
* - Color mode: 'light' | 'dark'
|
|
124
|
-
*/
|
|
125
|
-
mode?: string | undefined;
|
|
126
|
-
/**
|
|
127
|
-
* - Whether to show grid lines
|
|
128
|
-
*/
|
|
129
|
-
grid?: boolean | undefined;
|
|
130
|
-
/**
|
|
131
|
-
* - Whether to show the legend
|
|
132
|
-
*/
|
|
133
|
-
legend?: boolean | undefined;
|
|
134
|
-
};
|
|
135
|
-
export type ScatterBubbleChartProps = {
|
|
136
|
-
/**
|
|
137
|
-
* - Data array to visualize
|
|
138
|
-
*/
|
|
139
|
-
data?: Object[] | undefined;
|
|
140
|
-
/**
|
|
141
|
-
* - Field name for X position
|
|
142
|
-
*/
|
|
143
|
-
x?: string | undefined;
|
|
144
|
-
/**
|
|
145
|
-
* - Field name for Y position
|
|
146
|
-
*/
|
|
147
|
-
y?: string | undefined;
|
|
148
|
-
/**
|
|
149
|
-
* - Field name for color grouping
|
|
150
|
-
*/
|
|
151
|
-
color?: string | undefined;
|
|
152
|
-
/**
|
|
153
|
-
* - Field name for point radius (BubbleChart: required)
|
|
154
|
-
*/
|
|
155
|
-
size?: string | undefined;
|
|
156
|
-
/**
|
|
157
|
-
* - SVG width in pixels
|
|
158
|
-
*/
|
|
159
|
-
width?: number | undefined;
|
|
160
|
-
/**
|
|
161
|
-
* - SVG height in pixels
|
|
162
|
-
*/
|
|
163
|
-
height?: number | undefined;
|
|
164
|
-
/**
|
|
165
|
-
* - Color mode: 'light' | 'dark'
|
|
166
|
-
*/
|
|
167
|
-
mode?: string | undefined;
|
|
168
|
-
/**
|
|
169
|
-
* - Whether to show grid lines
|
|
170
|
-
*/
|
|
171
|
-
grid?: boolean | undefined;
|
|
172
|
-
/**
|
|
173
|
-
* - Whether to show the legend
|
|
174
|
-
*/
|
|
175
|
-
legend?: boolean | undefined;
|
|
176
|
-
};
|
|
177
|
-
export type LineAreaChartProps = Object;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Applies dimming state to data rows using crossfilter instance.
|
|
3
|
-
* Maps each row to { data: row, dimmed: boolean }.
|
|
4
|
-
*
|
|
5
|
-
* @param {Object[]} data - raw data array
|
|
6
|
-
* @param {Object} cf - crossfilter instance (from createCrossFilter)
|
|
7
|
-
* @param {Object} channels - { x, y, color, ... } field name mapping
|
|
8
|
-
* @returns {{ data: Object, dimmed: boolean }[]}
|
|
9
|
-
*/
|
|
10
|
-
export function applyDimming(data: Object[], cf: Object, channels: Object): {
|
|
11
|
-
data: Object;
|
|
12
|
-
dimmed: boolean;
|
|
13
|
-
}[];
|
package/dist/lib/plot/facet.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Splits data into a Map of panels keyed by facet field value.
|
|
3
|
-
* Preserves insertion order of first occurrence.
|
|
4
|
-
*
|
|
5
|
-
* @param {Object[]} data
|
|
6
|
-
* @param {string} field
|
|
7
|
-
* @returns {Map<unknown, Object[]>}
|
|
8
|
-
*/
|
|
9
|
-
export function splitByField(data: Object[], field: string): Map<unknown, Object[]>;
|
|
10
|
-
/**
|
|
11
|
-
* Computes x/y domains for each panel.
|
|
12
|
-
*
|
|
13
|
-
* @param {Map<unknown, Object[]>} panels
|
|
14
|
-
* @param {{ x: string, y: string }} channels
|
|
15
|
-
* @param {'fixed'|'free'|'free_x'|'free_y'} scalesMode
|
|
16
|
-
* @returns {Map<unknown, { xDomain: unknown[], yDomain: [number, number] }>}
|
|
17
|
-
*/
|
|
18
|
-
export function getFacetDomains(panels: Map<unknown, Object[]>, channels: {
|
|
19
|
-
x: string;
|
|
20
|
-
y: string;
|
|
21
|
-
}, scalesMode?: "fixed" | "free" | "free_x" | "free_y"): Map<unknown, {
|
|
22
|
-
xDomain: unknown[];
|
|
23
|
-
yDomain: [number, number];
|
|
24
|
-
}>;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Extracts animation frames from data, keyed by time field value.
|
|
3
|
-
* Preserves insertion order of time values.
|
|
4
|
-
*
|
|
5
|
-
* @param {Object[]} data
|
|
6
|
-
* @param {string} timeField
|
|
7
|
-
* @returns {Map<unknown, Object[]>}
|
|
8
|
-
*/
|
|
9
|
-
export function extractFrames(data: Object[], timeField: string): Map<unknown, Object[]>;
|
|
10
|
-
/**
|
|
11
|
-
* Ensures all frame values (byField) appear for every (x, color?) combination.
|
|
12
|
-
* Uses dataset alignBy to fill missing frame-value combos with y=0 so bars
|
|
13
|
-
* animate smoothly rather than disappearing between frames.
|
|
14
|
-
*
|
|
15
|
-
* Call after pre-aggregation. The result can be split directly by extractFrames
|
|
16
|
-
* with no further per-frame normalization needed.
|
|
17
|
-
*
|
|
18
|
-
* @param {Object[]} data - pre-aggregated rows, one per (x, color?, byField)
|
|
19
|
-
* @param {{ x?: string, y: string, color?: string }} channels
|
|
20
|
-
* @param {string} byField - the frame field (e.g. 'year')
|
|
21
|
-
* @returns {Object[]}
|
|
22
|
-
*/
|
|
23
|
-
export function completeFrames(data: Object[], channels: {
|
|
24
|
-
x?: string;
|
|
25
|
-
y: string;
|
|
26
|
-
color?: string;
|
|
27
|
-
}, byField: string): Object[];
|
|
28
|
-
/**
|
|
29
|
-
* Computes static x/y domains from the full (pre-split) data array.
|
|
30
|
-
* These domains stay constant throughout the animation so values are
|
|
31
|
-
* always comparable across frames.
|
|
32
|
-
*
|
|
33
|
-
* NOTE: y domain is pinned to [0, max] — assumes bar chart semantics.
|
|
34
|
-
* Pass an explicit yDomain override for scatter/line charts where y can
|
|
35
|
-
* be negative.
|
|
36
|
-
*
|
|
37
|
-
* @param {Object[]} data - full dataset (before frame extraction)
|
|
38
|
-
* @param {{ x: string, y: string }} channels
|
|
39
|
-
* @returns {{ xDomain: unknown[], yDomain: [number, number] }}
|
|
40
|
-
*/
|
|
41
|
-
export function computeStaticDomains(data: Object[], channels: {
|
|
42
|
-
x: string;
|
|
43
|
-
y: string;
|
|
44
|
-
}): {
|
|
45
|
-
xDomain: unknown[];
|
|
46
|
-
yDomain: [number, number];
|
|
47
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export function resolvePreset(name: any, helpers?: {}): {
|
|
2
|
-
colors: any;
|
|
3
|
-
patterns: any;
|
|
4
|
-
symbols: any;
|
|
5
|
-
};
|
|
6
|
-
export namespace DEFAULT_PRESET {
|
|
7
|
-
export let colors: any[];
|
|
8
|
-
export { PATTERN_ORDER as patterns };
|
|
9
|
-
export { SYMBOL_ORDER as symbols };
|
|
10
|
-
}
|
|
11
|
-
export namespace ACCESSIBLE_PRESET {
|
|
12
|
-
let colors_1: string[];
|
|
13
|
-
export { colors_1 as colors };
|
|
14
|
-
export { PATTERN_ORDER as patterns };
|
|
15
|
-
export { SYMBOL_ORDER as symbols };
|
|
16
|
-
}
|
|
17
|
-
export namespace PRINT_PRESET {
|
|
18
|
-
let colors_2: string[];
|
|
19
|
-
export { colors_2 as colors };
|
|
20
|
-
export let patterns: string[];
|
|
21
|
-
export { SYMBOL_ORDER as symbols };
|
|
22
|
-
}
|
|
23
|
-
export type PlotPreset = {
|
|
24
|
-
colors: string[];
|
|
25
|
-
patterns: string[];
|
|
26
|
-
symbols: string[];
|
|
27
|
-
};
|
|
28
|
-
import { PATTERN_ORDER } from '../brewing/patterns.js';
|
|
29
|
-
import { SYMBOL_ORDER } from '../brewing/symbols.js';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export function inferFieldType(data: any, field: any): "continuous" | "band";
|
|
2
|
-
export function inferOrientation(xType: any, yType: any): "none" | "vertical" | "horizontal";
|
|
3
|
-
export function buildUnifiedXScale(datasets: any, field: any, width: any, opts?: {}): any;
|
|
4
|
-
export function buildUnifiedYScale(datasets: any, field: any, height: any, opts?: {}): any;
|
|
5
|
-
export function inferColorScaleType(data: any, field: any, spec?: {}): any;
|
package/dist/lib/plot/stat.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolves a stat name to an aggregation function.
|
|
3
|
-
* Checks built-ins first, then helpers.stats, then warns and falls back to identity.
|
|
4
|
-
*
|
|
5
|
-
* @param {string} name
|
|
6
|
-
* @param {Object} helpers
|
|
7
|
-
* @returns {Function}
|
|
8
|
-
*/
|
|
9
|
-
export function resolveStat(name: string, helpers?: Object): Function;
|
|
10
|
-
/**
|
|
11
|
-
* Infers group-by fields from channels by excluding value fields.
|
|
12
|
-
* valueFields may contain channel keys (e.g. ['y', 'size']) OR field values (e.g. ['cty']).
|
|
13
|
-
* A channel's field is excluded if either the channel key OR the field value is in valueFields.
|
|
14
|
-
*
|
|
15
|
-
* @param {Record<string, string|undefined>} channels
|
|
16
|
-
* @param {string[]} valueFields
|
|
17
|
-
* @returns {string[]}
|
|
18
|
-
*/
|
|
19
|
-
export function inferGroupByFields(channels: Record<string, string | undefined>, valueFields: string[]): string[];
|
|
20
|
-
/**
|
|
21
|
-
* Applies a stat aggregation to data based on a geom config.
|
|
22
|
-
* Returns data unchanged for identity stat.
|
|
23
|
-
*
|
|
24
|
-
* @param {Object[]} data
|
|
25
|
-
* @param {{ stat?: string, channels?: Record<string, string> }} geomConfig
|
|
26
|
-
* @param {Object} helpers
|
|
27
|
-
* @returns {Object[]}
|
|
28
|
-
*/
|
|
29
|
-
export function applyGeomStat(data: Object[], geomConfig: {
|
|
30
|
-
stat?: string;
|
|
31
|
-
channels?: Record<string, string>;
|
|
32
|
-
}, helpers?: Object): Object[];
|
package/dist/lib/plot/types.d.ts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
export type GeomSpec = {
|
|
2
|
-
/**
|
|
3
|
-
* - Geom type: 'bar'|'line'|'area'|'point'|'box'|'violin'|'arc' or custom
|
|
4
|
-
*/
|
|
5
|
-
type: string;
|
|
6
|
-
x?: string | undefined;
|
|
7
|
-
y?: string | undefined;
|
|
8
|
-
color?: string | undefined;
|
|
9
|
-
fill?: string | undefined;
|
|
10
|
-
size?: string | undefined;
|
|
11
|
-
symbol?: string | undefined;
|
|
12
|
-
pattern?: string | undefined;
|
|
13
|
-
/**
|
|
14
|
-
* - Built-in or helpers.stats key
|
|
15
|
-
*/
|
|
16
|
-
stat?: string | undefined;
|
|
17
|
-
options?: Record<string, unknown> | undefined;
|
|
18
|
-
};
|
|
19
|
-
export type PlotSpec = {
|
|
20
|
-
data: Record<string, unknown>[];
|
|
21
|
-
x?: string | undefined;
|
|
22
|
-
y?: string | undefined;
|
|
23
|
-
color?: string | undefined;
|
|
24
|
-
fill?: string | undefined;
|
|
25
|
-
size?: string | undefined;
|
|
26
|
-
symbol?: string | undefined;
|
|
27
|
-
pattern?: string | undefined;
|
|
28
|
-
theta?: string | undefined;
|
|
29
|
-
labels?: Record<string, string> | undefined;
|
|
30
|
-
xDomain?: unknown[] | undefined;
|
|
31
|
-
yDomain?: number[] | undefined;
|
|
32
|
-
xLabel?: string | undefined;
|
|
33
|
-
yLabel?: string | undefined;
|
|
34
|
-
axisOrigin?: [number, number] | undefined;
|
|
35
|
-
colorScale?: "diverging" | "sequential" | "categorical" | undefined;
|
|
36
|
-
colorScheme?: string | undefined;
|
|
37
|
-
colorMidpoint?: number | undefined;
|
|
38
|
-
colorDomain?: unknown[] | undefined;
|
|
39
|
-
geoms: GeomSpec[];
|
|
40
|
-
facet?: {
|
|
41
|
-
by: string;
|
|
42
|
-
cols?: number;
|
|
43
|
-
scales?: "fixed" | "free" | "free_x" | "free_y";
|
|
44
|
-
} | undefined;
|
|
45
|
-
animate?: {
|
|
46
|
-
by: string;
|
|
47
|
-
duration?: number;
|
|
48
|
-
loop?: boolean;
|
|
49
|
-
} | undefined;
|
|
50
|
-
grid?: boolean | undefined;
|
|
51
|
-
legend?: boolean | undefined;
|
|
52
|
-
tooltip?: boolean | undefined;
|
|
53
|
-
title?: string | undefined;
|
|
54
|
-
preset?: string | undefined;
|
|
55
|
-
width?: number | undefined;
|
|
56
|
-
height?: number | undefined;
|
|
57
|
-
mode?: "light" | "dark" | undefined;
|
|
58
|
-
};
|
|
59
|
-
export type PlotHelpers = {
|
|
60
|
-
stats?: Record<string, (values: unknown[]) => unknown> | undefined;
|
|
61
|
-
format?: Record<string, (v: unknown) => string> | undefined;
|
|
62
|
-
tooltip?: ((d: Record<string, unknown>) => string) | undefined;
|
|
63
|
-
/**
|
|
64
|
-
* Svelte components keyed by type name
|
|
65
|
-
*/
|
|
66
|
-
geoms?: Record<string, unknown> | undefined;
|
|
67
|
-
/**
|
|
68
|
-
* d3 scale override
|
|
69
|
-
*/
|
|
70
|
-
colorScale?: unknown;
|
|
71
|
-
preset?: {
|
|
72
|
-
colors: string[];
|
|
73
|
-
patterns: string[];
|
|
74
|
-
symbols: string[];
|
|
75
|
-
} | undefined;
|
|
76
|
-
presets?: Record<string, {
|
|
77
|
-
colors: string[];
|
|
78
|
-
patterns: string[];
|
|
79
|
-
symbols: string[];
|
|
80
|
-
}> | undefined;
|
|
81
|
-
/**
|
|
82
|
-
* custom SVG pattern components keyed by name
|
|
83
|
-
*/
|
|
84
|
-
patterns?: Record<string, unknown> | undefined;
|
|
85
|
-
/**
|
|
86
|
-
* custom symbol shape components keyed by name
|
|
87
|
-
*/
|
|
88
|
-
symbols?: Record<string, unknown> | undefined;
|
|
89
|
-
};
|
package/dist/lib/preset.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a chart preset by deep-merging overrides with the default preset.
|
|
3
|
-
* All fields are optional. `opacity` is merged key-by-key so partial overrides work.
|
|
4
|
-
* @param {Partial<typeof defaultPreset>} [overrides]
|
|
5
|
-
* @returns {typeof defaultPreset}
|
|
6
|
-
*/
|
|
7
|
-
export function createChartPreset(overrides?: Partial<typeof defaultPreset>): typeof defaultPreset;
|
|
8
|
-
export namespace defaultPreset {
|
|
9
|
-
let colors: string[];
|
|
10
|
-
namespace shades {
|
|
11
|
-
namespace light {
|
|
12
|
-
let fill: string;
|
|
13
|
-
let stroke: string;
|
|
14
|
-
}
|
|
15
|
-
namespace dark {
|
|
16
|
-
let fill_1: string;
|
|
17
|
-
export { fill_1 as fill };
|
|
18
|
-
let stroke_1: string;
|
|
19
|
-
export { stroke_1 as stroke };
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
namespace opacity {
|
|
23
|
-
let area: number;
|
|
24
|
-
let box: number;
|
|
25
|
-
let violin: number;
|
|
26
|
-
let point: number;
|
|
27
|
-
}
|
|
28
|
-
let patterns: string[];
|
|
29
|
-
let symbols: string[];
|
|
30
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export function createScales(data: any, dimensions: any, options: any): {
|
|
2
|
-
xScale?: undefined;
|
|
3
|
-
yScale?: undefined;
|
|
4
|
-
colorScale?: undefined;
|
|
5
|
-
} | {
|
|
6
|
-
xScale: any;
|
|
7
|
-
yScale: any;
|
|
8
|
-
colorScale: Object | null;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Calculates the actual chart dimensions after applying margins
|
|
12
|
-
*
|
|
13
|
-
* @param {number} width
|
|
14
|
-
* @param {number} height
|
|
15
|
-
* @param {Object} margin
|
|
16
|
-
* @returns {Object} Dimensions with calculated inner width and height
|
|
17
|
-
*/
|
|
18
|
-
export function calculateChartDimensions(width: number, height: number, margin: Object): Object;
|
|
19
|
-
/**
|
|
20
|
-
* Gets the axis origin value
|
|
21
|
-
*
|
|
22
|
-
* @param {Object} scale D3 scale
|
|
23
|
-
* @returns {number} Origin value
|
|
24
|
-
*/
|
|
25
|
-
export function getOriginValue(scale: Object): number;
|
|
26
|
-
/**
|
|
27
|
-
* Creates axis ticks
|
|
28
|
-
*
|
|
29
|
-
* @param {Object} scale D3 scale
|
|
30
|
-
* @param {string} axis Axis type ('x' or 'y')
|
|
31
|
-
* @param {number} count Number of ticks
|
|
32
|
-
* @param {number} fontSize Font size for determining tick density
|
|
33
|
-
* @returns {Array} Array of tick objects
|
|
34
|
-
*/
|
|
35
|
-
export function createTicks(scale: Object, axis: string, count?: number, fontSize?: number): any[];
|
package/dist/lib/swatch.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export namespace swatch {
|
|
2
|
-
export { palette };
|
|
3
|
-
export namespace keys {
|
|
4
|
-
export let gray: string[];
|
|
5
|
-
export let color: string[];
|
|
6
|
-
export { shapes as symbol };
|
|
7
|
-
export { PATTERN_ORDER as pattern };
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
import palette from './palette.json';
|
|
11
|
-
import { shapes } from '../symbols';
|
|
12
|
-
import { PATTERN_ORDER } from './brewing/patterns.js';
|
package/dist/lib/ticks.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {Object} TickSteps
|
|
3
|
-
* @property {number} major - count of major ticks
|
|
4
|
-
* @property {number} minor - count of minor ticks
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Generate an array of ticks for a given axis and the tick type
|
|
8
|
-
*
|
|
9
|
-
* @param {number} lower - The lower bound of the axis
|
|
10
|
-
* @param {number} upper - The upper bound of the axis
|
|
11
|
-
* @param {TickSteps} steps - The number of steps between major and minor ticks
|
|
12
|
-
* @param {string} type - The type of tick to generate
|
|
13
|
-
*
|
|
14
|
-
* @returns {Array} - An array of objects representing the ticks
|
|
15
|
-
*/
|
|
16
|
-
export function ticksByType(lower: number, upper: number, steps: TickSteps, type: string): any[];
|
|
17
|
-
/**
|
|
18
|
-
* Generate an array of ticks for a given axis
|
|
19
|
-
*
|
|
20
|
-
* @param {number} lower - The lower bound of the axis
|
|
21
|
-
* @param {number} upper - The upper bound of the axis
|
|
22
|
-
* @param {TickSteps} steps - The number of steps between major and minor ticks
|
|
23
|
-
*
|
|
24
|
-
* @returns {Array} - An array of objects representing the ticks
|
|
25
|
-
*/
|
|
26
|
-
export function getTicks(lower: number, upper: number, steps?: TickSteps): any[];
|
|
27
|
-
export type TickSteps = {
|
|
28
|
-
/**
|
|
29
|
-
* - count of major ticks
|
|
30
|
-
*/
|
|
31
|
-
major: number;
|
|
32
|
-
/**
|
|
33
|
-
* - count of minor ticks
|
|
34
|
-
*/
|
|
35
|
-
minor: number;
|
|
36
|
-
};
|