@fjader/svelte 0.2.3 → 0.2.4

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.
Files changed (87) hide show
  1. package/README.md +2 -0
  2. package/dist/components/axes/AxisBottom.svelte +23 -6
  3. package/dist/components/axes/AxisBottom.svelte.d.ts +10 -0
  4. package/dist/components/axes/AxisLeft.svelte +77 -8
  5. package/dist/components/axes/AxisLeft.svelte.d.ts +17 -0
  6. package/dist/components/axes/BandAxisTicks.svelte +1 -1
  7. package/dist/components/axes/axis-title.d.ts +30 -0
  8. package/dist/components/axes/axis-title.js +77 -0
  9. package/dist/components/charts/ChartCell.svelte +1 -1
  10. package/dist/components/charts/ChartContainer.svelte +10 -2
  11. package/dist/components/charts/ChartContainer.svelte.d.ts +7 -0
  12. package/dist/components/guides/legend/ContinuousColorLegend.svelte +7 -1
  13. package/dist/components/guides/legend/OrdinalColorLegend.svelte +8 -5
  14. package/dist/components/marks/AreaMarkX.svelte +2 -0
  15. package/dist/components/marks/AreaMarkY.svelte +2 -0
  16. package/dist/components/marks/BarMarkX.svelte +13 -1
  17. package/dist/components/marks/BarMarkY.svelte +13 -1
  18. package/dist/components/marks/DotsMark.svelte +2 -0
  19. package/dist/components/marks/LineMark.svelte +5 -1
  20. package/dist/components/marks/ParallelCoordinatesMark.svelte +4 -0
  21. package/dist/components/marks/ParallelCoordinatesMark.svelte.d.ts +2 -0
  22. package/dist/components/marks/RectMark.svelte +2 -0
  23. package/dist/components/marks/RectXMark.svelte +2 -0
  24. package/dist/components/marks/RectYMark.svelte +2 -0
  25. package/dist/components/marks/RuleMarkX.svelte +2 -0
  26. package/dist/components/marks/RuleMarkY.svelte +2 -0
  27. package/dist/components/marks/TextMark.svelte +8 -9
  28. package/dist/components/marks/lifecycle/MarkLifecycleV2.svelte.d.ts +6 -1
  29. package/dist/components/marks/lifecycle/MarkLifecycleV2.svelte.js +187 -18
  30. package/dist/components/marks/lifecycle/domain-queries.d.ts +3 -1
  31. package/dist/components/marks/lifecycle/domain-queries.js +11 -6
  32. package/dist/components/marks/lifecycle/domain-registration.js +2 -6
  33. package/dist/components/marks/lifecycle/other-rows.svelte.d.ts +104 -0
  34. package/dist/components/marks/lifecycle/other-rows.svelte.js +193 -0
  35. package/dist/components/marks/lifecycle/other-split.d.ts +80 -0
  36. package/dist/components/marks/lifecycle/other-split.js +112 -0
  37. package/dist/components/marks/lifecycle/query-builder.d.ts +26 -1
  38. package/dist/components/marks/lifecycle/query-builder.js +25 -5
  39. package/dist/components/marks/utils/reactive-config.d.ts +1 -1
  40. package/dist/components/marks/utils/reactive-config.js +6 -0
  41. package/dist/components/marks/utils/tooltip-helpers.d.ts +4 -1
  42. package/dist/components/marks/utils/tooltip-helpers.js +2 -1
  43. package/dist/components/rendering/BaseGPURenderer.svelte.d.ts +3 -1
  44. package/dist/components/rendering/BaseGPURenderer.svelte.js +4 -2
  45. package/dist/components/rendering/Rects.svelte +117 -23
  46. package/dist/components/rendering/Rects.svelte.d.ts +7 -0
  47. package/dist/components/rendering/activity-reads.d.ts +18 -0
  48. package/dist/components/rendering/activity-reads.js +19 -0
  49. package/dist/config/ChartConfig.svelte.d.ts +3 -1
  50. package/dist/gpu/MorphedChannels.d.ts +6 -32
  51. package/dist/gpu/MorphedChannels.js +45 -3
  52. package/dist/gpu/ScaleTemplateSystem.js +25 -4
  53. package/dist/index.d.ts +2 -0
  54. package/dist/index.js +3 -0
  55. package/dist/interactors/Interval1D.svelte +6 -1
  56. package/dist/interactors/Interval2D.svelte +6 -1
  57. package/dist/interactors/ParallelAxisSource.svelte +10 -1
  58. package/dist/interactors/Toggle.svelte +32 -3
  59. package/dist/interactors/Tooltip.svelte +138 -41
  60. package/dist/interactors/TooltipManager.svelte.d.ts +20 -5
  61. package/dist/interactors/TooltipManager.svelte.js +32 -7
  62. package/dist/interactors/other-tooltip.d.ts +16 -0
  63. package/dist/interactors/other-tooltip.js +22 -0
  64. package/dist/query-engine/FieldActivity.svelte.d.ts +50 -1
  65. package/dist/query-engine/FieldActivity.svelte.js +176 -5
  66. package/dist/query-engine/FilterGroup.svelte.d.ts +23 -1
  67. package/dist/query-engine/FilterGroup.svelte.js +43 -3
  68. package/dist/query-engine/FilterGroupRegistry.svelte.d.ts +31 -3
  69. package/dist/query-engine/FilterGroupRegistry.svelte.js +62 -15
  70. package/dist/query-engine/QueryEngine.js +26 -6
  71. package/dist/query-engine/categorical-identity.d.ts +15 -0
  72. package/dist/query-engine/categorical-identity.js +15 -0
  73. package/dist/query-engine/preagg/plan.d.ts +5 -0
  74. package/dist/query-engine/preagg/plan.js +31 -7
  75. package/dist/query-engine/toggle-predicate.d.ts +21 -0
  76. package/dist/query-engine/toggle-predicate.js +29 -1
  77. package/dist/scales/ActivityTable.d.ts +5 -1
  78. package/dist/scales/ActivityTable.js +12 -3
  79. package/dist/scales/BandScaleState.svelte.d.ts +13 -8
  80. package/dist/scales/BandScaleState.svelte.js +23 -16
  81. package/dist/spec/types.d.ts +2 -0
  82. package/dist/theme.css +5 -4
  83. package/dist/transforms/TransformCompiler.d.ts +37 -2
  84. package/dist/transforms/TransformCompiler.js +44 -1
  85. package/dist/transforms/index.js +32 -18
  86. package/dist/types.d.ts +41 -0
  87. package/package.json +3 -2
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';
@@ -58,6 +60,13 @@ export interface SqlTransform {
58
60
  apply(query: SelectQuery, config?: MarkConfig): SelectQuery;
59
61
  /** Channel aliases this transform adds to the result beyond the base select (e.g. stack's y0/y1). */
60
62
  channels?: string[];
63
+ /**
64
+ * The row predicate this transform adds to the query, when that is all it does
65
+ * (`filter`). It applies to the source rows, before any grouping, so a query
66
+ * over a pre-aggregated table cannot apply it (the columns it names are gone):
67
+ * the table is built with it instead, and the read leaves it out.
68
+ */
69
+ where?: unknown;
61
70
  /**
62
71
  * The channels whose values identify each row, leading term first, when this
63
72
  * transform guarantees exactly one row per combination of them — or null when
@@ -104,6 +113,11 @@ export interface ChannelIdentity {
104
113
  * when dense() pads from the whole dim as it did before.
105
114
  */
106
115
  present?: string;
116
+ /**
117
+ * The NULL category's id, when the mark drops NULL (`nulls="drop"`): `dense()`
118
+ * pads no row for it, as its rows are filtered out.
119
+ */
120
+ dropNullId?: number;
107
121
  }
