@czi-sds/data-viz 2.4.0 → 2.4.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.
|
@@ -2065,12 +2065,14 @@ const MAIN_AXIS_OFFSET = -((_getSpaces$m = (_getSpaces = (0, _czi_sds_components
|
|
|
2065
2065
|
* only the tooltip, not the residue grid.
|
|
2066
2066
|
*/
|
|
2067
2067
|
const ResidueTooltip = (0, react.forwardRef)((_props, ref) => {
|
|
2068
|
-
var
|
|
2068
|
+
var _semanticColors$base, _semanticColors$base2;
|
|
2069
2069
|
const [{ anchorEl, label }, setState] = (0, react.useState)({
|
|
2070
2070
|
anchorEl: null,
|
|
2071
2071
|
label: ""
|
|
2072
2072
|
});
|
|
2073
|
-
const
|
|
2073
|
+
const semanticColors = (0, _czi_sds_components.getSemanticColors)({ theme: (0, _mui_material.useTheme)() });
|
|
2074
|
+
const residueTooltipBackgroundColor = semanticColors === null || semanticColors === void 0 || (_semanticColors$base = semanticColors.base) === null || _semanticColors$base === void 0 ? void 0 : _semanticColors$base.backgroundPrimary;
|
|
2075
|
+
const residueTooltipTextColor = semanticColors === null || semanticColors === void 0 || (_semanticColors$base2 = semanticColors.base) === null || _semanticColors$base2 === void 0 ? void 0 : _semanticColors$base2.textPrimary;
|
|
2074
2076
|
(0, react.useImperativeHandle)(ref, () => ({
|
|
2075
2077
|
hide: () => setState((prev) => prev.anchorEl === null ? prev : require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, prev), {}, { anchorEl: null })),
|
|
2076
2078
|
show: (nextAnchorEl, nextLabel) => setState({
|
|
@@ -2091,7 +2093,10 @@ const ResidueTooltip = (0, react.forwardRef)((_props, ref) => {
|
|
|
2091
2093
|
options: { offset: [0, MAIN_AXIS_OFFSET] }
|
|
2092
2094
|
}]
|
|
2093
2095
|
},
|
|
2094
|
-
tooltip: { style: {
|
|
2096
|
+
tooltip: { style: {
|
|
2097
|
+
backgroundColor: residueTooltipBackgroundColor,
|
|
2098
|
+
color: residueTooltipTextColor
|
|
2099
|
+
} },
|
|
2095
2100
|
arrow: { style: { color: residueTooltipBackgroundColor } }
|
|
2096
2101
|
},
|
|
2097
2102
|
title: label,
|
|
@@ -2689,6 +2694,7 @@ function useCameraReset() {
|
|
|
2689
2694
|
}
|
|
2690
2695
|
//#endregion
|
|
2691
2696
|
//#region src/core/ProteinStructureViewer/components/Viewport/style.ts
|
|
2697
|
+
const _excluded$1 = ["showAxes"];
|
|
2692
2698
|
/**
|
|
2693
2699
|
* Pinned to the lower-left of the viewport, clear of the sequence panel below
|
|
2694
2700
|
* and the axes widget in the corner.
|
|
@@ -2700,14 +2706,15 @@ function useCameraReset() {
|
|
|
2700
2706
|
*/
|
|
2701
2707
|
const ViewportButtonStack = (0, _emotion_styled.default)("div")`
|
|
2702
2708
|
position: absolute;
|
|
2703
|
-
bottom: 48px;
|
|
2704
2709
|
z-index: 10;
|
|
2705
2710
|
display: flex;
|
|
2706
2711
|
flex-direction: column;
|
|
2707
2712
|
|
|
2708
2713
|
${(props) => {
|
|
2709
|
-
const
|
|
2714
|
+
const { showAxes } = props;
|
|
2715
|
+
const spaces = (0, _czi_sds_components.getSpaces)(require_objectSpread2._objectWithoutProperties(props, _excluded$1));
|
|
2710
2716
|
return `
|
|
2717
|
+
bottom: ${showAxes ? 48 : spaces === null || spaces === void 0 ? void 0 : spaces.m}px;
|
|
2711
2718
|
left: ${spaces === null || spaces === void 0 ? void 0 : spaces.m}px;
|
|
2712
2719
|
gap: ${spaces === null || spaces === void 0 ? void 0 : spaces.xxs}px;
|
|
2713
2720
|
`;
|
|
@@ -2759,37 +2766,40 @@ function createViewportView(viewSettings) {
|
|
|
2759
2766
|
}),
|
|
2760
2767
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_styles.ThemeProvider, {
|
|
2761
2768
|
theme,
|
|
2762
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ViewportButtonStack, {
|
|
2763
|
-
|
|
2764
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2769
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ViewportButtonStack, {
|
|
2770
|
+
showAxes,
|
|
2771
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2772
|
+
hidden: !cameraChanged,
|
|
2773
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_czi_sds_components.Tooltip, {
|
|
2774
|
+
arrow: true,
|
|
2775
|
+
placement: "right",
|
|
2776
|
+
title: "Reset camera",
|
|
2777
|
+
textAlign: "left",
|
|
2778
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_czi_sds_components.Button, {
|
|
2779
|
+
"aria-label": "Reset camera",
|
|
2780
|
+
onClick: resetCamera,
|
|
2781
|
+
sdsStyle: "minimal",
|
|
2782
|
+
sdsType: "secondary",
|
|
2783
|
+
size: "medium",
|
|
2784
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_phosphor_icons_react.ArrowCounterClockwiseIcon, {})
|
|
2785
|
+
})
|
|
2786
|
+
})
|
|
2787
|
+
}), download && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_czi_sds_components.Tooltip, {
|
|
2765
2788
|
arrow: true,
|
|
2766
2789
|
placement: "right",
|
|
2767
|
-
title: "
|
|
2790
|
+
title: "Download image",
|
|
2768
2791
|
textAlign: "left",
|
|
2769
2792
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_czi_sds_components.Button, {
|
|
2770
|
-
"aria-label": "
|
|
2771
|
-
|
|
2793
|
+
"aria-label": "Download image of the structure",
|
|
2794
|
+
disabled: downloading,
|
|
2795
|
+
onClick: captureImage,
|
|
2772
2796
|
sdsStyle: "minimal",
|
|
2773
2797
|
sdsType: "secondary",
|
|
2774
2798
|
size: "medium",
|
|
2775
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_phosphor_icons_react.
|
|
2799
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_phosphor_icons_react.ApertureIcon, {})
|
|
2776
2800
|
})
|
|
2777
|
-
})
|
|
2778
|
-
})
|
|
2779
|
-
arrow: true,
|
|
2780
|
-
placement: "right",
|
|
2781
|
-
title: "Download image",
|
|
2782
|
-
textAlign: "left",
|
|
2783
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_czi_sds_components.Button, {
|
|
2784
|
-
"aria-label": "Download image of the structure",
|
|
2785
|
-
disabled: downloading,
|
|
2786
|
-
onClick: captureImage,
|
|
2787
|
-
sdsStyle: "minimal",
|
|
2788
|
-
sdsType: "secondary",
|
|
2789
|
-
size: "medium",
|
|
2790
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_phosphor_icons_react.ApertureIcon, {})
|
|
2791
|
-
})
|
|
2792
|
-
})] })
|
|
2801
|
+
})]
|
|
2802
|
+
})
|
|
2793
2803
|
})
|
|
2794
2804
|
] });
|
|
2795
2805
|
};
|
|
@@ -2064,12 +2064,14 @@ const MAIN_AXIS_OFFSET = -((_getSpaces$m = (_getSpaces = getSpaces({ theme: defa
|
|
|
2064
2064
|
* only the tooltip, not the residue grid.
|
|
2065
2065
|
*/
|
|
2066
2066
|
const ResidueTooltip = forwardRef((_props, ref) => {
|
|
2067
|
-
var
|
|
2067
|
+
var _semanticColors$base, _semanticColors$base2;
|
|
2068
2068
|
const [{ anchorEl, label }, setState] = useState({
|
|
2069
2069
|
anchorEl: null,
|
|
2070
2070
|
label: ""
|
|
2071
2071
|
});
|
|
2072
|
-
const
|
|
2072
|
+
const semanticColors = getSemanticColors({ theme: useTheme$1() });
|
|
2073
|
+
const residueTooltipBackgroundColor = semanticColors === null || semanticColors === void 0 || (_semanticColors$base = semanticColors.base) === null || _semanticColors$base === void 0 ? void 0 : _semanticColors$base.backgroundPrimary;
|
|
2074
|
+
const residueTooltipTextColor = semanticColors === null || semanticColors === void 0 || (_semanticColors$base2 = semanticColors.base) === null || _semanticColors$base2 === void 0 ? void 0 : _semanticColors$base2.textPrimary;
|
|
2073
2075
|
useImperativeHandle(ref, () => ({
|
|
2074
2076
|
hide: () => setState((prev) => prev.anchorEl === null ? prev : _objectSpread2(_objectSpread2({}, prev), {}, { anchorEl: null })),
|
|
2075
2077
|
show: (nextAnchorEl, nextLabel) => setState({
|
|
@@ -2090,7 +2092,10 @@ const ResidueTooltip = forwardRef((_props, ref) => {
|
|
|
2090
2092
|
options: { offset: [0, MAIN_AXIS_OFFSET] }
|
|
2091
2093
|
}]
|
|
2092
2094
|
},
|
|
2093
|
-
tooltip: { style: {
|
|
2095
|
+
tooltip: { style: {
|
|
2096
|
+
backgroundColor: residueTooltipBackgroundColor,
|
|
2097
|
+
color: residueTooltipTextColor
|
|
2098
|
+
} },
|
|
2094
2099
|
arrow: { style: { color: residueTooltipBackgroundColor } }
|
|
2095
2100
|
},
|
|
2096
2101
|
title: label,
|
|
@@ -2688,6 +2693,7 @@ function useCameraReset() {
|
|
|
2688
2693
|
}
|
|
2689
2694
|
//#endregion
|
|
2690
2695
|
//#region src/core/ProteinStructureViewer/components/Viewport/style.ts
|
|
2696
|
+
const _excluded$1 = ["showAxes"];
|
|
2691
2697
|
/**
|
|
2692
2698
|
* Pinned to the lower-left of the viewport, clear of the sequence panel below
|
|
2693
2699
|
* and the axes widget in the corner.
|
|
@@ -2699,14 +2705,15 @@ function useCameraReset() {
|
|
|
2699
2705
|
*/
|
|
2700
2706
|
const ViewportButtonStack = styled("div")`
|
|
2701
2707
|
position: absolute;
|
|
2702
|
-
bottom: 48px;
|
|
2703
2708
|
z-index: 10;
|
|
2704
2709
|
display: flex;
|
|
2705
2710
|
flex-direction: column;
|
|
2706
2711
|
|
|
2707
2712
|
${(props) => {
|
|
2708
|
-
const
|
|
2713
|
+
const { showAxes } = props;
|
|
2714
|
+
const spaces = getSpaces(_objectWithoutProperties(props, _excluded$1));
|
|
2709
2715
|
return `
|
|
2716
|
+
bottom: ${showAxes ? 48 : spaces === null || spaces === void 0 ? void 0 : spaces.m}px;
|
|
2710
2717
|
left: ${spaces === null || spaces === void 0 ? void 0 : spaces.m}px;
|
|
2711
2718
|
gap: ${spaces === null || spaces === void 0 ? void 0 : spaces.xxs}px;
|
|
2712
2719
|
`;
|
|
@@ -2758,37 +2765,40 @@ function createViewportView(viewSettings) {
|
|
|
2758
2765
|
}),
|
|
2759
2766
|
/* @__PURE__ */ jsx(ThemeProvider, {
|
|
2760
2767
|
theme,
|
|
2761
|
-
children: /* @__PURE__ */ jsxs(ViewportButtonStack, {
|
|
2762
|
-
|
|
2763
|
-
children: /* @__PURE__ */ jsx(
|
|
2768
|
+
children: /* @__PURE__ */ jsxs(ViewportButtonStack, {
|
|
2769
|
+
showAxes,
|
|
2770
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
2771
|
+
hidden: !cameraChanged,
|
|
2772
|
+
children: /* @__PURE__ */ jsx(Tooltip, {
|
|
2773
|
+
arrow: true,
|
|
2774
|
+
placement: "right",
|
|
2775
|
+
title: "Reset camera",
|
|
2776
|
+
textAlign: "left",
|
|
2777
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
2778
|
+
"aria-label": "Reset camera",
|
|
2779
|
+
onClick: resetCamera,
|
|
2780
|
+
sdsStyle: "minimal",
|
|
2781
|
+
sdsType: "secondary",
|
|
2782
|
+
size: "medium",
|
|
2783
|
+
children: /* @__PURE__ */ jsx(ArrowCounterClockwiseIcon, {})
|
|
2784
|
+
})
|
|
2785
|
+
})
|
|
2786
|
+
}), download && /* @__PURE__ */ jsx(Tooltip, {
|
|
2764
2787
|
arrow: true,
|
|
2765
2788
|
placement: "right",
|
|
2766
|
-
title: "
|
|
2789
|
+
title: "Download image",
|
|
2767
2790
|
textAlign: "left",
|
|
2768
2791
|
children: /* @__PURE__ */ jsx(Button, {
|
|
2769
|
-
"aria-label": "
|
|
2770
|
-
|
|
2792
|
+
"aria-label": "Download image of the structure",
|
|
2793
|
+
disabled: downloading,
|
|
2794
|
+
onClick: captureImage,
|
|
2771
2795
|
sdsStyle: "minimal",
|
|
2772
2796
|
sdsType: "secondary",
|
|
2773
2797
|
size: "medium",
|
|
2774
|
-
children: /* @__PURE__ */ jsx(
|
|
2798
|
+
children: /* @__PURE__ */ jsx(ApertureIcon, {})
|
|
2775
2799
|
})
|
|
2776
|
-
})
|
|
2777
|
-
})
|
|
2778
|
-
arrow: true,
|
|
2779
|
-
placement: "right",
|
|
2780
|
-
title: "Download image",
|
|
2781
|
-
textAlign: "left",
|
|
2782
|
-
children: /* @__PURE__ */ jsx(Button, {
|
|
2783
|
-
"aria-label": "Download image of the structure",
|
|
2784
|
-
disabled: downloading,
|
|
2785
|
-
onClick: captureImage,
|
|
2786
|
-
sdsStyle: "minimal",
|
|
2787
|
-
sdsType: "secondary",
|
|
2788
|
-
size: "medium",
|
|
2789
|
-
children: /* @__PURE__ */ jsx(ApertureIcon, {})
|
|
2790
|
-
})
|
|
2791
|
-
})] })
|
|
2800
|
+
})]
|
|
2801
|
+
})
|
|
2792
2802
|
})
|
|
2793
2803
|
] });
|
|
2794
2804
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@czi-sds/data-viz",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"main": "dist/index.cjs.js",
|
|
5
5
|
"types": "dist/index.cjs.d.ts",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"./dist/*": "./dist/*",
|
|
59
59
|
"./package.json": "./package.json"
|
|
60
60
|
},
|
|
61
|
+
"sideEffects": false,
|
|
61
62
|
"author": "",
|
|
62
63
|
"homepage": "https://github.com/chanzuckerberg/sci-components/tree/main/packages/sci-data-viz#readme",
|
|
63
64
|
"description": "2023 Science Initiative Data Visualization Component Library",
|
|
@@ -146,5 +147,5 @@
|
|
|
146
147
|
"echarts": "^6.0.0",
|
|
147
148
|
"lodash": "^4.17.21"
|
|
148
149
|
},
|
|
149
|
-
"gitHead": "
|
|
150
|
+
"gitHead": "a4587a068a8e457bb068a1b170951c8f4f396bd5"
|
|
150
151
|
}
|