@deephaven/js-plugin-plotly-express 0.3.1 → 0.3.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.
Files changed (35) hide show
  1. package/dist/PlotlyExpressChart.d.ts +5 -0
  2. package/dist/PlotlyExpressChart.d.ts.map +1 -0
  3. package/dist/PlotlyExpressChart.js +36 -0
  4. package/dist/PlotlyExpressChart.js.map +1 -0
  5. package/dist/PlotlyExpressChartModel.d.ts +49 -13
  6. package/dist/PlotlyExpressChartModel.d.ts.map +1 -1
  7. package/dist/PlotlyExpressChartModel.js +193 -63
  8. package/dist/PlotlyExpressChartModel.js.map +1 -1
  9. package/dist/PlotlyExpressChartPanel.d.ts +2 -9
  10. package/dist/PlotlyExpressChartPanel.d.ts.map +1 -1
  11. package/dist/PlotlyExpressChartPanel.js +9 -45
  12. package/dist/PlotlyExpressChartPanel.js.map +1 -1
  13. package/dist/PlotlyExpressChartUtils.d.ts +17 -18
  14. package/dist/PlotlyExpressChartUtils.d.ts.map +1 -1
  15. package/dist/PlotlyExpressChartUtils.js +7 -10
  16. package/dist/PlotlyExpressChartUtils.js.map +1 -1
  17. package/dist/PlotlyExpressPlugin.d.ts +4 -0
  18. package/dist/PlotlyExpressPlugin.d.ts.map +1 -0
  19. package/dist/PlotlyExpressPlugin.js +14 -0
  20. package/dist/PlotlyExpressPlugin.js.map +1 -0
  21. package/dist/bundle/index.js +81785 -80929
  22. package/dist/bundle/style.css +639 -1063
  23. package/dist/index.d.ts +2 -1
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +2 -1
  26. package/dist/index.js.map +1 -1
  27. package/dist/useHandleSceneTicks.d.ts +4 -0
  28. package/dist/useHandleSceneTicks.d.ts.map +1 -0
  29. package/dist/useHandleSceneTicks.js +36 -0
  30. package/dist/useHandleSceneTicks.js.map +1 -0
  31. package/package.json +13 -11
  32. package/dist/DashboardPlugin.d.ts +0 -5
  33. package/dist/DashboardPlugin.d.ts.map +0 -1
  34. package/dist/DashboardPlugin.js +0 -39
  35. package/dist/DashboardPlugin.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- export * from './DashboardPlugin.js';
1
+ import { PlotlyExpressPlugin } from './PlotlyExpressPlugin.js';
2
2
  export * from './PlotlyExpressChartModel.js';
3
3
  export * from './PlotlyExpressChartUtils.js';
4
+ export default PlotlyExpressPlugin;
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAE7C,eAAe,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
- export * from './DashboardPlugin.js';
1
+ import { PlotlyExpressPlugin } from './PlotlyExpressPlugin.js';
2
2
  export * from './PlotlyExpressChartModel.js';
3
3
  export * from './PlotlyExpressChartUtils.js';
