@vitessce/scatterplot 3.2.0 → 3.2.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.
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-68f84e2a.js";
2
- import { B as BaseDecoder } from "./index-2c270a1e.js";
2
+ import { B as BaseDecoder } from "./index-dee2d8c8.js";
3
3
  import "react";
4
4
  import "@vitessce/vit-s";
5
5
  import "react-dom";
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import React__default, { useLayoutEffect, useEffect, cloneElement, createElement, forwardRef, useState, useRef, useMemo, useImperativeHandle, Children, isValidElement, PureComponent, useId, useCallback } from "react";
2
+ import React__default, { useLayoutEffect, useEffect, cloneElement, createElement, forwardRef, useState, useRef, useMemo, useImperativeHandle, Children, isValidElement, PureComponent, useContext, useCallback } from "react";
3
3
  import { usePlotOptionsStyles, OptionsContainer, CellColorEncodingOption, OptionSelect, useVitessceContainer, useComponentHover, useComponentViewInfo } from "@vitessce/vit-s";
4
4
  import * as ReactDOM from "react-dom";
5
5
  function _mergeNamespaces(n2, m2) {
@@ -104715,16 +104715,16 @@ function addDecoder(cases, importFn) {
104715
104715
  }
104716
104716
  cases.forEach((c2) => registry$1.set(c2, importFn));
104717
104717
  }
104718
- addDecoder([void 0, 1], () => import("./raw-b9a1aa09.js").then((m2) => m2.default));
104719
- addDecoder(5, () => import("./lzw-91120d0e.js").then((m2) => m2.default));
104718
+ addDecoder([void 0, 1], () => import("./raw-509b9ed8.js").then((m2) => m2.default));
104719
+ addDecoder(5, () => import("./lzw-2e11138a.js").then((m2) => m2.default));
104720
104720
  addDecoder(6, () => {
104721
104721
  throw new Error("old style JPEG compression is not supported.");
104722
104722
  });
104723
- addDecoder(7, () => import("./jpeg-46e4967f.js").then((m2) => m2.default));
104724
- addDecoder([8, 32946], () => import("./deflate-9071f9f0.js").then((m2) => m2.default));
104725
- addDecoder(32773, () => import("./packbits-ad7c6a7a.js").then((m2) => m2.default));
104726
- addDecoder(34887, () => import("./lerc-f7e82495.js").then((m2) => m2.default));
104727
- addDecoder(50001, () => import("./webimage-0722f414.js").then((m2) => m2.default));
104723
+ addDecoder(7, () => import("./jpeg-229281af.js").then((m2) => m2.default));
104724
+ addDecoder([8, 32946], () => import("./deflate-4c27e1be.js").then((m2) => m2.default));
104725
+ addDecoder(32773, () => import("./packbits-34cdac05.js").then((m2) => m2.default));
104726
+ addDecoder(34887, () => import("./lerc-9e647d79.js").then((m2) => m2.default));
104727
+ addDecoder(50001, () => import("./webimage-5aedafc5.js").then((m2) => m2.default));
104728
104728
  function decodeRowAcc(row, stride) {
104729
104729
  let length2 = row.length - stride;
104730
104730
  let offset5 = 0;
@@ -142404,6 +142404,132 @@ const ScatterplotWrapper = forwardRef((props2, deckRef) => /* @__PURE__ */ jsxRu
142404
142404
  }
142405
142405
  ));
142406
142406
  ScatterplotWrapper.displayName = "ScatterplotWrapper";
