svelteplot 0.6.0-pr-262.0 → 0.6.0-pr-263.1

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.
@@ -13,4 +13,4 @@ export declare const CSS_COLOR_MIX: RegExp;
13
13
  export declare const CSS_COLOR_CONTRAST: RegExp;
14
14
  export declare const CSS_RGBA: RegExp;
15
15
  export declare const CSS_URL: RegExp;
16
- export declare const INDEX: unique symbol;
16
+ export declare const INDEX: any;
@@ -1,13 +1,10 @@
1
- import { interpolateBrBG } from 'd3-scale-chromatic';
2
1
  import type { ColorScheme } from '../types/index.js';
3
- export declare const categoricalSchemes: Map<string, readonly string[]>;
4
- export declare function isCategoricalScheme(scheme: string): boolean;
5
- type SchemeGetter = (n: number) => readonly string[];
6
- export declare function isOrdinalScheme(scheme: ColorScheme): boolean;
7
- export declare function ordinalScheme(scheme: string): SchemeGetter | undefined;
8
- export declare function ordinalRange(scheme: string, length: number): readonly string[] | undefined;
2
+ export declare const categoricalSchemes: any;
3
+ export declare function isCategoricalScheme(scheme: string): any;
4
+ export declare function isOrdinalScheme(scheme: ColorScheme): any;
5
+ export declare function ordinalScheme(scheme: string): any;
6
+ export declare function ordinalRange(scheme: string, length: number): any;
9
7
  export declare function maybeBooleanRange(domain: boolean[], scheme?: string): any[] | undefined;
10
- export declare function isQuantitativeScheme(scheme: string): boolean;
11
- export declare function quantitativeScheme(scheme: string): typeof interpolateBrBG | undefined;
12
- export declare function isDivergingScheme(scheme: string): boolean;
13
- export {};
8
+ export declare function isQuantitativeScheme(scheme: string): any;
9
+ export declare function quantitativeScheme(scheme: string): any;
10
+ export declare function isDivergingScheme(scheme: string): any;
@@ -9,4 +9,4 @@ import type { GenericMarkOptions, Mark, RawValue } from '../types/index.js';
9
9
  * @param fyValues y facet domain
10
10
  * @returns
11
11
  */
12
- export declare function getEmptyFacets(marks: Mark<GenericMarkOptions>[], fxValues: RawValue[], fyValues: RawValue[]): Map<RawValue, Map<RawValue, boolean>>;
12
+ export declare function getEmptyFacets(marks: Mark<GenericMarkOptions>[], fxValues: RawValue[], fyValues: RawValue[]): any;
@@ -1,9 +1,7 @@
1
1
  import type { Channels } from '../types/index.js';
2
2
  import type { DataRow } from '../types/index.js';
3
- export declare function getBaseStylesObject(datum: DataRow, props: Partial<Channels>): {
4
- [k: string]: string | number;
5
- };
6
- export default function (datum: DataRow, props: Partial<Channels>): string;
3
+ export declare function getBaseStylesObject(datum: DataRow, props: Partial<Channels>): any;
4
+ export default function (datum: DataRow, props: Partial<Channels>): any;
7
5
  export declare function maybeToPixel(cssKey: string, value: string | number): string | number;
8
6
  export declare function maybeFromPixel(value: string | number): string | number;
9
7
  export declare function maybeFromRem(value: string | number, rootFontSize?: number): string | number;
@@ -15,4 +15,4 @@ export declare const POSITION_CHANNELS: Set<ChannelName>;
15
15
  export declare function parseInset(inset: number | string, width: number): number;
16
16
  export declare function omit<T extends {}, K extends keyof T>(obj: T, ...keys: K[]): Omit<T, K>;
17
17
  export declare function identity<T>(x: T): T;
18
- export declare const GEOJSON_PREFER_STROKE: Set<string>;
18
+ export declare const GEOJSON_PREFER_STROKE: any;
@@ -4,7 +4,7 @@ type ReducerOption = ReducerName | ReducerFunc;
4
4
  type Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