4
+ export default PlotlyExpressPlugin;
4
5
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAE7C,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import PlotlyExpressChartModel from './PlotlyExpressChartModel.js';
2
+ export declare function useHandleSceneTicks(model: PlotlyExpressChartModel | undefined, container: HTMLDivElement | null): void;
3
+ export default useHandleSceneTicks;
4
+ //# sourceMappingURL=useHandleSceneTicks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useHandleSceneTicks.d.ts","sourceRoot":"","sources":["../src/useHandleSceneTicks.ts"],"names":[],"mappings":"AACA,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAEnE,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,uBAAuB,GAAG,SAAS,EAC1C,SAAS,EAAE,cAAc,GAAG,IAAI,QAuCjC;AAED,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { useEffect } from 'react';
2
+ export function useHandleSceneTicks(model, container) {
3
+ useEffect(() => {
4
+ // Plotly scenes and geo views reset when our data ticks
5
+ // Pause rendering data updates when the user is manipulating a scene
6
+ if (!model || !container || !model.shouldPauseOnUserInteraction()) {
7
+ return;
8
+ }
9
+ function handleMouseDown() {
10
+ model === null || model === void 0 ? void 0 : model.pauseUpdates();
11
+ // The once option removes the listener after it is called
12
+ window.addEventListener('mouseup', handleMouseUp, { once: true });
13
+ }
14
+ function handleMouseUp() {
15
+ model === null || model === void 0 ? void 0 : model.resumeUpdates();
16
+ }
17
+ let wheelTimeout = 0;
18
+ function handleWheel() {
19
+ model === null || model === void 0 ? void 0 : model.pauseUpdates();
20
+ window.clearTimeout(wheelTimeout);
21
+ wheelTimeout = window.setTimeout(() => {
22
+ model === null || model === void 0 ? void 0 : model.resumeUpdates();
23
+ }, 300);
24
+ }
25
+ container.addEventListener('mousedown', handleMouseDown);
26
+ container.addEventListener('wheel', handleWheel);
27
+ return () => {
28
+ window.clearTimeout(wheelTimeout);
29
+ window.removeEventListener('mouseup', handleMouseUp);
30
+ container.removeEventListener('mousedown', handleMouseDown);
31
+ container.removeEventListener('wheel', handleWheel);
32
+ };
33
+ }, [model, container]);
34
+ }
35
+ export default useHandleSceneTicks;
36
+ //# sourceMappingURL=useHandleSceneTicks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useHandleSceneTicks.js","sourceRoot":"","sources":["../src/useHandleSceneTicks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlC,MAAM,UAAU,mBAAmB,CACjC,KAA0C,EAC1C,SAAgC;IAEhC,SAAS,CAAC,GAAG,EAAE;QACb,wDAAwD;QACxD,qEAAqE;QACrE,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,4BAA4B,EAAE,EAAE;YACjE,OAAO;SACR;QAED,SAAS,eAAe;YACtB,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,YAAY,EAAE,CAAC;YACtB,0DAA0D;YAC1D,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QACpE,CAAC;QAED,SAAS,aAAa;YACpB,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,aAAa,EAAE,CAAC;QACzB,CAAC;QAED,IAAI,YAAY,GAAG,CAAC,CAAC;QAErB,SAAS,WAAW;YAClB,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,YAAY,EAAE,CAAC;YACtB,MAAM,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;YAClC,YAAY,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;gBACpC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,aAAa,EAAE,CAAC;YACzB,CAAC,EAAE,GAAG,CAAC,CAAC;QACV,CAAC;QAED,SAAS,CAAC,gBAAgB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;QACzD,SAAS,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAEjD,OAAO,GAAG,EAAE;YACV,MAAM,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;YAClC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;YACrD,SAAS,CAAC,mBAAmB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;YAC5D,SAAS,CAAC,mBAAmB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QACtD,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;AACzB,CAAC;AAED,eAAe,mBAAmB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/js-plugin-plotly-express",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Deephaven plotly express plugin",
5
5
  "keywords": [
6
6
  "Deephaven",
@@ -11,7 +11,7 @@
11
11
  ],
12
12
  "author": "Deephaven Data Labs LLC",
13
13
  "license": "Apache-2.0",
14
- "main": "dist/index.js",
14
+ "main": "dist/bundle/index.js",
15
15
  "type": "module",