142407
+ const $b5e257d569688ac6$var$defaultContext = {
142408
+ prefix: String(Math.round(Math.random() * 1e10)),
142409
+ current: 0
142410
+ };
142411
+ const $b5e257d569688ac6$var$SSRContext = /* @__PURE__ */ React__default.createContext($b5e257d569688ac6$var$defaultContext);
142412
+ const $b5e257d569688ac6$var$IsSSRContext = /* @__PURE__ */ React__default.createContext(false);
142413
+ let $b5e257d569688ac6$var$canUseDOM = Boolean(typeof window !== "undefined" && window.document && window.document.createElement);
142414
+ let $b5e257d569688ac6$var$componentIds = /* @__PURE__ */ new WeakMap();
142415
+ function $b5e257d569688ac6$var$useCounter(isDisabled = false) {
142416
+ let ctx = useContext($b5e257d569688ac6$var$SSRContext);
142417
+ let ref = useRef(null);
142418
+ if (ref.current === null && !isDisabled) {
142419
+ var _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner;
142420
+ let currentOwner = (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = React__default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === void 0 ? void 0 : (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner = _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner === void 0 ? void 0 : _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner.current;
142421
+ if (currentOwner) {
142422
+ let prevComponentValue = $b5e257d569688ac6$var$componentIds.get(currentOwner);
142423
+ if (prevComponentValue == null)
142424
+ $b5e257d569688ac6$var$componentIds.set(currentOwner, {
142425
+ id: ctx.current,
142426
+ state: currentOwner.memoizedState
142427
+ });
142428
+ else if (currentOwner.memoizedState !== prevComponentValue.state) {
142429
+ ctx.current = prevComponentValue.id;
142430
+ $b5e257d569688ac6$var$componentIds.delete(currentOwner);
142431
+ }
142432
+ }
142433
+ ref.current = ++ctx.current;
142434
+ }
142435
+ return ref.current;
142436
+ }
142437
+ function $b5e257d569688ac6$var$useLegacySSRSafeId(defaultId) {
142438
+ let ctx = useContext($b5e257d569688ac6$var$SSRContext);
142439
+ if (ctx === $b5e257d569688ac6$var$defaultContext && !$b5e257d569688ac6$var$canUseDOM)
142440
+ console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");
142441
+ let counter2 = $b5e257d569688ac6$var$useCounter(!!defaultId);
142442
+ let prefix2 = ctx === $b5e257d569688ac6$var$defaultContext && false ? "react-aria" : `react-aria${ctx.prefix}`;
142443
+ return defaultId || `${prefix2}-${counter2}`;
142444
+ }
142445
+ function $b5e257d569688ac6$var$useModernSSRSafeId(defaultId) {
142446
+ let id = React__default.useId();
142447
+ let [didSSR] = useState($b5e257d569688ac6$export$535bd6ca7f90a273());
142448
+ let prefix2 = didSSR || false ? "react-aria" : `react-aria${$b5e257d569688ac6$var$defaultContext.prefix}`;
142449
+ return defaultId || `${prefix2}-${id}`;
142450
+ }
142451
+ const $b5e257d569688ac6$export$619500959fc48b26 = typeof React__default["useId"] === "function" ? $b5e257d569688ac6$var$useModernSSRSafeId : $b5e257d569688ac6$var$useLegacySSRSafeId;
142452
+ function $b5e257d569688ac6$var$getSnapshot() {
142453
+ return false;
142454
+ }
142455
+ function $b5e257d569688ac6$var$getServerSnapshot() {
142456
+ return true;
142457
+ }
142458
+ function $b5e257d569688ac6$var$subscribe(onStoreChange) {
142459
+ return () => {
142460
+ };
142461
+ }
142462
+ function $b5e257d569688ac6$export$535bd6ca7f90a273() {
142463
+ if (typeof React__default["useSyncExternalStore"] === "function")
142464
+ return React__default["useSyncExternalStore"]($b5e257d569688ac6$var$subscribe, $b5e257d569688ac6$var$getSnapshot, $b5e257d569688ac6$var$getServerSnapshot);
142465
+ return useContext($b5e257d569688ac6$var$IsSSRContext);
142466
+ }
142467
+ const $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof document !== "undefined" ? React__default.useLayoutEffect : () => {
142468
+ };
142469
+ let $bdb11010cef70236$var$idsUpdaterMap = /* @__PURE__ */ new Map();
142470
+ function $bdb11010cef70236$export$f680877a34711e37(defaultId) {
142471
+ let [value, setValue] = useState(defaultId);
142472
+ let nextId = useRef(null);
142473
+ let res = $b5e257d569688ac6$export$619500959fc48b26(value);
142474
+ let updateValue = useCallback((val) => {
142475
+ nextId.current = val;
142476
+ }, []);
142477
+ $bdb11010cef70236$var$idsUpdaterMap.set(res, updateValue);
142478
+ $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
142479
+ let r2 = res;
142480
+ return () => {
142481
+ $bdb11010cef70236$var$idsUpdaterMap.delete(r2);
142482
+ };
142483
+ }, [
142484
+ res
142485
+ ]);
142486
+ useEffect(() => {
142487
+ let newId = nextId.current;
142488
+ if (newId) {
142489
+ nextId.current = null;
142490
+ setValue(newId);
142491
+ }
142492
+ });
142493
+ return res;
142494
+ }
142495
+ let $bbed8b41f857bcc0$var$transitionsByElement = /* @__PURE__ */ new Map();
142496
+ let $bbed8b41f857bcc0$var$transitionCallbacks = /* @__PURE__ */ new Set();
142497
+ function $bbed8b41f857bcc0$var$setupGlobalEvents() {
142498
+ if (typeof window === "undefined")
142499
+ return;
142500
+ let onTransitionStart = (e2) => {
142501
+ let transitions2 = $bbed8b41f857bcc0$var$transitionsByElement.get(e2.target);
142502
+ if (!transitions2) {
142503
+ transitions2 = /* @__PURE__ */ new Set();
142504
+ $bbed8b41f857bcc0$var$transitionsByElement.set(e2.target, transitions2);
142505
+ e2.target.addEventListener("transitioncancel", onTransitionEnd);
142506
+ }
142507
+ transitions2.add(e2.propertyName);
142508
+ };
142509
+ let onTransitionEnd = (e2) => {
142510
+ let properties = $bbed8b41f857bcc0$var$transitionsByElement.get(e2.target);
142511
+ if (!properties)
142512
+ return;
142513
+ properties.delete(e2.propertyName);
142514
+ if (properties.size === 0) {
142515
+ e2.target.removeEventListener("transitioncancel", onTransitionEnd);
142516
+ $bbed8b41f857bcc0$var$transitionsByElement.delete(e2.target);
142517
+ }
142518
+ if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) {
142519
+ for (let cb of $bbed8b41f857bcc0$var$transitionCallbacks)
142520
+ cb();
142521
+ $bbed8b41f857bcc0$var$transitionCallbacks.clear();
142522
+ }
142523
+ };
142524
+ document.body.addEventListener("transitionrun", onTransitionStart);
142525
+ document.body.addEventListener("transitionend", onTransitionEnd);
142526
+ }
142527
+ if (typeof document !== "undefined") {
142528
+ if (document.readyState !== "loading")
142529
+ $bbed8b41f857bcc0$var$setupGlobalEvents();
142530
+ else
142531
+ document.addEventListener("DOMContentLoaded", $bbed8b41f857bcc0$var$setupGlobalEvents);
142532
+ }
142407
142533
  function ScatterplotOptions(props2) {
142408
142534
  const {
142409
142535
  children,
@@ -142431,7 +142557,7 @@ function ScatterplotOptions(props2) {
142431
142557
  geneExpressionColormapRange,
142432
142558
  setGeneExpressionColormapRange
142433
142559
  } = props2;
142434
- const scatterplotOptionsId = useId();
142560
+ const scatterplotOptionsId = $bdb11010cef70236$export$f680877a34711e37();
142435
142561
  const observationsLabelNice = capitalize$1(observationsLabel);
142436
142562
  const classes = usePlotOptionsStyles();
142437
142563
  function handleCellRadiusModeChange(event) {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A, E, S, a, b, f, e, d, c } from "./index-2c270a1e.js";
1
+ import { A, E, S, a, b, f, e, d, c } from "./index-dee2d8c8.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-2c270a1e.js";
1
+ import { B as BaseDecoder } from "./index-dee2d8c8.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-68f84e2a.js";
2
- import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-2c270a1e.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-dee2d8c8.js";
3
3
  import "react";
4
4
  import "@vitessce/vit-s";
5
5
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-2c270a1e.js";
1
+ import { B as BaseDecoder } from "./index-dee2d8c8.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-2c270a1e.js";
1
+ import { B as BaseDecoder } from "./index-dee2d8c8.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-2c270a1e.js";
1
+ import { B as BaseDecoder } from "./index-dee2d8c8.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-2c270a1e.js";
1
+ import { B as BaseDecoder } from "./index-dee2d8c8.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1 +1 @@
1
- {"version":3,"file":"ScatterplotOptions.d.ts","sourceRoot":"","sources":["../src/ScatterplotOptions.js"],"names":[],"mappings":"AASA,oEAgUC"}
1
+ {"version":3,"file":"ScatterplotOptions.d.ts","sourceRoot":"","sources":["../src/ScatterplotOptions.js"],"names":[],"mappings":"AAUA,oEAgUC"}
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React, { useCallback, useId } from 'react';
2
+ import React, { useCallback } from 'react';
3
+ import { useId } from 'react-aria';
3
4
  import { debounce } from 'lodash-es';
4
5
  import { Checkbox, Slider, TableCell, TableRow } from '@material-ui/core';
5
6
  import { capitalize } from '@vitessce/utils';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/scatterplot",
3
- "version": "3.2.0",
3
+ "version": "3.2.1",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -22,12 +22,13 @@
22
22
  "d3-force": "^2.1.1",
23
23
  "d3-quadtree": "^1.0.7",
24
24
  "lodash-es": "^4.17.21",
25
- "@vitessce/constants-internal": "3.2.0",
26
- "@vitessce/gl": "3.2.0",
27
- "@vitessce/icons": "3.2.0",
28
- "@vitessce/tooltip": "3.2.0",
29
- "@vitessce/utils": "3.2.0",
30
- "@vitessce/vit-s": "3.2.0"
25
+ "react-aria": "^3.28.0",
26
+ "@vitessce/constants-internal": "3.2.1",
27
+ "@vitessce/gl": "3.2.1",
28
+ "@vitessce/icons": "3.2.1",
29
+ "@vitessce/tooltip": "3.2.1",
30
+ "@vitessce/utils": "3.2.1",
31
+ "@vitessce/vit-s": "3.2.1"
31
32
  },
32
33
  "devDependencies": {
33
34
  "@testing-library/jest-dom": "^5.16.4",
@@ -1,4 +1,5 @@
1
- import React, { useCallback, useId } from 'react';
1
+ import React, { useCallback } from 'react';
2
+ import { useId } from 'react-aria';
2
3
  import { debounce } from 'lodash-es';
3
4
  import { Checkbox, Slider, TableCell, TableRow } from '@material-ui/core';
4
5
  import { capitalize } from '@vitessce/utils';