@dtour/scatter 0.4.0 → 0.4.2

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.
@@ -0,0 +1,17 @@
1
+ export type ScatterBackend = 'webgpu' | 'webgl';
2
+ /**
3
+ * Detect the best available rendering backend.
4
+ *
5
+ * Returns 'webgpu' only when the environment supports everything the WebGPU
6
+ * renderer requires — a WebGPU adapter exposing the `float32-blendable`
7
+ * feature used for HDR blending (see gpu/device.ts, which throws without it).
8
+ * Otherwise returns 'webgl', the WebGL2 backend that runs on any WebGL2-capable
9
+ * browser. As of mid-2026 Firefox falls into this bucket: it either lacks
10
+ * WebGPU or ships it without `float32-blendable`, so a bare `navigator.gpu`
11
+ * check is not sufficient — we must probe the adapter feature.
12
+ *
13
+ * Never throws; any failure resolves to 'webgl'. Must run on a thread with
14
+ * access to `navigator.gpu` (main thread or worker).
15
+ */
16
+ export declare const detectBackend: () => Promise<ScatterBackend>;
17
+ //# sourceMappingURL=detect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../src/detect.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEhD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,QAAa,OAAO,CAAC,cAAc,CAU5D,CAAC"}
package/dist/index.d.ts CHANGED
@@ -2,6 +2,8 @@ export type { Colormap2DName } from './data/colormaps2d.ts';
2
2
  export { COLORMAP_2D_INDEX, COLORMAP_2D_NAMES, packColormap2DLut } from './data/colormaps2d.ts';
3
3
  export { GLASBEY_DARK, GLASBEY_LIGHT, MAGMA_25, OKABE_ITO, VIRIDIS_25 } from './data/palettes.ts';
4
4
  export type { Metadata } from './data/types.ts';
5
+ export type { ScatterBackend } from './detect.ts';
6
+ export { detectBackend } from './detect.ts';
5
7
  export type { ScatterInstance, ScatterOptions, ScatterStatus } from './gpu/client.ts';
6
8
  export { createScatter } from './gpu/client.ts';
7
9
  export { bitPackIndices } from './selection.ts';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAClG,YAAY,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAClG,YAAY,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC"}