@czi-sds/data-viz 2.5.0 → 2.5.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.
|
@@ -292,17 +292,35 @@ const MIN_WIDTH = 200;
|
|
|
292
292
|
*/
|
|
293
293
|
const VIEWER_CONTAINER_NAME = "sds-structure-viewer";
|
|
294
294
|
/**
|
|
295
|
-
* Height reserved for the sequence panel along the bottom
|
|
296
|
-
* width above which it grows. Measured against the
|
|
297
|
-
* the page, so a viewer embedded in a wider page
|
|
295
|
+
* Height reserved for the sequence panel along the bottom when the consumer
|
|
296
|
+
* sets none, and the viewer width above which it grows. Measured against the
|
|
297
|
+
* container above rather than the page, so a viewer embedded in a wider page
|
|
298
|
+
* sizes to the room it has.
|
|
298
299
|
*
|
|
299
|
-
* The legend sits directly on top of the panel and offsets itself by
|
|
300
|
-
* same
|
|
301
|
-
* Copies that drifted would leave the legend floating off the
|
|
300
|
+
* The legend sits directly on top of the panel and offsets itself by the same
|
|
301
|
+
* heights at the same breakpoint, so it reads them from here rather than
|
|
302
|
+
* restating them. Copies that drifted would leave the legend floating off the
|
|
303
|
+
* panel.
|
|
302
304
|
*/
|
|
303
305
|
const SEQUENCE_HEIGHT = "max(104px, 30%)";
|
|
304
306
|
const SEQUENCE_HEIGHT_WIDE = "max(134px, 32%)";
|
|
305
307
|
/**
|
|
308
|
+
* The sequence panel's height below `WIDE_VIEWER` and at or above it. A height
|
|
309
|
+
* the consumer sets holds at every width, a number is read as pixels, and an
|
|
310
|
+
* empty string leaves the defaults in place, as it would in a React style.
|
|
311
|
+
*/
|
|
312
|
+
function sequenceHeights(height) {
|
|
313
|
+
if (height === void 0 || height === "") return {
|
|
314
|
+
base: SEQUENCE_HEIGHT,
|
|
315
|
+
wide: SEQUENCE_HEIGHT_WIDE
|
|
316
|
+
};
|
|
317
|
+
const css = typeof height === "number" ? `${height}px` : height;
|
|
318
|
+
return {
|
|
319
|
+
base: css,
|
|
320
|
+
wide: css
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
306
324
|
* The element Mol* mounts into.
|
|
307
325
|
*
|
|
308
326
|
* This has to be its own node rather than the root: Mol* takes ownership of its
|
|
@@ -379,17 +397,20 @@ const ViewerRoot = (0, _emotion_styled.default)("div")`
|
|
|
379
397
|
/*
|
|
380
398
|
* Mol* puts the sequence panel in its "top" region; move it to the bottom and
|
|
381
399
|
* shrink the main viewport region to match, so the structure sits above the
|
|
382
|
-
* sequence rather than behind it. The panel grows on wider viewers
|
|
383
|
-
* viewport region's offset follows it.
|
|
400
|
+
* sequence rather than behind it. The panel grows on wider viewers unless the
|
|
401
|
+
* consumer has set its height, and the viewport region's offset follows it.
|
|
384
402
|
*/
|
|
385
403
|
${(props) => {
|
|
386
|
-
const { showSequenceViewer } = props;
|
|
404
|
+
const { sequenceViewerHeight, showSequenceViewer } = props;
|
|
405
|
+
const height = sequenceHeights(sequenceViewerHeight);
|
|
406
|
+
const mainBottom = showSequenceViewer ? height.base : "0";
|
|
407
|
+
const mainBottomWide = showSequenceViewer ? height.wide : "0";
|
|
387
408
|
return `
|
|
388
409
|
.msp-plugin .msp-layout-region.msp-layout-top {
|
|
389
410
|
display: ${showSequenceViewer ? "block" : "none"} !important;
|
|
390
411
|
position: absolute !important;
|
|
391
412
|
inset: auto 0 0 0 !important;
|
|
392
|
-
height: ${
|
|
413
|
+
height: ${height.base} !important;
|
|
393
414
|
}
|
|
394
415
|
|
|
395
416
|
.msp-plugin .msp-layout-region.msp-layout-main {
|
|
@@ -397,16 +418,16 @@ const ViewerRoot = (0, _emotion_styled.default)("div")`
|
|
|
397
418
|
top: 0 !important;
|
|
398
419
|
left: 0 !important;
|
|
399
420
|
right: 0 !important;
|
|
400
|
-
bottom: ${
|
|
421
|
+
bottom: ${mainBottom} !important;
|
|
401
422
|
}
|
|
402
423
|
|
|
403
424
|
@container ${VIEWER_CONTAINER_NAME} (min-width: 880px) {
|
|
404
425
|
.msp-plugin .msp-layout-region.msp-layout-top {
|
|
405
|
-
height: ${
|
|
426
|
+
height: ${height.wide} !important;
|
|
406
427
|
}
|
|
407
428
|
|
|
408
429
|
.msp-plugin .msp-layout-region.msp-layout-main {
|
|
409
|
-
bottom: ${
|
|
430
|
+
bottom: ${mainBottomWide} !important;
|
|
410
431
|
}
|
|
411
432
|
}
|
|
412
433
|
`;
|
|
@@ -448,12 +469,13 @@ const LegendOverlay = (0, _emotion_styled.default)("div")`
|
|
|
448
469
|
|
|
449
470
|
${(props) => {
|
|
450
471
|
const spaces = (0, _czi_sds_components.getSpaces)(props);
|
|
451
|
-
const { showSequenceViewer } = props;
|
|
472
|
+
const { sequenceViewerHeight, showSequenceViewer } = props;
|
|
473
|
+
const height = sequenceHeights(sequenceViewerHeight);
|
|
452
474
|
return `
|
|
453
475
|
right: ${spaces === null || spaces === void 0 ? void 0 : spaces.m}px;
|
|
454
476
|
gap: ${spaces === null || spaces === void 0 ? void 0 : spaces.xs}px;
|
|
455
477
|
padding-bottom: ${spaces === null || spaces === void 0 ? void 0 : spaces.m}px;
|
|
456
|
-
bottom: ${showSequenceViewer ?
|
|
478
|
+
bottom: ${showSequenceViewer ? height.base : "0"};
|
|
457
479
|
|
|
458
480
|
/*
|
|
459
481
|
* Track the sequence panel as it grows on wider viewers. The panel is
|
|
@@ -461,7 +483,7 @@ const LegendOverlay = (0, _emotion_styled.default)("div")`
|
|
|
461
483
|
* would part the legend from it on a viewer narrower than its page.
|
|
462
484
|
*/
|
|
463
485
|
@container ${VIEWER_CONTAINER_NAME} (min-width: 880px) {
|
|
464
|
-
bottom: ${showSequenceViewer ?
|
|
486
|
+
bottom: ${showSequenceViewer ? height.wide : "0"};
|
|
465
487
|
}
|
|
466
488
|
|
|
467
489
|
/* Spacer balancing the axes widget pinned in the opposite corner. */
|
|
@@ -637,7 +659,7 @@ function readoutSlot(label, value, residueCount) {
|
|
|
637
659
|
* residue takes priority so the user can inspect others without losing their
|
|
638
660
|
* selection.
|
|
639
661
|
*/
|
|
640
|
-
function StructureLegend({ chainBandColors, chainColors, chains = [], hiddenChains, hoveredResidue = null, onChainHover, onChainSelect, onChainToggle, scale, scaleLabel, scaleMax = null, scaleMin = 0, scaleTooltip, scaleTooltipProps, selectedChains, selectedResidue = null, showSequenceViewer, stats, valueLabel }) {
|
|
662
|
+
function StructureLegend({ chainBandColors, chainColors, chains = [], hiddenChains, hoveredResidue = null, onChainHover, onChainSelect, onChainToggle, scale, scaleLabel, scaleMax = null, scaleMin = 0, scaleTooltip, scaleTooltipProps, selectedChains, selectedResidue = null, sequenceViewerHeight, showSequenceViewer, stats, valueLabel }) {
|
|
641
663
|
var _activeResidue$residu, _stats$, _stats$2, _stats$3;
|
|
642
664
|
const activeResidue = hoveredResidue !== null && hoveredResidue !== void 0 ? hoveredResidue : selectedResidue;
|
|
643
665
|
const showResidue = activeResidue !== null;
|
|
@@ -652,6 +674,7 @@ function StructureLegend({ chainBandColors, chainColors, chains = [], hiddenChai
|
|
|
652
674
|
showResidue ? readoutSlot("pLDDT", activeResidue.plddt, residueCount) : (_stats$3 = stats[2]) !== null && _stats$3 !== void 0 ? _stats$3 : null
|
|
653
675
|
];
|
|
654
676
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(LegendOverlay, {
|
|
677
|
+
sequenceViewerHeight,
|
|
655
678
|
showSequenceViewer,
|
|
656
679
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatsGrid, { children: Array.from({ length: SLOT_COUNT }, (_, i) => {
|
|
657
680
|
var _slots$i;
|
|
@@ -3638,6 +3661,7 @@ const _excluded = [
|
|
|
3638
3661
|
"sceneMode",
|
|
3639
3662
|
"selection",
|
|
3640
3663
|
"sequenceViewerBackgroundColor",
|
|
3664
|
+
"sequenceViewerHeight",
|
|
3641
3665
|
"showAxes",
|
|
3642
3666
|
"showChainLegend",
|
|
3643
3667
|
"showLegend",
|
|
@@ -3711,7 +3735,7 @@ function resolveScaleProps(colorBy, overlay) {
|
|
|
3711
3735
|
*/
|
|
3712
3736
|
const ProteinStructureViewer = (0, react.forwardRef)((props, ref) => {
|
|
3713
3737
|
var _selection$chains;
|
|
3714
|
-
const { backgroundColor, chainColors: chainColorOverrides, colorBy: colorByProp, disableChainHighlightOnHover = false, download, hiddenChains: hiddenChainsProp, highlights, initialCamera, onCameraChange, onChainVisibilityChange, onChainsChange, molstarSpec, onDispose, onError, onReady, onResidueClick, onResidueHover, onSelectionChange, onStructureLoad, orientation, projection, representation = "cartoon", structure, plddt, residueOverlay, sceneMode = "managed", selection: selectionProp, sequenceViewerBackgroundColor, showAxes = true, showChainLegend = true, showLegend = true, showSequenceViewer = true, stats } = props, rest = require_objectSpread2._objectWithoutProperties(props, _excluded);
|
|
3738
|
+
const { backgroundColor, chainColors: chainColorOverrides, colorBy: colorByProp, disableChainHighlightOnHover = false, download, hiddenChains: hiddenChainsProp, highlights, initialCamera, onCameraChange, onChainVisibilityChange, onChainsChange, molstarSpec, onDispose, onError, onReady, onResidueClick, onResidueHover, onSelectionChange, onStructureLoad, orientation, projection, representation = "cartoon", structure, plddt, residueOverlay, sceneMode = "managed", selection: selectionProp, sequenceViewerBackgroundColor, sequenceViewerHeight, showAxes = true, showChainLegend = true, showLegend = true, showSequenceViewer = true, stats } = props, rest = require_objectSpread2._objectWithoutProperties(props, _excluded);
|
|
3715
3739
|
const theme = (0, _mui_material_styles.useTheme)();
|
|
3716
3740
|
const mode = (0, _czi_sds_components.getMode)({ theme });
|
|
3717
3741
|
const semanticColors = (0, _czi_sds_components.getSemanticColors)({ theme });
|
|
@@ -3892,6 +3916,7 @@ const ProteinStructureViewer = (0, react.forwardRef)((props, ref) => {
|
|
|
3892
3916
|
const plddtColoringActive = colorBy === "plddt";
|
|
3893
3917
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ViewerRoot, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({
|
|
3894
3918
|
ref,
|
|
3919
|
+
sequenceViewerHeight,
|
|
3895
3920
|
showSequenceViewer
|
|
3896
3921
|
}, rest), {}, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PluginMount, { ref: pluginMountRef }), showLegend && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StructureLegend, require_objectSpread2._objectSpread2({
|
|
3897
3922
|
chainBandColors: plddtColoringActive ? require_renderStructureImage.PLDDT_BAND_COLORS : void 0,
|
|
@@ -3904,6 +3929,7 @@ const ProteinStructureViewer = (0, react.forwardRef)((props, ref) => {
|
|
|
3904
3929
|
onChainToggle: toggleChain,
|
|
3905
3930
|
selectedChains,
|
|
3906
3931
|
selectedResidue: selectedReadout,
|
|
3932
|
+
sequenceViewerHeight,
|
|
3907
3933
|
showSequenceViewer,
|
|
3908
3934
|
stats: stats !== null && stats !== void 0 ? stats : []
|
|
3909
3935
|
}, scaleProps))] }));
|
|
@@ -290,17 +290,35 @@ const MIN_WIDTH = 200;
|
|
|
290
290
|
*/
|
|
291
291
|
const VIEWER_CONTAINER_NAME = "sds-structure-viewer";
|
|
292
292
|
/**
|
|
293
|
-
* Height reserved for the sequence panel along the bottom
|
|
294
|
-
* width above which it grows. Measured against the
|
|
295
|
-
* the page, so a viewer embedded in a wider page
|
|
293
|
+
* Height reserved for the sequence panel along the bottom when the consumer
|
|
294
|
+
* sets none, and the viewer width above which it grows. Measured against the
|
|
295
|
+
* container above rather than the page, so a viewer embedded in a wider page
|
|
296
|
+
* sizes to the room it has.
|
|
296
297
|
*
|
|
297
|
-
* The legend sits directly on top of the panel and offsets itself by
|
|
298
|
-
* same
|
|
299
|
-
* Copies that drifted would leave the legend floating off the
|
|
298
|
+
* The legend sits directly on top of the panel and offsets itself by the same
|
|
299
|
+
* heights at the same breakpoint, so it reads them from here rather than
|
|
300
|
+
* restating them. Copies that drifted would leave the legend floating off the
|
|
301
|
+
* panel.
|
|
300
302
|
*/
|
|
301
303
|
const SEQUENCE_HEIGHT = "max(104px, 30%)";
|
|
302
304
|
const SEQUENCE_HEIGHT_WIDE = "max(134px, 32%)";
|
|
303
305
|
/**
|
|
306
|
+
* The sequence panel's height below `WIDE_VIEWER` and at or above it. A height
|
|
307
|
+
* the consumer sets holds at every width, a number is read as pixels, and an
|
|
308
|
+
* empty string leaves the defaults in place, as it would in a React style.
|
|
309
|
+
*/
|
|
310
|
+
function sequenceHeights(height) {
|
|
311
|
+
if (height === void 0 || height === "") return {
|
|
312
|
+
base: SEQUENCE_HEIGHT,
|
|
313
|
+
wide: SEQUENCE_HEIGHT_WIDE
|
|
314
|
+
};
|
|
315
|
+
const css = typeof height === "number" ? `${height}px` : height;
|
|
316
|
+
return {
|
|
317
|
+
base: css,
|
|
318
|
+
wide: css
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
304
322
|
* The element Mol* mounts into.
|
|
305
323
|
*
|
|
306
324
|
* This has to be its own node rather than the root: Mol* takes ownership of its
|
|
@@ -377,17 +395,20 @@ const ViewerRoot = styled("div")`
|
|
|
377
395
|
/*
|
|
378
396
|
* Mol* puts the sequence panel in its "top" region; move it to the bottom and
|
|
379
397
|
* shrink the main viewport region to match, so the structure sits above the
|
|
380
|
-
* sequence rather than behind it. The panel grows on wider viewers
|
|
381
|
-
* viewport region's offset follows it.
|
|
398
|
+
* sequence rather than behind it. The panel grows on wider viewers unless the
|
|
399
|
+
* consumer has set its height, and the viewport region's offset follows it.
|
|
382
400
|
*/
|
|
383
401
|
${(props) => {
|
|
384
|
-
const { showSequenceViewer } = props;
|
|
402
|
+
const { sequenceViewerHeight, showSequenceViewer } = props;
|
|
403
|
+
const height = sequenceHeights(sequenceViewerHeight);
|
|
404
|
+
const mainBottom = showSequenceViewer ? height.base : "0";
|
|
405
|
+
const mainBottomWide = showSequenceViewer ? height.wide : "0";
|
|
385
406
|
return `
|
|
386
407
|
.msp-plugin .msp-layout-region.msp-layout-top {
|
|
387
408
|
display: ${showSequenceViewer ? "block" : "none"} !important;
|
|
388
409
|
position: absolute !important;
|
|
389
410
|
inset: auto 0 0 0 !important;
|
|
390
|
-
height: ${
|
|
411
|
+
height: ${height.base} !important;
|
|
391
412
|
}
|
|
392
413
|
|
|
393
414
|
.msp-plugin .msp-layout-region.msp-layout-main {
|
|
@@ -395,16 +416,16 @@ const ViewerRoot = styled("div")`
|
|
|
395
416
|
top: 0 !important;
|
|
396
417
|
left: 0 !important;
|
|
397
418
|
right: 0 !important;
|
|
398
|
-
bottom: ${
|
|
419
|
+
bottom: ${mainBottom} !important;
|
|
399
420
|
}
|
|
400
421
|
|
|
401
422
|
@container ${VIEWER_CONTAINER_NAME} (min-width: 880px) {
|
|
402
423
|
.msp-plugin .msp-layout-region.msp-layout-top {
|
|
403
|
-
height: ${
|
|
424
|
+
height: ${height.wide} !important;
|
|
404
425
|
}
|
|
405
426
|
|
|
406
427
|
.msp-plugin .msp-layout-region.msp-layout-main {
|
|
407
|
-
bottom: ${
|
|
428
|
+
bottom: ${mainBottomWide} !important;
|
|
408
429
|
}
|
|
409
430
|
}
|
|
410
431
|
`;
|
|
@@ -446,12 +467,13 @@ const LegendOverlay = styled("div")`
|
|
|
446
467
|
|
|
447
468
|
${(props) => {
|
|
448
469
|
const spaces = getSpaces(props);
|
|
449
|
-
const { showSequenceViewer } = props;
|
|
470
|
+
const { sequenceViewerHeight, showSequenceViewer } = props;
|
|
471
|
+
const height = sequenceHeights(sequenceViewerHeight);
|
|
450
472
|
return `
|
|
451
473
|
right: ${spaces === null || spaces === void 0 ? void 0 : spaces.m}px;
|
|
452
474
|
gap: ${spaces === null || spaces === void 0 ? void 0 : spaces.xs}px;
|
|
453
475
|
padding-bottom: ${spaces === null || spaces === void 0 ? void 0 : spaces.m}px;
|
|
454
|
-
bottom: ${showSequenceViewer ?
|
|
476
|
+
bottom: ${showSequenceViewer ? height.base : "0"};
|
|
455
477
|
|
|
456
478
|
/*
|
|
457
479
|
* Track the sequence panel as it grows on wider viewers. The panel is
|
|
@@ -459,7 +481,7 @@ const LegendOverlay = styled("div")`
|
|
|
459
481
|
* would part the legend from it on a viewer narrower than its page.
|
|
460
482
|
*/
|
|
461
483
|
@container ${VIEWER_CONTAINER_NAME} (min-width: 880px) {
|
|
462
|
-
bottom: ${showSequenceViewer ?
|
|
484
|
+
bottom: ${showSequenceViewer ? height.wide : "0"};
|
|
463
485
|
}
|
|
464
486
|
|
|
465
487
|
/* Spacer balancing the axes widget pinned in the opposite corner. */
|
|
@@ -635,7 +657,7 @@ function readoutSlot(label, value, residueCount) {
|
|
|
635
657
|
* residue takes priority so the user can inspect others without losing their
|
|
636
658
|
* selection.
|
|
637
659
|
*/
|
|
638
|
-
function StructureLegend({ chainBandColors, chainColors, chains = [], hiddenChains, hoveredResidue = null, onChainHover, onChainSelect, onChainToggle, scale, scaleLabel, scaleMax = null, scaleMin = 0, scaleTooltip, scaleTooltipProps, selectedChains, selectedResidue = null, showSequenceViewer, stats, valueLabel }) {
|
|
660
|
+
function StructureLegend({ chainBandColors, chainColors, chains = [], hiddenChains, hoveredResidue = null, onChainHover, onChainSelect, onChainToggle, scale, scaleLabel, scaleMax = null, scaleMin = 0, scaleTooltip, scaleTooltipProps, selectedChains, selectedResidue = null, sequenceViewerHeight, showSequenceViewer, stats, valueLabel }) {
|
|
639
661
|
var _activeResidue$residu, _stats$, _stats$2, _stats$3;
|
|
640
662
|
const activeResidue = hoveredResidue !== null && hoveredResidue !== void 0 ? hoveredResidue : selectedResidue;
|
|
641
663
|
const showResidue = activeResidue !== null;
|
|
@@ -650,6 +672,7 @@ function StructureLegend({ chainBandColors, chainColors, chains = [], hiddenChai
|
|
|
650
672
|
showResidue ? readoutSlot("pLDDT", activeResidue.plddt, residueCount) : (_stats$3 = stats[2]) !== null && _stats$3 !== void 0 ? _stats$3 : null
|
|
651
673
|
];
|
|
652
674
|
return /* @__PURE__ */ jsxs(LegendOverlay, {
|
|
675
|
+
sequenceViewerHeight,
|
|
653
676
|
showSequenceViewer,
|
|
654
677
|
children: [/* @__PURE__ */ jsx(StatsGrid, { children: Array.from({ length: SLOT_COUNT }, (_, i) => {
|
|
655
678
|
var _slots$i;
|
|
@@ -3636,6 +3659,7 @@ const _excluded = [
|
|
|
3636
3659
|
"sceneMode",
|
|
3637
3660
|
"selection",
|
|
3638
3661
|
"sequenceViewerBackgroundColor",
|
|
3662
|
+
"sequenceViewerHeight",
|
|
3639
3663
|
"showAxes",
|
|
3640
3664
|
"showChainLegend",
|
|
3641
3665
|
"showLegend",
|
|
@@ -3698,7 +3722,7 @@ function resolveScaleProps(colorBy, overlay) {
|
|
|
3698
3722
|
}
|
|
3699
3723
|
var ProteinStructureViewer_default = memo(forwardRef((props, ref) => {
|
|
3700
3724
|
var _selection$chains;
|
|
3701
|
-
const { backgroundColor, chainColors: chainColorOverrides, colorBy: colorByProp, disableChainHighlightOnHover = false, download, hiddenChains: hiddenChainsProp, highlights, initialCamera, onCameraChange, onChainVisibilityChange, onChainsChange, molstarSpec, onDispose, onError, onReady, onResidueClick, onResidueHover, onSelectionChange, onStructureLoad, orientation, projection, representation = "cartoon", structure, plddt, residueOverlay, sceneMode = "managed", selection: selectionProp, sequenceViewerBackgroundColor, showAxes = true, showChainLegend = true, showLegend = true, showSequenceViewer = true, stats } = props, rest = _objectWithoutProperties(props, _excluded);
|
|
3725
|
+
const { backgroundColor, chainColors: chainColorOverrides, colorBy: colorByProp, disableChainHighlightOnHover = false, download, hiddenChains: hiddenChainsProp, highlights, initialCamera, onCameraChange, onChainVisibilityChange, onChainsChange, molstarSpec, onDispose, onError, onReady, onResidueClick, onResidueHover, onSelectionChange, onStructureLoad, orientation, projection, representation = "cartoon", structure, plddt, residueOverlay, sceneMode = "managed", selection: selectionProp, sequenceViewerBackgroundColor, sequenceViewerHeight, showAxes = true, showChainLegend = true, showLegend = true, showSequenceViewer = true, stats } = props, rest = _objectWithoutProperties(props, _excluded);
|
|
3702
3726
|
const theme = useTheme();
|
|
3703
3727
|
const mode = getMode({ theme });
|
|
3704
3728
|
const semanticColors = getSemanticColors({ theme });
|
|
@@ -3879,6 +3903,7 @@ var ProteinStructureViewer_default = memo(forwardRef((props, ref) => {
|
|
|
3879
3903
|
const plddtColoringActive = colorBy === "plddt";
|
|
3880
3904
|
return /* @__PURE__ */ jsxs(ViewerRoot, _objectSpread2(_objectSpread2({
|
|
3881
3905
|
ref,
|
|
3906
|
+
sequenceViewerHeight,
|
|
3882
3907
|
showSequenceViewer
|
|
3883
3908
|
}, rest), {}, { children: [/* @__PURE__ */ jsx(PluginMount, { ref: pluginMountRef }), showLegend && /* @__PURE__ */ jsx(StructureLegend, _objectSpread2({
|
|
3884
3909
|
chainBandColors: plddtColoringActive ? PLDDT_BAND_COLORS : void 0,
|
|
@@ -3891,6 +3916,7 @@ var ProteinStructureViewer_default = memo(forwardRef((props, ref) => {
|
|
|
3891
3916
|
onChainToggle: toggleChain,
|
|
3892
3917
|
selectedChains,
|
|
3893
3918
|
selectedResidue: selectedReadout,
|
|
3919
|
+
sequenceViewerHeight,
|
|
3894
3920
|
showSequenceViewer,
|
|
3895
3921
|
stats: stats !== null && stats !== void 0 ? stats : []
|
|
3896
3922
|
}, scaleProps))] }));
|
|
@@ -361,6 +361,17 @@ interface ProteinStructureViewerProps extends Omit<HTMLAttributes<HTMLDivElement
|
|
|
361
361
|
* @default true
|
|
362
362
|
*/
|
|
363
363
|
showSequenceViewer?: boolean;
|
|
364
|
+
/**
|
|
365
|
+
* Height of the sequence panel, as any CSS length; a number is read as
|
|
366
|
+
* pixels, and a percentage is of the viewer's own height. The 3D view and the
|
|
367
|
+
* legend move up to make room for it. Ignored while `showSequenceViewer` is
|
|
368
|
+
* off.
|
|
369
|
+
*
|
|
370
|
+
* Left undefined, the panel takes `max(104px, 30%)` of the viewer, growing to
|
|
371
|
+
* `max(134px, 32%)` once the viewer is 880px wide or more. A height set here
|
|
372
|
+
* holds at every width.
|
|
373
|
+
*/
|
|
374
|
+
sequenceViewerHeight?: number | string;
|
|
364
375
|
/**
|
|
365
376
|
* Show the stats and color scale legend overlaid on the viewer.
|
|
366
377
|
* @default true
|
|
@@ -361,6 +361,17 @@ interface ProteinStructureViewerProps extends Omit<HTMLAttributes<HTMLDivElement
|
|
|
361
361
|
* @default true
|
|
362
362
|
*/
|
|
363
363
|
showSequenceViewer?: boolean;
|
|
364
|
+
/**
|
|
365
|
+
* Height of the sequence panel, as any CSS length; a number is read as
|
|
366
|
+
* pixels, and a percentage is of the viewer's own height. The 3D view and the
|
|
367
|
+
* legend move up to make room for it. Ignored while `showSequenceViewer` is
|
|
368
|
+
* off.
|
|
369
|
+
*
|
|
370
|
+
* Left undefined, the panel takes `max(104px, 30%)` of the viewer, growing to
|
|
371
|
+
* `max(134px, 32%)` once the viewer is 880px wide or more. A height set here
|
|
372
|
+
* holds at every width.
|
|
373
|
+
*/
|
|
374
|
+
sequenceViewerHeight?: number | string;
|
|
364
375
|
/**
|
|
365
376
|
* Show the stats and color scale legend overlaid on the viewer.
|
|
366
377
|
* @default true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@czi-sds/data-viz",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"main": "dist/index.cjs.js",
|
|
5
5
|
"types": "dist/index.cjs.d.ts",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -157,5 +157,5 @@
|
|
|
157
157
|
"echarts": "^6.0.0",
|
|
158
158
|
"lodash": "^4.17.21"
|
|
159
159
|
},
|
|
160
|
-
"gitHead": "
|
|
160
|
+
"gitHead": "aa0c756f82d9b899e9e7cc66ab2a6d1684ceb1f7"
|
|
161
161
|
}
|