16
16
  "exports": {
17
17
  ".": {
@@ -35,7 +35,7 @@
35
35
  "build": "tsc && vite build"
36
36
  },
37
37
  "devDependencies": {
38
- "@deephaven/jsapi-types": "0.48.0",
38
+ "@deephaven/jsapi-types": "0.55.0",
39
39
  "@types/deep-equal": "^1.0.1",
40
40
  "@types/plotly.js": "^2.12.18",
41
41
  "@types/plotly.js-dist-min": "^2.3.1",
@@ -50,13 +50,15 @@
50
50
  "react": "^17.0.2"
51
51
  },
52
52
  "dependencies": {
53
- "@deephaven/chart": "0.48.0",
54
- "@deephaven/components": "0.48.0",
55
- "@deephaven/dashboard": "0.48.0",
56
- "@deephaven/dashboard-core-plugins": "0.48.0",
57
- "@deephaven/jsapi-bootstrap": "0.48.0",
58
- "@deephaven/log": "0.48.0",
59
- "@deephaven/utils": "0.48.0",
53
+ "@deephaven/chart": "0.55.0",
54
+ "@deephaven/components": "0.55.0",
55
+ "@deephaven/dashboard": "0.55.0",
56
+ "@deephaven/dashboard-core-plugins": "0.55.0",
57
+ "@deephaven/icons": "0.55.0",
58
+ "@deephaven/jsapi-bootstrap": "0.55.0",
59
+ "@deephaven/log": "0.55.0",
60
+ "@deephaven/plugin": "0.55.0",
61
+ "@deephaven/utils": "0.55.0",
60
62
  "deep-equal": "^2.2.1",
61
63
  "plotly.js": "^2.23.0",
62
64
  "plotly.js-dist-min": "^2.23.0",
@@ -70,5 +72,5 @@
70
72
  "files": [
71
73
  "dist"
72
74
  ],
73
- "gitHead": "ff0c9845d61816adb547885b567db9e6627642b4"
75
+ "gitHead": "05bbd5954bd728353d3c924232ebc4eb69675955"
74
76
  }
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- import { DashboardPluginComponentProps } from '@deephaven/dashboard';
3
- export declare function DashboardPlugin(props: DashboardPluginComponentProps): JSX.Element | null;
4
- export default DashboardPlugin;
5
- //# sourceMappingURL=DashboardPlugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DashboardPlugin.d.ts","sourceRoot":"","sources":["../src/DashboardPlugin.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,6BAA6B,EAI9B,MAAM,sBAAsB,CAAC;AAK9B,wBAAgB,eAAe,CAC7B,KAAK,EAAE,6BAA6B,GACnC,GAAG,CAAC,OAAO,GAAG,IAAI,CA6DpB;AAED,eAAe,eAAe,CAAC"}
@@ -1,39 +0,0 @@
1
- import { useCallback, useEffect } from 'react';
2
- import shortid from 'shortid';
3
- import { LayoutUtils, PanelEvent, useListener, } from '@deephaven/dashboard';
4
- import PlotlyExpressChartPanel from './PlotlyExpressChartPanel.js';
5
- export function DashboardPlugin(props) {
6
- const { id, layout, registerComponent } = props;
7
- const handlePanelOpen = useCallback(async ({ dragEvent, fetch, metadata = {}, panelId = shortid.generate(), widget, }) => {
8
- const { type, title } = widget;
9
- if (type !== 'deephaven.plot.express.DeephavenFigure') {
10
- return;
11
- }
12
- const config = {
13
- type: 'react-component',
14
- component: 'PlotlyPanel',
15
- props: {
16
- localDashboardId: id,
17
- id: panelId,
18
- metadata: Object.assign(Object.assign({}, metadata), { name: title, figure: title, type }),
19
- fetch,
20
- },
21
- title,
22
- id: panelId,
23
- };
24
- const { root } = layout;
25
- LayoutUtils.openComponent({ root, config, dragEvent });
26
- }, [id, layout]);
27
- useEffect(function registerComponentsAndReturnCleanup() {
28
- const cleanups = [
29
- registerComponent('PlotlyPanel', PlotlyExpressChartPanel),
30
- ];
31
- return () => {
32
- cleanups.forEach(cleanup => cleanup());
33
- };
34
- }, [registerComponent]);
35
- useListener(layout.eventHub, PanelEvent.OPEN, handlePanelOpen);
36
- return null;
37
- }
38
- export default DashboardPlugin;
39
- //# sourceMappingURL=DashboardPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DashboardPlugin.js","sourceRoot":"","sources":["../src/DashboardPlugin.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAa,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAEL,WAAW,EACX,UAAU,EACV,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAGnE,MAAM,UAAU,eAAe,CAC7B,KAAoC;IAEpC,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,iBAAiB,EAAE,GAAG,KAAK,CAAC;IAEhD,MAAM,eAAe,GAAG,WAAW,CACjC,KAAK,EAAE,EACL,SAAS,EACT,KAAK,EACL,QAAQ,GAAG,EAAE,EACb,OAAO,GAAG,OAAO,CAAC,QAAQ,EAAE,EAC5B,MAAM,GAOP,EAAE,EAAE;QACH,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;QAC/B,IAAI,IAAI,KAAK,wCAAwC,EAAE;YACrD,OAAO;SACR;QAED,MAAM,MAAM,GAAG;YACb,IAAI,EAAE,iBAA0B;YAChC,SAAS,EAAE,aAAa;YACxB,KAAK,EAAE;gBACL,gBAAgB,EAAE,EAAE;gBACpB,EAAE,EAAE,OAAO;gBACX,QAAQ,kCACH,QAAQ,KACX,IAAI,EAAE,KAAK,EACX,MAAM,EAAE,KAAK,EACb,IAAI,GACL;gBACD,KAAK;aACN;YACD,KAAK;YACL,EAAE,EAAE,OAAO;SACZ,CAAC;QAEF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;QACxB,WAAW,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IACzD,CAAC,EACD,CAAC,EAAE,EAAE,MAAM,CAAC,CACb,CAAC;IAEF,SAAS,CACP,SAAS,kCAAkC;QACzC,MAAM,QAAQ,GAAG;YACf,iBAAiB,CAAC,aAAa,EAAE,uBAAuB,CAAC;SAC1D,CAAC;QACF,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;QACzC,CAAC,CAAC;IACJ,CAAC,EACD,CAAC,iBAAiB,CAAC,CACpB,CAAC;IAEF,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IAE/D,OAAO,IAAI,CAAC;AACd,CAAC;AAED,eAAe,eAAe,CAAC"}