5
5
  export type ReducerPercentile = (`p${Digit}${Digit}` & Record<never, never>) | 'p25' | 'p50' | 'p75';
6
6
  export type ReducerName = 'count' | 'deviation' | 'difference' | 'first' | 'last' | 'max' | 'mean' | 'median' | 'min' | 'mode' | 'ratio' | 'sum' | 'variance' | ReducerPercentile;
7
- export declare const Reducer: Record<ReducerName, ReducerFunc>;
7
+ export declare const Reducer: any;
8
8
  export declare function mayberReducer(r: ReducerOption): ReducerFunc;
9
9
  export declare function reduceOutputs(newDatum: DataRecord, data: DataRecord[], options: Record<ChannelName, ReducerOption>, outputs: Iterable<ChannelName>, channels: Channels, newChannels: Channels): void;
10
10
  export {};
@@ -1,4 +1,4 @@
1
- import type { ChannelAccessor, GenericMarkOptions, Mark, MarkType, PlotDefaults, PlotOptions, PlotScales, PlotState, RawValue, ScaleName, ScaleOptions, ScaleType, ScaledChannelName, UsedScales } from '../types/index.js';
1
+ import type { GenericMarkOptions, Mark, MarkType, PlotDefaults, PlotOptions, PlotScales, PlotState, RawValue, ScaleName, ScaleOptions, ScaleType, UsedScales } from '../types/index.js';
2
2
  /**
3
3
  * compute the plot scales
4
4
  */
