@dtour/scatter 0.1.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.
Files changed (50) hide show
  1. package/dist/data/analyze.d.ts +7 -0
  2. package/dist/data/analyze.d.ts.map +1 -0
  3. package/dist/data/arrow.d.ts +11 -0
  4. package/dist/data/arrow.d.ts.map +1 -0
  5. package/dist/data/detect.d.ts +3 -0
  6. package/dist/data/detect.d.ts.map +1 -0
  7. package/dist/data/messages.d.ts +67 -0
  8. package/dist/data/messages.d.ts.map +1 -0
  9. package/dist/data/palettes.d.ts +11 -0
  10. package/dist/data/palettes.d.ts.map +1 -0
  11. package/dist/data/parquet.d.ts +11 -0
  12. package/dist/data/parquet.d.ts.map +1 -0
  13. package/dist/data/parse.d.ts +7 -0
  14. package/dist/data/parse.d.ts.map +1 -0
  15. package/dist/data/types.d.ts +28 -0
  16. package/dist/data/types.d.ts.map +1 -0
  17. package/dist/data/worker.d.ts +2 -0
  18. package/dist/data/worker.d.ts.map +1 -0
  19. package/dist/gpu/client.d.ts +104 -0
  20. package/dist/gpu/client.d.ts.map +1 -0
  21. package/dist/gpu/color-pipeline.d.ts +20 -0
  22. package/dist/gpu/color-pipeline.d.ts.map +1 -0
  23. package/dist/gpu/device.d.ts +10 -0
  24. package/dist/gpu/device.d.ts.map +1 -0
  25. package/dist/gpu/messages.d.ts +65 -0
  26. package/dist/gpu/messages.d.ts.map +1 -0
  27. package/dist/gpu/pipeline.d.ts +57 -0
  28. package/dist/gpu/pipeline.d.ts.map +1 -0
  29. package/dist/gpu/projection.d.ts +20 -0
  30. package/dist/gpu/projection.d.ts.map +1 -0
  31. package/dist/gpu/worker.d.ts +2 -0
  32. package/dist/gpu/worker.d.ts.map +1 -0
  33. package/dist/index.d.ts +7 -0
  34. package/dist/index.d.ts.map +1 -0
  35. package/dist/pca/jacobi.d.ts +16 -0
  36. package/dist/pca/jacobi.d.ts.map +1 -0
  37. package/dist/pca/pipeline.d.ts +13 -0
  38. package/dist/pca/pipeline.d.ts.map +1 -0
  39. package/dist/renderer.d.ts +20 -0
  40. package/dist/renderer.d.ts.map +1 -0
  41. package/dist/scatter.js +2177 -0
  42. package/dist/selection.d.ts +10 -0
  43. package/dist/selection.d.ts.map +1 -0
  44. package/dist/tour/arc-length.d.ts +32 -0
  45. package/dist/tour/arc-length.d.ts.map +1 -0
  46. package/dist/tour/geodesic.d.ts +27 -0
  47. package/dist/tour/geodesic.d.ts.map +1 -0
  48. package/dist/tour/svd2x2.d.ts +13 -0
  49. package/dist/tour/svd2x2.d.ts.map +1 -0
  50. package/package.json +28 -0
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Bit-pack an array of selected point indices into a Uint32Array mask.
3
+ * Each bit represents one point; bit i is set if index i appears in the input.
4
+ *
5
+ * @param indices - selected point indices (array, Int32Array, etc.)
6
+ * @param numPoints - total number of points in the dataset
7
+ * @returns Uint32Array of length ceil(numPoints / 32)
8
+ */
9
+ export declare const bitPackIndices: (indices: ArrayLike<number>, numPoints: number) => Uint32Array;
10
+ //# sourceMappingURL=selection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../src/selection.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GACzB,SAAS,SAAS,CAAC,MAAM,CAAC,EAC1B,WAAW,MAAM,KAChB,WAUF,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Compute cumulative arc-length table for a cyclic sequence of basis matrices.
3
+ * The last basis connects back to the first (closed loop).
4
+ *
5
+ * Because interpolation follows a Catmull-Rom spline (not a geodesic),
6
+ * we sample multiple points along each cubic segment and sum the
7
+ * geodesic distances between consecutive samples.
8
+ *
9
+ * Returns a Float32Array of length bases.length + 1:
10
+ * [0, d01, d01+d12, ..., total]
11
+ * Normalized to [0, 1] so the slider maps directly.
12
+ *
13
+ * @param bases - array of p×2 column-major basis matrices
14
+ * @param p - number of dimensions
15
+ */
16
+ export declare const computeArcLengths: (bases: Float32Array[], p: number) => Float32Array;
17
+ export type ResolvedPosition = {
18
+ segment: number;
19
+ localT: number;
20
+ };
21
+ /**
22
+ * Given a normalized position t in [0, 1] along the total arc,
23
+ * find which segment it falls in and the local interpolation parameter.
24
+ *
25
+ * Uses binary search for O(log n) lookup.
26
+ */
27
+ export declare const resolvePosition: (arcLengths: Float32Array, t: number) => ResolvedPosition;
28
+ /**
29
+ * Convenience: resolve position and compute the interpolated basis in one call.
30
+ */
31
+ export declare const interpolateAtPosition: (out: Float32Array, bases: Float32Array[], arcLengths: Float32Array, p: number, t: number) => Float32Array;
32
+ //# sourceMappingURL=arc-length.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arc-length.d.ts","sourceRoot":"","sources":["../../src/tour/arc-length.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,YAAY,EAAE,EAAE,GAAG,MAAM,KAAG,YAuCpE,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,YAAY,YAAY,EAAE,GAAG,MAAM,KAAG,gBAsBrE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAChC,KAAK,YAAY,EACjB,OAAO,YAAY,EAAE,EACrB,YAAY,YAAY,EACxB,GAAG,MAAM,EACT,GAAG,MAAM,KACR,YAQF,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Interpolate through four p×2 basis matrices using Catmull-Rom spline
3
+ * + Gram-Schmidt orthonormalization.
4
+ *
5
+ * CR(t) = 0.5 * ((2*P1) + (-P0+P2)*t + (2*P0-5*P1+4*P2-P3)*t² + (-P0+3*P1-3*P2+P3)*t³)
6
+ *
7
+ * The spline passes exactly through P1 (at t=0) and P2 (at t=1), with
8
+ * C1-continuous tangents derived from neighbors P0 and P3. After the
9
+ * cubic blend, Gram-Schmidt restores orthonormality.
10
+ *
11
+ * All basis matrices are column-major: [x0, x1, ..., xp-1, y0, y1, ..., yp-1]
12
+ *
13
+ * @param out - pre-allocated output (2p floats, column-major)
14
+ * @param P0 - previous basis (neighbor before start)
15
+ * @param P1 - start basis
16
+ * @param P2 - end basis
17
+ * @param P3 - next basis (neighbor after end)
18
+ * @param p - number of dimensions
19
+ * @param t - interpolation parameter [0, 1]
20
+ */
21
+ export declare const interpolateBases: (out: Float32Array, P0: Float32Array, P1: Float32Array, P2: Float32Array, P3: Float32Array, p: number, t: number) => Float32Array;
22
+ /**
23
+ * Geodesic distance between two p×2 basis matrices.
24
+ * Distance = sqrt(tau_0^2 + tau_1^2) where tau_i are principal angles.
25
+ */
26
+ export declare const geodesicDistance: (Fa: Float32Array, Fz: Float32Array, p: number) => number;
27
+ //# sourceMappingURL=geodesic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geodesic.d.ts","sourceRoot":"","sources":["../../src/tour/geodesic.ts"],"names":[],"mappings":"AAyCA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,gBAAgB,GAC3B,KAAK,YAAY,EACjB,IAAI,YAAY,EAChB,IAAI,YAAY,EAChB,IAAI,YAAY,EAChB,IAAI,YAAY,EAChB,GAAG,MAAM,EACT,GAAG,MAAM,KACR,YAkBF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,IAAI,YAAY,EAAE,IAAI,YAAY,EAAE,GAAG,MAAM,KAAG,MAkBhF,CAAC"}
@@ -0,0 +1,13 @@
1
+ export type SVD2x2Result = {
2
+ U: Float32Array;
3
+ S: Float32Array;
4
+ V: Float32Array;
5
+ };
6
+ /**
7
+ * Analytical SVD of a 2x2 matrix.
8
+ *
9
+ * Input A is row-major: A = [[A[0], A[1]], [A[2], A[3]]].
10
+ * Returns U, S, V such that A ≈ U * diag(S) * V^T.
11
+ */
12
+ export declare const svd2x2: (A: Float32Array) => SVD2x2Result;
13
+ //# sourceMappingURL=svd2x2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svd2x2.d.ts","sourceRoot":"","sources":["../../src/tour/svd2x2.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,CAAC,EAAE,YAAY,CAAC;IAChB,CAAC,EAAE,YAAY,CAAC;IAChB,CAAC,EAAE,YAAY,CAAC;CACjB,CAAC;AAIF;;;;;GAKG;AACH,eAAO,MAAM,MAAM,GAAI,GAAG,YAAY,KAAG,YAyExC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@dtour/scatter",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "main": "./dist/scatter.js",
6
+ "module": "./dist/scatter.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/scatter.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "files": ["dist"],
15
+ "scripts": {
16
+ "build": "vite build && tsc --emitDeclarationOnly --declaration --outDir dist",
17
+ "dev": "vite build --watch"
18
+ },
19
+ "dependencies": {
20
+ "@uwdata/flechette": "catalog:",
21
+ "hyparquet": "^1.25.0",
22
+ "hyparquet-compressors": "^1.1.1"
23
+ },
24
+ "devDependencies": {
25
+ "@webgpu/types": "^0.1.54",
26
+ "vite": "catalog:"
27
+ }
28
+ }