108
122
  export interface MarkConfig {
109
123
  markType: string;
@@ -196,6 +210,33 @@ export interface BaseMarkProps {
196
210
  * own chart, so the marks under it do not move while it is dragged.
197
211
  */
198
212
  selectionResponse?: SelectionResponse;
213
+ /**
214
+ * Whether this mark adds its categories to a band axis's domain (default
215
+ * `true`). `false`: the mark follows the axis the other marks on it decide
216
+ * (their categories, their order); rows of categories the axis does not show
217
+ * are not drawn. For a layer that gives context to another, such as the whole
218
+ * behind a part. It cannot rank or reduce its own categories, so `topN`, `sort`
219
+ * and an explicit `domain` are refused with it (an error is logged and the
220
+ * mark contributes).
221
+ *
222
+ * Known limit: when the axis shows an Other bucket (another mark's topN with
223
+ * `includeOthers`), a follower has no Other row of its own. Its bars of
224
+ * categories that leave the axis walk to Other's slot and are gone when the
225
+ * transition ends, and nothing draws the whole behind Other. Folding such
226
+ * categories into an Other row would need the follower's query to depend on
227
+ * the axis's current categories.
228
+ */
229
+ contributeDomain?: boolean;
230
+ /**
231
+ * What this mark does with NULL in its categorical channels: its band axis,
232
+ * ordinal colour, series and facet.
233
+ *
234
+ * - `'keep'` (the default): NULL is a category like any other. It is ranked
235
+ * by its measure, drawn, and labelled "(null)", in the null colour.
236
+ * - `'drop'`: rows whose value in any of those channels is NULL are left out
237
+ * before any transform, so a top N ranks, and Other sums, without them.
238
+ */
239
+ nulls?: NullsResponse;
199
240
  scheme?: ColorScheme;
200
241
  limit?: number;
201
242
  transforms?: Transform[];
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.3",
21
+ "version": "0.2.4",
22
22
  "type": "module",
23
23
  "svelte": "./dist/index.js",
24
24
  "exports": {
@@ -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",