@@ -8,7 +8,7 @@ export declare function createScale<T extends ScaleOptions>(name: ScaleName, sca
8
8
  domain: number[];
9
9
  range: number[];
10
10
  fn: (() => string) | (() => number);
11
- skip: Map<any, any>;
11
+ skip: any;
12
12
  isDummy: boolean;
13
13
  manualActiveMarks?: undefined;
14
14
  uniqueScaleProps?: undefined;
@@ -18,9 +18,9 @@ export declare function createScale<T extends ScaleOptions>(name: ScaleName, sca
18
18
  domain: any;
19
19
  range: any;
20
20
  fn: any;
21
- skip: Map<ScaledChannelName, Set<symbol>>;
21
+ skip: any;
22
22
  manualActiveMarks: number;
23
- uniqueScaleProps: Set<ChannelAccessor>;
23
+ uniqueScaleProps: any;
24
24
  autoTitle: string | null;
25
25
  isDummy?: undefined;
26
26
  };
@@ -36,7 +36,7 @@ export declare function inferScaleType(name: ScaleName, dataValues: RawValue[],
36
36
  * not. That's what this function is used for.
37
37
  */
38
38
  export declare function getUsedScales(plot: PlotState, options: GenericMarkOptions, mark: Mark<GenericMarkOptions>): UsedScales;
39
- export declare function looksLikeANumber(input: string | number): boolean;
39
+ export declare function looksLikeANumber(input: string | number): any;
40
40
  export declare function projectXY(scales: PlotScales, x: RawValue, y: RawValue, useXScale?: boolean, useYScale?: boolean): [number, number];
41
41
  export declare function projectX(channel: 'x' | 'x1' | 'x2', scales: PlotScales, value: RawValue): number;
42
42
  export declare function projectY(channel: 'y' | 'y1' | 'y2', scales: PlotScales, value: RawValue): number;
@@ -1,5 +1,5 @@
1
1
  import { type SymbolType } from 'd3-shape';
2
2
  export declare const sqrt3: number;
3
3
  export declare const sqrt4_3: number;
4
- export declare function isSymbol(value: string | SymbolType): boolean;
5
- export declare function maybeSymbol(symbol: SymbolType | string): SymbolType;
4
+ export declare function isSymbol(value: string | SymbolType): any;
5
+ export declare function maybeSymbol(symbol: SymbolType | string): any;
@@ -1,6 +1,6 @@
1
- export declare const durations: Map<string, number>;
2
- export declare const intervalDuration: unique symbol;
3
- export declare const intervalType: unique symbol;
1
+ export declare const durations: any;
2
+ export declare const intervalDuration: any;
3
+ export declare const intervalType: any;
4
4
  export declare function parseTimeInterval(input: string): [string, number];
5
5
  export declare function maybeTimeInterval(input: string): any;
6
6
  export declare function maybeUtcInterval(input: string): any;
@@ -2,9 +2,9 @@ import type { RawValue } from '../types/index.js';
2
2
  export declare function isBooleanOrNull(v: RawValue): boolean;
3
3
  export declare function isDate(v: RawValue): v is Date;
4
4
  export declare function isDateOrNull(v: RawValue | null | undefined): boolean;
5
- export declare function isNumberOrNull(v: RawValue | null | undefined): boolean;
6
- export declare function isNumberOrNullOrNaN(v: RawValue | null | undefined): boolean;
5
+ export declare function isNumberOrNull(v: RawValue | null | undefined): any;
6
+ export declare function isNumberOrNullOrNaN(v: RawValue | null | undefined): any;
7
7
  export declare function isStringOrNull(v: RawValue | null | undefined): boolean;
8
- export declare function isSymbolOrNull(v: RawValue | null | undefined): boolean;
8
+ export declare function isSymbolOrNull(v: RawValue | null | undefined): any;
9
9
  export declare function isColorOrNull(v: RawValue | null | undefined): any;
10
- export declare function isOpacityOrNull(v: RawValue): boolean;
10
+ export declare function isOpacityOrNull(v: RawValue): any;
@@ -33,17 +33,14 @@
33
33
  onbrushend?: (evt: BrushEvent) => void;
34
34
  onbrush?: (evt: BrushEvent) => void;
35
35
  }
36
- import { getContext, untrack } from 'svelte';
36
+ import { getContext } from 'svelte';
37
37
  import Rect from './Rect.svelte';
38
38
  import type { BaseMarkProps, DataRecord, PlotContext } from '../types/index.js';
39
39
  import { clientToLayerCoordinates } from './helpers/events.js';
40
40
  import Frame from './Frame.svelte';
41
41
  import { getPlotDefaults } from '../hooks/plotDefaults.js';
42
42
 
43
- let { brush: brushExternal = $bindable({ enabled: false }), ...markProps }: BrushMarkProps =
44
- $props();
45
-
46
- let brush = $state<Brush>(brushExternal);
43
+ let { brush = $bindable({ enabled: false }), ...markProps }: BrushMarkProps = $props();
47
44
 
48
45
  const DEFAULTS = {
49
46
  stroke: 'currentColor',
@@ -182,7 +179,6 @@
182
179
  );
183
180
 
184
181
  $effect(() => {
185
- // update brush prop when internal state changes
186
182
  brush.x1 =
187
183
  !brush.enabled || limitDimension === 'y'
188
184
  ? undefined
@@ -201,39 +197,6 @@
201
197
  : constrain(y1 > y2 ? y1 : y2, yDomain);
202
198
  });
203
199
 
204
- // update internal state when external brush prop changes
205
- $effect(() => {
206
- const brushInt = untrack(() => brush);
207
- if (!brushIdentical(brushInt, brushExternal)) {
208
- brush = brushExternal;
209
- // also keep internal x1,x2,y1,y2 in sync
210
- x1 = brush.x1 as Date | number;
211
- x2 = brush.x2 as Date | number;
212
- y1 = brush.y1 as Date | number;
213
- y2 = brush.y2 as Date | number;
214
- onbrush?.({ brush } as BrushEvent);
215
- }
216
- });
217
-
218
- // update external brush when internal state changes
219
- $effect(() => {
220
- const brushExt = untrack(() => brushExternal);
221
- if (!brushIdentical(brush, brushExt)) {
222
- // avoid cycles
223
- brushExternal = brush;
224
- }
225
- });
226
-
227
- function brushIdentical(b1: Brush, b2: Brush) {
228
- return (
229
- b1.enabled === b2.enabled &&
230
- b1.x1 === b2.x1 &&
231
- b1.x2 === b2.x2 &&
232
- b1.y1 === b2.y1 &&
233
- b1.y2 === b2.y2
234
- );
235
- }
236
-
237
200
  function constrain<T extends number | Date>(x: T, extent: [typeof x, typeof x]) {
238
201
  const minE = extent[0] < extent[1] ? extent[0] : extent[1];
239
202
  const maxE = extent[0] > extent[1] ? extent[0] : extent[1];
@@ -279,12 +242,8 @@
279
242
  } else {
280
243
  // draw new brush selection
281
244
  action = 'draw';
282
- if (typeof xScaleFn.invert === 'function' && limitDimension !== 'y') {
283
- x1 = x2 = xScaleFn.invert(dragStart[0]);
284
- }
285
- if (typeof yScaleFn.invert === 'function' && limitDimension !== 'x') {
286
- y1 = y2 = yScaleFn.invert(dragStart[1]);
287
- }
245
+ x1 = x2 = xScaleFn.invert(dragStart[0]);
246
+ y1 = y2 = yScaleFn.invert(dragStart[1]);
288
247
  }
289
248
  onbrushstart?.({ ...e, brush });
290
249
  }
