@fjader/svelte 0.2.3 → 0.2.5
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/README.md +3 -1
- package/dist/animation/EntranceGate.d.ts +52 -0
- package/dist/animation/EntranceGate.js +93 -0
- package/dist/animation/TransitionClock.d.ts +61 -30
- package/dist/animation/TransitionClock.js +67 -29
- package/dist/animation/transition-log.d.ts +41 -0
- package/dist/animation/transition-log.js +57 -0
- package/dist/components/axes/AxisBottom.svelte +27 -8
- package/dist/components/axes/AxisBottom.svelte.d.ts +10 -0
- package/dist/components/axes/AxisCenter.svelte +4 -2
- package/dist/components/axes/AxisLeft.svelte +81 -10
- package/dist/components/axes/AxisLeft.svelte.d.ts +17 -0
- package/dist/components/axes/BandAxisTicks.svelte +4 -3
- package/dist/components/axes/axis-title.d.ts +30 -0
- package/dist/components/axes/axis-title.js +77 -0
- package/dist/components/charts/ChartCell.svelte +33 -6
- package/dist/components/charts/ChartCell.svelte.d.ts +9 -0
- package/dist/components/charts/ChartContainer.svelte +55 -5
- package/dist/components/charts/ChartContainer.svelte.d.ts +14 -1
- package/dist/components/charts/ChartHover.svelte.d.ts +14 -0
- package/dist/components/charts/ChartHover.svelte.js +22 -0
- package/dist/components/charts/ChartVisibility.svelte.d.ts +43 -0
- package/dist/components/charts/ChartVisibility.svelte.js +67 -0
- package/dist/components/guides/Grid.svelte +12 -1
- package/dist/components/guides/legend/ContinuousColorLegend.svelte +7 -1
- package/dist/components/guides/legend/OrdinalColorLegend.svelte +8 -5
- package/dist/components/marks/AreaMarkX.svelte +18 -4
- package/dist/components/marks/AreaMarkY.svelte +18 -4
- package/dist/components/marks/BarMarkX.svelte +20 -4
- package/dist/components/marks/BarMarkY.svelte +20 -4
- package/dist/components/marks/DotsMark.svelte +8 -3
- package/dist/components/marks/LineMark.svelte +13 -6
- package/dist/components/marks/ParallelCoordinatesMark.svelte +11 -2
- package/dist/components/marks/ParallelCoordinatesMark.svelte.d.ts +4 -0
- package/dist/components/marks/RectMark.svelte +8 -3
- package/dist/components/marks/RectXMark.svelte +9 -3
- package/dist/components/marks/RectYMark.svelte +9 -3
- package/dist/components/marks/RuleMarkX.svelte +31 -25
- package/dist/components/marks/RuleMarkY.svelte +31 -25
- package/dist/components/marks/TextMark.svelte +52 -14
- package/dist/components/marks/lifecycle/MarkLifecycleV2.svelte.d.ts +22 -1
- package/dist/components/marks/lifecycle/MarkLifecycleV2.svelte.js +579 -66
- package/dist/components/marks/lifecycle/domain-queries.d.ts +13 -2
- package/dist/components/marks/lifecycle/domain-queries.js +43 -11
- package/dist/components/marks/lifecycle/domain-registration.d.ts +6 -1
- package/dist/components/marks/lifecycle/domain-registration.js +17 -20
- package/dist/components/marks/lifecycle/other-rows.svelte.d.ts +112 -0
- package/dist/components/marks/lifecycle/other-rows.svelte.js +193 -0
- package/dist/components/marks/lifecycle/other-split.d.ts +80 -0
- package/dist/components/marks/lifecycle/other-split.js +112 -0
- package/dist/components/marks/lifecycle/query-builder.d.ts +53 -3
- package/dist/components/marks/lifecycle/query-builder.js +46 -23
- package/dist/components/marks/utils/MarkColor.svelte.d.ts +3 -1
- package/dist/components/marks/utils/MarkColor.svelte.js +33 -3
- package/dist/components/marks/utils/MarkSeries.svelte.d.ts +14 -1
- package/dist/components/marks/utils/MarkSeries.svelte.js +25 -1
- package/dist/components/marks/utils/MarkSize.svelte.js +4 -0
- package/dist/components/marks/utils/reactive-config.d.ts +1 -1
- package/dist/components/marks/utils/reactive-config.js +9 -0
- package/dist/components/marks/utils/tooltip-helpers.d.ts +4 -1
- package/dist/components/marks/utils/tooltip-helpers.js +2 -1
- package/dist/components/rendering/Areas.svelte +57 -19
- package/dist/components/rendering/Areas.svelte.d.ts +12 -0
- package/dist/components/rendering/BaseGPURenderer.svelte.d.ts +3 -1
- package/dist/components/rendering/BaseGPURenderer.svelte.js +4 -2
- package/dist/components/rendering/Dots.svelte +23 -3
- package/dist/components/rendering/Dots.svelte.d.ts +6 -0
- package/dist/components/rendering/GridLine.svelte +13 -1
- package/dist/components/rendering/GridLine.svelte.d.ts +5 -0
- package/dist/components/rendering/Lines.svelte +48 -13
- package/dist/components/rendering/Lines.svelte.d.ts +12 -0
- package/dist/components/rendering/ParallelLines.svelte +5 -5
- package/dist/components/rendering/Rects.svelte +164 -30
- package/dist/components/rendering/Rects.svelte.d.ts +23 -2
- package/dist/components/rendering/RuleX.svelte +1 -1
- package/dist/components/rendering/RuleY.svelte +1 -1
- package/dist/components/rendering/WebGPUCanvas.svelte +4 -2
- package/dist/components/rendering/activity-reads.d.ts +47 -12
- package/dist/components/rendering/activity-reads.js +61 -19
- package/dist/components/rendering/uniform-sizes.d.ts +1 -1
- package/dist/components/rendering/uniform-sizes.js +1 -1
- package/dist/config/ChartConfig.svelte.d.ts +10 -1
- package/dist/config/ChartConfig.svelte.js +17 -0
- package/dist/gpu/GPUCoordinator.svelte.d.ts +31 -1
- package/dist/gpu/GPUCoordinator.svelte.js +164 -7
- package/dist/gpu/MorphedChannels.d.ts +11 -28
- package/dist/gpu/MorphedChannels.js +72 -8
- package/dist/gpu/ScaleTemplateSystem.d.ts +20 -2
- package/dist/gpu/ScaleTemplateSystem.js +83 -6
- package/dist/index.d.ts +19 -4
- package/dist/index.js +22 -4
- package/dist/interactors/Interval1D.svelte +6 -1
- package/dist/interactors/Interval2D.svelte +6 -1
- package/dist/interactors/ParallelAxisSource.svelte +10 -1
- package/dist/interactors/Toggle.svelte +32 -3
- package/dist/interactors/Tooltip.svelte +138 -41
- package/dist/interactors/TooltipManager.svelte.d.ts +20 -5
- package/dist/interactors/TooltipManager.svelte.js +46 -12
- package/dist/interactors/other-tooltip.d.ts +16 -0
- package/dist/interactors/other-tooltip.js +22 -0
- package/dist/query-engine/CrossfilterSelection.svelte.d.ts +4 -2
- package/dist/query-engine/CrossfilterSelection.svelte.js +2 -0
- package/dist/query-engine/FieldActivity.svelte.d.ts +49 -1
- package/dist/query-engine/FieldActivity.svelte.js +175 -5
- package/dist/query-engine/FilterGroup.svelte.d.ts +23 -1
- package/dist/query-engine/FilterGroup.svelte.js +43 -3
- package/dist/query-engine/FilterGroupRegistry.svelte.d.ts +31 -3
- package/dist/query-engine/FilterGroupRegistry.svelte.js +62 -15
- package/dist/query-engine/MarkHandle.svelte.d.ts +28 -1
- package/dist/query-engine/MarkHandle.svelte.js +33 -1
- package/dist/query-engine/QueryEngine.d.ts +225 -5
- package/dist/query-engine/QueryEngine.js +697 -47
- package/dist/query-engine/categorical-identity.d.ts +41 -0
- package/dist/query-engine/categorical-identity.js +145 -65
- package/dist/query-engine/debug/query-log.d.ts +39 -0
- package/dist/query-engine/debug/query-log.js +90 -0
- package/dist/query-engine/duckdb.d.ts +55 -8
- package/dist/query-engine/duckdb.js +82 -30
- package/dist/query-engine/index.d.ts +7 -4
- package/dist/query-engine/index.js +3 -3
- package/dist/query-engine/preagg/BuildQueue.d.ts +33 -13
- package/dist/query-engine/preagg/BuildQueue.js +51 -15
- package/dist/query-engine/preagg/Preagg.d.ts +46 -3
- package/dist/query-engine/preagg/Preagg.js +159 -31
- package/dist/query-engine/preagg/plan.d.ts +33 -1
- package/dist/query-engine/preagg/plan.js +158 -14
- package/dist/query-engine/sliced-lane.d.ts +108 -0
- package/dist/query-engine/sliced-lane.js +299 -0
- package/dist/query-engine/source-routing.d.ts +106 -0
- package/dist/query-engine/source-routing.js +189 -0
- package/dist/query-engine/toggle-predicate.d.ts +21 -0
- package/dist/query-engine/toggle-predicate.js +29 -1
- package/dist/scales/ActivityTable.d.ts +5 -1
- package/dist/scales/ActivityTable.js +12 -3
- package/dist/scales/BandScaleState.svelte.d.ts +22 -9
- package/dist/scales/BandScaleState.svelte.js +39 -21
- package/dist/scales/ChartScales.svelte.d.ts +3 -0
- package/dist/scales/ChartScales.svelte.js +26 -8
- package/dist/scales/ColorScaleState.svelte.d.ts +18 -2
- package/dist/scales/ColorScaleState.svelte.js +138 -26
- package/dist/scales/LinearScaleState.svelte.d.ts +7 -10
- package/dist/scales/LinearScaleState.svelte.js +21 -39
- package/dist/scales/ScaleGeneration.svelte.d.ts +48 -0
- package/dist/scales/ScaleGeneration.svelte.js +42 -0
- package/dist/scales/ScaleRegistry.svelte.js +3 -1
- package/dist/scales/SlotTransition.d.ts +15 -1
- package/dist/scales/SlotTransition.js +33 -4
- package/dist/scales/TimeScaleState.svelte.d.ts +7 -3
- package/dist/scales/TimeScaleState.svelte.js +7 -7
- package/dist/scales/color-utils.d.ts +0 -3
- package/dist/scales/color-utils.js +0 -3
- package/dist/scales/entered.d.ts +8 -0
- package/dist/scales/entered.js +10 -0
- package/dist/spec/LazyQueryEngine.js +2 -19
- package/dist/spec/MarkRegistry.d.ts +3 -1
- package/dist/spec/MarkRegistry.js +13 -1
- package/dist/spec/PlotFromSpec.svelte +1 -0
- package/dist/spec/export.js +11 -2
- package/dist/spec/types.d.ts +43 -13
- package/dist/sql/bin.d.ts +25 -0
- package/dist/sql/bin.js +108 -5
- package/dist/theme.css +5 -4
- package/dist/transforms/TransformCompiler.d.ts +47 -2
- package/dist/transforms/TransformCompiler.js +70 -1
- package/dist/transforms/index.js +176 -42
- package/dist/types.d.ts +177 -2
- package/package.json +4 -3
package/dist/types.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ import type { ChartConfig } from './config/ChartConfig.svelte';
|
|
|
4
4
|
import type { DimValue } from './query-engine/categorical-identity';
|
|
5
5
|
import type { AutoBinNode } from './sql/bin';
|
|
6
6
|
import type { SelectionResponse } from './components/rendering/activity-reads';
|
|
7
|
+
/** What a mark does with NULL in its categorical channels; see BaseMarkProps.nulls. */
|
|
8
|
+
export type NullsResponse = 'keep' | 'drop';
|
|
7
9
|
import type { RollingAvgNode } from './sql/rolling-avg';
|
|
8
10
|
export type ContinuousScaleType = 'linear' | 'log' | 'symlog' | 'pow' | 'identity';
|
|
9
11
|
export type DiscreteScaleType = 'band' | 'point';
|
|
@@ -37,13 +39,27 @@ export type FieldRef = string | ExprNode;
|
|
|
37
39
|
* resolves against the chart's state, such as bin() or a rolling average.
|
|
38
40
|
*/
|
|
39
41
|
export type ChannelRef = FieldRef | AutoBinNode | RollingAvgNode;
|
|
40
|
-
/**
|
|
42
|
+
/** A category value a colour can be pinned to. */
|
|
43
|
+
export type ColorDomainValue = string | number | boolean | null;
|
|
44
|
+
/**
|
|
45
|
+
* Color prop: CSS constant, column name, object wrapper, SQL node, or null.
|
|
46
|
+
*
|
|
47
|
+
* The object wrapper takes a scheme and type, or explicit ordinal colours:
|
|
48
|
+
*
|
|
49
|
+
* { field: 'won', domain: [0, 1], range: ['#d62728', '#2ca02c'] }
|
|
50
|
+
*
|
|
51
|
+
* `range` replaces the scheme's colours, which go to the values in sorted
|
|
52
|
+
* order. `domain` pins values to them instead: domain[i] draws range[i], and
|
|
53
|
+
* values outside it draw the null colour. Either one makes the scale ordinal.
|
|
54
|
+
*/
|
|
41
55
|
export type ColorProp = FieldRef | {
|
|
42
56
|
field: string;
|
|
43
57
|
scheme?: ColorScheme;
|
|
44
58
|
type?: ColorScaleType;
|
|
45
59
|
constant?: number;
|
|
46
60
|
exponent?: number;
|
|
61
|
+
domain?: readonly ColorDomainValue[];
|
|
62
|
+
range?: readonly string[];
|
|
47
63
|
} | null;
|
|
48
64
|
/**
|
|
49
65
|
* A SQL transform modifies the Mosaic Query AST before execution.
|
|
@@ -58,6 +74,13 @@ export interface SqlTransform {
|
|
|
58
74
|
apply(query: SelectQuery, config?: MarkConfig): SelectQuery;
|
|
59
75
|
/** Channel aliases this transform adds to the result beyond the base select (e.g. stack's y0/y1). */
|
|
60
76
|
channels?: string[];
|
|
77
|
+
/**
|
|
78
|
+
* The row predicate this transform adds to the query, when that is all it does
|
|
79
|
+
* (`filter`). It applies to the source rows, before any grouping, so a query
|
|
80
|
+
* over a pre-aggregated table cannot apply it (the columns it names are gone):
|
|
81
|
+
* the table is built with it instead, and the read leaves it out.
|
|
82
|
+
*/
|
|
83
|
+
where?: unknown;
|
|
61
84
|
/**
|
|
62
85
|
* The channels whose values identify each row, leading term first, when this
|
|
63
86
|
* transform guarantees exactly one row per combination of them — or null when
|
|
@@ -68,6 +91,12 @@ export interface SqlTransform {
|
|
|
68
91
|
* band a mark may morph along.
|
|
69
92
|
*/
|
|
70
93
|
alignment?(aliases: string[], config?: MarkConfig): string[] | null;
|
|
94
|
+
/**
|
|
95
|
+
* The rows this transform would add to a result to pad it, as a SELECT of
|
|
96
|
+
* every alias, or null when it pads nothing. A pre-aggregated table is
|
|
97
|
+
* built with them, so its reads need no padding of their own (`padded`).
|
|
98
|
+
*/
|
|
99
|
+
padRows?(aliases: string[], config?: MarkConfig): string | null;
|
|
71
100
|
describe?(): string;
|
|
72
101
|
}
|
|
73
102
|
/** A JS transform processes client-side data after the query returns. */
|
|
@@ -104,6 +133,45 @@ export interface ChannelIdentity {
|
|
|
104
133
|
* when dense() pads from the whole dim as it did before.
|
|
105
134
|
*/
|
|
106
135
|
present?: string;
|
|
136
|
+
/**
|
|
137
|
+
* The NULL category's id, when the mark drops NULL (`nulls="drop"`): `dense()`
|
|
138
|
+
* pads no row for it, as its rows are filtered out.
|
|
139
|
+
*/
|
|
140
|
+
dropNullId?: number;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* One binned channel's bins, as `bin()` resolved them for a query, which
|
|
144
|
+
* `dense()` pads a histogram from. A rect's upper edge is the same bins with
|
|
145
|
+
* offset 1.
|
|
146
|
+
*/
|
|
147
|
+
export type BinPadding = NumericBinPadding | TimeBinPadding;
|
|
148
|
+
/** Numeric bins: edge k is `min + alpha * (k + offset)` for k in [0, count). */
|
|
149
|
+
export interface NumericBinPadding {
|
|
150
|
+
kind: 'number';
|
|
151
|
+
/** The binned column or expression, as SQL: a bin is NULL exactly where it is. */
|
|
152
|
+
source: string;
|
|
153
|
+
min: number;
|
|
154
|
+
alpha: number;
|
|
155
|
+
count: number;
|
|
156
|
+
offset: number;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Time buckets of `interval` (SQL, as `time_bucket` takes it) over the field's
|
|
160
|
+
* extent, minMs to maxMs. An edge is the bucket start plus `offset` intervals,
|
|
161
|
+
* drawn as seconds from the time scale's origin `t0` (epoch seconds), the form
|
|
162
|
+
* a time channel takes in the query. `count` estimates the buckets, for the
|
|
163
|
+
* row limit: months and years are not a fixed width.
|
|
164
|
+
*/
|
|
165
|
+
export interface TimeBinPadding {
|
|
166
|
+
kind: 'time';
|
|
167
|
+
/** The binned column or expression, as SQL: a bucket is NULL exactly where it is. */
|
|
168
|
+
source: string;
|
|
169
|
+
interval: string;
|
|
170
|
+
minMs: number;
|
|
171
|
+
maxMs: number;
|
|
172
|
+
t0: number;
|
|
173
|
+
count: number;
|
|
174
|
+
offset: number;
|
|
107
175
|
}
|
|
108
176
|
export interface MarkConfig {
|
|
109
177
|
markType: string;
|
|
@@ -115,6 +183,10 @@ export interface MarkConfig {
|
|
|
115
183
|
identity?: Record<string, ChannelIdentity>;
|
|
116
184
|
/** The query's GROUP BY channels, or null when it does not aggregate. Per query. */
|
|
117
185
|
groupKeys?: string[] | null;
|
|
186
|
+
/** The numeric `bin()` channels and their bins, which `dense()` pads from. Per query. */
|
|
187
|
+
bins?: Record<string, BinPadding> | null;
|
|
188
|
+
/** The query reads a table that already holds its padding rows. Per query. */
|
|
189
|
+
padded?: boolean;
|
|
118
190
|
[key: string]: unknown;
|
|
119
191
|
}
|
|
120
192
|
export interface ScaleMap {
|
|
@@ -184,6 +256,32 @@ export interface BaseMarkProps {
|
|
|
184
256
|
* - `'filter'`: every selection filters it, even on a field it draws by, so
|
|
185
257
|
* its aggregates are recomputed for the subset: top N within the selected
|
|
186
258
|
* region, shares within the selected groups.
|
|
259
|
+
* - `'ignore'`: no selection filters or dims it, its own chart's controls
|
|
260
|
+
* included, and a selection change never re-queries it. For context: the
|
|
261
|
+
* whole drawn faintly behind a filtered part, on the same scales, whose
|
|
262
|
+
* extent then keeps the axis still while the part changes. A click on its
|
|
263
|
+
* Other bar toggles, as under `'auto'`.
|
|
264
|
+
*
|
|
265
|
+
* Background totals are two layers of the same mark: an `'ignore'` one
|
|
266
|
+
* drawn faintly behind, the whole, and an `'auto'` one in front, the part a
|
|
267
|
+
* brush or click elsewhere leaves. Each bar shrinks over its total instead
|
|
268
|
+
* of losing it, and the y axis keeps the total's extent:
|
|
269
|
+
*
|
|
270
|
+
* ```svelte
|
|
271
|
+
* <BarMarkY table="flights" x="carrier" y={count()} selectionResponse="ignore" fillOpacity={0.2} />
|
|
272
|
+
* <BarMarkY table="flights" x="carrier" y={count()} />
|
|
273
|
+
* ```
|
|
274
|
+
*
|
|
275
|
+
* With a top N, choose which layer ranks; the other gets
|
|
276
|
+
* `contributeDomain={false}` and follows the axis:
|
|
277
|
+
*
|
|
278
|
+
* - the back layer, to rank once over the whole: the same N categories
|
|
279
|
+
* stay while the front bars shrink;
|
|
280
|
+
* - the front layer, to re-rank within the selection: the N categories
|
|
281
|
+
* change with it, and the whole is drawn for whichever are shown.
|
|
282
|
+
*
|
|
283
|
+
* Not with `includeOthers`: the follower has no Other row (see
|
|
284
|
+
* `contributeDomain`).
|
|
187
285
|
*
|
|
188
286
|
* A `'filter'` mark never dims. A legend, Toggle or band label filters it
|
|
189
287
|
* in its own chart too: every such control on the same fields shares one
|
|
@@ -196,12 +294,59 @@ export interface BaseMarkProps {
|
|
|
196
294
|
* own chart, so the marks under it do not move while it is dragged.
|
|
197
295
|
*/
|
|
198
296
|
selectionResponse?: SelectionResponse;
|
|
297
|
+
/**
|
|
298
|
+
* Whether this mark adds its categories to a band axis's domain (default
|
|
299
|
+
* `true`). `false`: the mark follows the axis the other marks on it decide
|
|
300
|
+
* (their categories, their order); rows of categories the axis does not show
|
|
301
|
+
* are not drawn. For a layer that gives context to another, such as the whole
|
|
302
|
+
* behind a part. It cannot rank or reduce its own categories, so `topN`, `sort`
|
|
303
|
+
* and an explicit `domain` are refused with it (an error is logged and the
|
|
304
|
+
* mark contributes).
|
|
305
|
+
*
|
|
306
|
+
* Known limit: when the axis shows an Other bucket (another mark's topN with
|
|
307
|
+
* `includeOthers`), a follower has no Other row of its own. Its bars of
|
|
308
|
+
* categories that leave the axis walk to Other's slot and are gone when the
|
|
309
|
+
* transition ends, and nothing draws the whole behind Other. Folding such
|
|
310
|
+
* categories into an Other row would need the follower's query to depend on
|
|
311
|
+
* the axis's current categories.
|
|
312
|
+
*/
|
|
313
|
+
contributeDomain?: boolean;
|
|
314
|
+
/**
|
|
315
|
+
* What this mark does with NULL in its categorical channels: its band axis,
|
|
316
|
+
* ordinal colour, series and facet.
|
|
317
|
+
*
|
|
318
|
+
* - `'keep'` (the default): NULL is a category like any other. It is ranked
|
|
319
|
+
* by its measure, drawn, and labelled "(null)", in the null colour.
|
|
320
|
+
* - `'drop'`: rows whose value in any of those channels is NULL are left out
|
|
321
|
+
* before any transform, so a top N ranks, and Other sums, without them.
|
|
322
|
+
*/
|
|
323
|
+
nulls?: NullsResponse;
|
|
324
|
+
/**
|
|
325
|
+
* Whether the chart's entrance waits for this mark's first data. Default
|
|
326
|
+
* true: the chart enters once every mark has landed, so later marks cannot
|
|
327
|
+
* widen the axes mid-entrance. False for a mark known to be slower than
|
|
328
|
+
* the rest: the chart enters without it, and it joins the entrance where it
|
|
329
|
+
* is, or appears after it. A chart waits at most a second past its first
|
|
330
|
+
* mark either way.
|
|
331
|
+
*/
|
|
332
|
+
holdsEntrance?: boolean;
|
|
199
333
|
scheme?: ColorScheme;
|
|
200
334
|
limit?: number;
|
|
201
335
|
transforms?: Transform[];
|
|
202
336
|
sort?: SortConfig | null;
|
|
203
337
|
domain?: DomainConfig | null;
|
|
204
|
-
|
|
338
|
+
/**
|
|
339
|
+
* Hover tooltips. `true` (the default) or `false`, or options:
|
|
340
|
+
*
|
|
341
|
+
* - `sortTable`: write the mark's tooltip table sorted by x, so a hover
|
|
342
|
+
* lookup can skip DuckDB row groups outside the pointer's box. Off by
|
|
343
|
+
* default: the sort delays the first hover (the table is written when the
|
|
344
|
+
* pointer enters the chart), and measured up to 2M rows it did not make
|
|
345
|
+
* lookups faster.
|
|
346
|
+
*/
|
|
347
|
+
tooltip?: boolean | {
|
|
348
|
+
sortTable?: boolean;
|
|
349
|
+
};
|
|
205
350
|
tooltipProximity?: 'x' | 'y' | 'xy';
|
|
206
351
|
tip?: (FieldRef | '*')[] | false;
|
|
207
352
|
fitDomain?: 'x' | 'y' | boolean;
|
|
@@ -272,6 +417,18 @@ export interface LODConfig {
|
|
|
272
417
|
/** Callback fired on LOD state transitions (decimation toggle, dots appear/disappear). */
|
|
273
418
|
onLODChange?: (state: LODChangeState) => void;
|
|
274
419
|
}
|
|
420
|
+
/**
|
|
421
|
+
* How a chart's marks enter when its data first draws.
|
|
422
|
+
*
|
|
423
|
+
* - `'auto'` (the default): bars, histograms and areas grow from 0 on their
|
|
424
|
+
* measure axis, showing magnitude; everything else fades in.
|
|
425
|
+
* - `'fade'`: every mark fades in. Calmer, for dense small multiples.
|
|
426
|
+
* - `'none'`: marks appear at once.
|
|
427
|
+
*
|
|
428
|
+
* Under `prefers-reduced-motion: reduce`, `'auto'` becomes `'fade'`. The axes
|
|
429
|
+
* never move on load: the entrance is the data's, not the viewport's.
|
|
430
|
+
*/
|
|
431
|
+
export type EntranceMode = 'auto' | 'fade' | 'none';
|
|
275
432
|
import type { Margin, Point, AxesResult } from './layout/ChartLayout.svelte';
|
|
276
433
|
import type { LinearScaleState } from './scales/LinearScaleState.svelte';
|
|
277
434
|
import type { BandScaleState } from './scales/BandScaleState.svelte';
|
|
@@ -331,6 +488,24 @@ export interface ChartContext {
|
|
|
331
488
|
readonly currentXScreenPoint: number | null | undefined;
|
|
332
489
|
readonly currentYScreenPoint: number | null | undefined;
|
|
333
490
|
readonly xScaleState: ScaleStateInstance | null | undefined;
|
|
491
|
+
/**
|
|
492
|
+
* How many times the chart's x or y scale has been replaced by another (not
|
|
493
|
+
* its first resolution). Marks rebuild their lifecycle when it changes.
|
|
494
|
+
*/
|
|
495
|
+
readonly scaleGeneration: number;
|
|
496
|
+
/**
|
|
497
|
+
* Whether any of the chart's cells is on screen (with a small margin).
|
|
498
|
+
* Marks stop re-querying while it is false; see MarkHandle.active.
|
|
499
|
+
*/
|
|
500
|
+
readonly visible: boolean;
|
|
501
|
+
/**
|
|
502
|
+
* Whether a visible chart other than this one draws `scale`: a catch-up
|
|
503
|
+
* springs such a scale rather than snapping it. See
|
|
504
|
+
* ChartVisibility.shownElsewhere.
|
|
505
|
+
*/
|
|
506
|
+
shownElsewhere(scale: object): boolean;
|
|
507
|
+
/** Whether the pointer is over any of the chart's cells (hover intent). */
|
|
508
|
+
readonly hovered: boolean;
|
|
334
509
|
readonly yScaleState: ScaleStateInstance | null | undefined;
|
|
335
510
|
readonly scaleTypes: {
|
|
336
511
|
x: string;
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"type": "git",
|
|
19
19
|
"url": "git+https://github.com/dlyngman/fjader.git"
|
|
20
20
|
},
|
|
21
|
-
"version": "0.2.
|
|
21
|
+
"version": "0.2.5",
|
|
22
22
|
"type": "module",
|
|
23
23
|
"svelte": "./dist/index.js",
|
|
24
24
|
"exports": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"prepack": "svelte-package",
|
|
42
42
|
"prepare": "svelte-kit sync || echo ''",
|
|
43
43
|
"format": "prettier --write .",
|
|
44
|
-
"lint": "prettier --check . && eslint .",
|
|
44
|
+
"lint": "prettier --check . && eslint . && node scripts/check-doc-blocks.mjs",
|
|
45
45
|
"test": "vitest",
|
|
46
46
|
"typecheck": "svelte-check --tsconfig ./jsconfig.json",
|
|
47
47
|
"build:widget": "vite build --config vite.widget.config.js",
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"@types/d3-color": "^3.1.3",
|
|
61
61
|
"@types/d3-scale": "^4.0.9",
|
|
62
62
|
"@types/d3-scale-chromatic": "^3.1.0",
|
|
63
|
+
"@uwdata/mosaic-sql": "^0.35.0",
|
|
63
64
|
"@webgpu/types": "^0.1.69",
|
|
64
65
|
"duckdb": "^1.4.4",
|
|
65
66
|
"eslint": "^10.0.0",
|
|
@@ -80,12 +81,12 @@
|
|
|
80
81
|
"vitest": "^4.0.18"
|
|
81
82
|
},
|
|
82
83
|
"peerDependencies": {
|
|
84
|
+
"@uwdata/mosaic-sql": "^0.34.2 || ^0.35.0",
|
|
83
85
|
"svelte": "^5.0.0"
|
|
84
86
|
},
|
|
85
87
|
"dependencies": {
|
|
86
88
|
"@duckdb/duckdb-wasm": "1.30.0",
|
|
87
89
|
"@uwdata/flechette": "2.3.0",
|
|
88
|
-
"@uwdata/mosaic-sql": "^0.34.2",
|
|
89
90
|
"d3-array": "^3.2.4",
|
|
90
91
|
"d3-color": "^3.1.0",
|
|
91
92
|
"d3-format": "^3.1.0",
|