@@ -76,7 +76,7 @@ declare class __sveltets_Render<Datum extends DataRecord> {
76
76
  * the font size of the text
77
77
  */
78
78
  fontFamily?: ConstantAccessor<CSS.Property.FontFamily, Datum>;
79
- fontSize?: ConstantAccessor<number | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | (string & {}) | "small" | "medium" | "large" | "x-large" | "x-small" | "xx-large" | "xx-small" | "xxx-large" | "larger" | "smaller", Datum>;
79
+ fontSize?: ConstantAccessor<number | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | (string & {}) | "small" | "math" | "large" | "medium" | "x-large" | "x-small" | "xx-large" | "xx-small" | "xxx-large" | "larger" | "smaller", Datum>;
80
80
  fontWeight?: ConstantAccessor<CSS.Property.FontWeight, Datum>;
81
81
  fontStyle?: ConstantAccessor<CSS.Property.FontStyle, Datum>;
82
82
  fontVariant?: ConstantAccessor<CSS.Property.FontVariant, Datum>;
@@ -1,8 +1,5 @@
1
1
  import type { DataRecord, TransformArg } from '../types/index.js';
2
- declare const CENTROID: unique symbol;
3
- type WithCentroid<T> = T & {
4
- [CENTROID]: [number, number];
5
- };
2
+ type WithCentroid<T> = T & {};
6
3
  export declare function geoCentroid<Datum extends DataRecord>({ data, ...options }: {
7
4
  data: Datum[];
8
5
  } & TransformArg<Datum>): TransformArg<WithCentroid<Datum>>;
@@ -1,7 +1,7 @@
1
1
  import type { TransformArgsRow, TransformArgsRecord } from '../types/index.js';
2
- export declare const X: unique symbol;
3
- export declare const Y: unique symbol;
4
- export declare const RAW_VALUE: unique symbol;
2
+ export declare const X: any;
3
+ export declare const Y: any;
4
+ export declare const RAW_VALUE: any;
5
5
  export declare function indexData<T extends object>(data: T[]): (T & {})[];
6
6
  export declare function recordizeX<T>({ data, ...channels }: TransformArgsRow<T>, { withIndex }?: {
7
7
  withIndex: boolean;
@@ -1,6 +1,6 @@
1
1
  import type { DataRow, TransformArg } from '../types/index.js';
2
- export declare const SORT_KEY: unique symbol;
3
- export declare const IS_SORTED: unique symbol;
2
+ export declare const SORT_KEY: any;
3
+ export declare const IS_SORTED: any;
4
4
  export declare function sort<T>({ data, ...channels }: TransformArg<T>, options?: {
5
5
  reverse?: boolean;
6
6
  }): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelteplot",
3
- "version": "0.6.0-pr-262.0",
3
+ "version": "0.6.0-pr-263.1",
4
4
  "license": "ISC",
5
5
  "author": {
6
6
  "name": "Gregor Aisch",
@@ -57,13 +57,13 @@
57
57
  "@sveltejs/adapter-auto": "^6.1.1",
58
58
  "@sveltejs/adapter-static": "^3.0.10",
59
59
  "@sveltejs/eslint-config": "^8.3.4",
60
- "@sveltejs/kit": "^2.47.3",
60
+ "@sveltejs/kit": "^2.48.5",
61
61
  "@sveltejs/package": "^2.5.4",
62
62
  "@sveltejs/vite-plugin-svelte": "5.1.1",
63
63
  "@sveltepress/theme-default": "^6.0.4",
64
64
  "@sveltepress/twoslash": "^1.2.2",
65
65
  "@sveltepress/vite": "^1.2.2",
66
- "@testing-library/svelte": "^5.2.8",
66
+ "@testing-library/svelte": "^5.2.9",
67
67
  "@testing-library/user-event": "^14.6.1",
68
68
  "@types/d3-array": "^3.2.2",
69
69
  "@types/d3-color": "^3.1.3",
@@ -79,24 +79,24 @@
79
79
  "@types/geojson": "^7946.0.16",
80
80
  "@types/topojson": "^3.2.6",
81
81
  "@types/topojson-client": "^3.1.5",
82
- "@typescript-eslint/eslint-plugin": "^8.46.2",
83
- "@typescript-eslint/parser": "^8.46.2",
84
- "csstype": "^3.1.3",
82
+ "@typescript-eslint/eslint-plugin": "^8.46.4",
83
+ "@typescript-eslint/parser": "^8.46.4",
84
+ "csstype": "^3.2.0",
85
85
  "d3-dsv": "^3.0.1",
86
86
  "d3-fetch": "^3.0.1",
87
87
  "d3-force": "^3.0.0",
88
- "eslint": "^9.38.0",
88
+ "eslint": "^9.39.1",
89
89
  "eslint-config-prettier": "^10.1.8",
90
- "eslint-plugin-svelte": "3.12.5",
90
+ "eslint-plugin-svelte": "3.13.0",
91
91
  "jsdom": "^26.1.0",
92
92
  "prettier": "^3.6.2",
93
93
  "prettier-plugin-svelte": "^3.4.0",
94
- "puppeteer": "^24.26.1",
94
+ "puppeteer": "^24.30.0",
95
95
  "remark-code-extra": "^1.0.1",
96
96
  "remark-code-frontmatter": "^1.0.0",
97
97
  "resize-observer-polyfill": "^1.5.1",
98
- "sass": "^1.93.2",
99
- "svelte-check": "^4.3.3",
98
+ "sass": "^1.94.0",
99
+ "svelte-check": "^4.3.4",
100
100
  "svelte-eslint-parser": "1.4.0",
101
101
  "svelte-highlight": "^7.9.0",
102
102
  "svg-path-parser": "^1.1.0",
@@ -107,7 +107,7 @@
107
107
  "typedoc-plugin-markdown": "^4.9.0",
108
108
  "typescript": "^5.9.3",
109
109
  "vite": "^6.4.1",
110
- "vitest": "^3.2.4",
110
+ "vitest": "^4.0.9",
111
111
  "vitest-matchmedia-mock": "^2.0.3",
112
112
  "yoctocolors": "^2.1.2"
113
113
  },
@@ -127,9 +127,9 @@
127
127
  "d3-shape": "^3.2.0",
128
128
  "d3-time": "^3.1.0",
129
129
  "es-toolkit": "^1.41.0",
130
- "fast-equals": "^5.3.2",
130
+ "fast-equals": "^5.3.3",
131
131
  "interval-tree-1d": "^1.0.4",
132
132
  "merge-deep": "^3.0.3",
133
- "svelte": "5.43.0"
133
+ "svelte": "5"
134
134
  }
135
135
  }