@jbrowse/plugin-variants 2.18.0 → 3.0.0
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.
- package/dist/ChordVariantDisplay/models/stateModelFactory.d.ts +1 -1
- package/dist/LinearVariantDisplay/model.d.ts +5 -5
- package/dist/MultiLinearVariantDisplay/components/Crosshair.d.ts +7 -0
- package/dist/MultiLinearVariantDisplay/components/Crosshair.js +35 -0
- package/dist/MultiLinearVariantDisplay/components/VariantDisplayComponent.d.ts +1 -2
- package/dist/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +5 -49
- package/dist/MultiLinearVariantDisplay/index.js +18 -8
- package/dist/MultiLinearVariantDisplay/model.d.ts +113 -40
- package/dist/MultiLinearVariantDisplay/model.js +24 -176
- package/dist/MultiLinearVariantDisplay/renderSvg.d.ts +1 -2
- package/dist/MultiLinearVariantDisplay/renderSvg.js +2 -5
- package/dist/MultiLinearVariantMatrixDisplay/components/Crosshair.d.ts +7 -0
- package/dist/MultiLinearVariantMatrixDisplay/components/Crosshair.js +28 -0
- package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.d.ts +1 -2
- package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +13 -16
- package/dist/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.d.ts +1 -2
- package/dist/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +6 -56
- package/dist/MultiLinearVariantMatrixDisplay/model.d.ts +109 -27
- package/dist/MultiLinearVariantMatrixDisplay/model.js +31 -136
- package/dist/MultiLinearVariantMatrixDisplay/renderSvg.d.ts +1 -2
- package/dist/MultiLinearVariantMatrixDisplay/renderSvg.js +3 -7
- package/dist/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.d.ts +4 -32
- package/dist/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.js +44 -63
- package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +3 -2
- package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +31 -5
- package/dist/MultiLinearVariantMatrixRenderer/index.js +2 -2
- package/dist/MultiLinearVariantMatrixRenderer/makeImageData.d.ts +10 -0
- package/dist/MultiLinearVariantMatrixRenderer/makeImageData.js +100 -0
- package/dist/MultiLinearVariantMatrixRenderer/types.d.ts +15 -0
- package/dist/MultiLinearVariantMatrixRenderer/types.js +2 -0
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +4 -21
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.js +38 -25
- package/dist/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +7 -3
- package/dist/MultiLinearVariantRenderer/MultiVariantRendering.js +36 -27
- package/dist/MultiLinearVariantRenderer/configSchema.d.ts +1 -33
- package/dist/MultiLinearVariantRenderer/configSchema.js +0 -5
- package/dist/MultiLinearVariantRenderer/makeImageData.d.ts +4 -0
- package/dist/MultiLinearVariantRenderer/makeImageData.js +67 -0
- package/dist/MultiLinearVariantRenderer/types.d.ts +19 -0
- package/dist/MultiLinearVariantRenderer/types.js +2 -0
- package/dist/MultiVariantBaseRenderer.d.ts +4 -4
- package/dist/StructuralVariantChordRenderer/Chord.d.ts +2 -19
- package/dist/StructuralVariantChordRenderer/Chord.js +3 -25
- package/dist/StructuralVariantChordRenderer/ReactComponent.d.ts +2 -3
- package/dist/StructuralVariantChordRenderer/ReactComponent.js +7 -29
- package/dist/StructuralVariantChordRenderer/types.d.ts +17 -0
- package/dist/StructuralVariantChordRenderer/types.js +2 -0
- package/dist/Tooltip.d.ts +2 -2
- package/dist/Tooltip.js +6 -32
- package/dist/VariantFeatureWidget/Checkbox2.d.ts +1 -2
- package/dist/VariantFeatureWidget/Checkbox2.js +2 -5
- package/dist/VariantFeatureWidget/LaunchBreakendPanel.d.ts +2 -3
- package/dist/VariantFeatureWidget/LaunchBreakendPanel.js +66 -69
- package/dist/VariantFeatureWidget/LaunchBreakendWidgetArea.d.ts +4 -0
- package/dist/VariantFeatureWidget/LaunchBreakendWidgetArea.js +60 -0
- package/dist/VariantFeatureWidget/VariantConsequenceDataGrid.d.ts +5 -0
- package/dist/VariantFeatureWidget/VariantConsequenceDataGrid.js +15 -0
- package/dist/VariantFeatureWidget/VariantConsequenceDataGridWrapper.d.ts +5 -0
- package/dist/VariantFeatureWidget/VariantConsequenceDataGridWrapper.js +20 -0
- package/dist/VariantFeatureWidget/VariantConsequencePanel.d.ts +5 -0
- package/dist/VariantFeatureWidget/VariantConsequencePanel.js +15 -0
- package/dist/VariantFeatureWidget/VariantFeatureWidget.d.ts +1 -2
- package/dist/VariantFeatureWidget/VariantFeatureWidget.js +47 -36
- package/dist/VariantFeatureWidget/VariantSampleFilters.d.ts +9 -0
- package/dist/VariantFeatureWidget/VariantSampleFilters.js +10 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid.d.ts +9 -7
- package/dist/VariantFeatureWidget/VariantSampleGrid.js +14 -44
- package/dist/VariantFeatureWidget/index.js +17 -7
- package/dist/VariantFeatureWidget/types.d.ts +16 -0
- package/dist/VariantFeatureWidget/types.js +2 -0
- package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.js +10 -27
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +12 -7
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.js +27 -37
- package/dist/VcfAdapter/VcfAdapter.d.ts +7 -0
- package/dist/VcfAdapter/VcfAdapter.js +29 -3
- package/dist/VcfAdapter/configSchema.d.ts +8 -0
- package/dist/VcfAdapter/configSchema.js +12 -1
- package/dist/VcfAdapter/index.js +17 -7
- package/dist/VcfFeature/index.js +2 -1
- package/dist/VcfFeature/util.js +3 -4
- package/dist/VcfTabixAdapter/VcfTabixAdapter.js +38 -12
- package/dist/VcfTabixAdapter/configSchema.d.ts +8 -0
- package/dist/VcfTabixAdapter/configSchema.js +8 -0
- package/dist/VcfTabixAdapter/index.js +17 -7
- package/dist/extensionPoints.js +21 -33
- package/dist/getMultiVariantFeaturesAutorun.d.ts +4 -7
- package/dist/getMultiVariantFeaturesAutorun.js +16 -15
- package/dist/getMultiVariantSourcesAutorun.d.ts +1 -6
- package/dist/shared/BulkEditPanel.d.ts +4 -5
- package/dist/shared/BulkEditPanel.js +69 -88
- package/dist/shared/ClusterDialog.d.ts +4 -5
- package/dist/shared/ClusterDialog.js +45 -86
- package/dist/shared/ColorLegend.d.ts +2 -3
- package/dist/shared/ColorLegend.js +8 -10
- package/dist/shared/HelpfulTips.d.ts +1 -0
- package/dist/shared/HelpfulTips.js +7 -0
- package/dist/shared/LegendBar.d.ts +3 -3
- package/dist/shared/LegendBar.js +6 -12
- package/dist/shared/MAFFilterDialog.d.ts +2 -3
- package/dist/shared/MAFFilterDialog.js +14 -42
- package/dist/shared/MultiVariantBaseModel.d.ts +341 -0
- package/dist/shared/MultiVariantBaseModel.js +316 -0
- package/dist/shared/MultiVariantTooltip.d.ts +6 -0
- package/dist/shared/MultiVariantTooltip.js +23 -0
- package/dist/shared/RectBg.d.ts +2 -3
- package/dist/shared/RectBg.js +3 -7
- package/dist/shared/RowPalettizer.d.ts +2 -3
- package/dist/shared/RowPalettizer.js +30 -28
- package/dist/shared/SetColorDialog.d.ts +2 -3
- package/dist/shared/SetColorDialog.js +26 -65
- package/dist/shared/SetMinMaxDialog.d.ts +1 -2
- package/dist/shared/SetMinMaxDialog.js +11 -41
- package/dist/shared/SetRowHeightDialog.d.ts +8 -0
- package/dist/shared/SetRowHeightDialog.js +18 -0
- package/dist/shared/SharedVariantMixin.d.ts +7 -7
- package/dist/shared/SourcesDataGrid.d.ts +6 -0
- package/dist/shared/SourcesDataGrid.js +68 -0
- package/dist/shared/SourcesGrid.d.ts +2 -3
- package/dist/shared/SourcesGrid.js +5 -134
- package/dist/shared/SourcesGridHeader.d.ts +7 -0
- package/dist/shared/SourcesGridHeader.js +41 -0
- package/dist/shared/multiVariantColor.d.ts +3 -0
- package/dist/shared/multiVariantColor.js +50 -0
- package/dist/types.d.ts +14 -0
- package/dist/types.js +2 -0
- package/dist/util.d.ts +6 -9
- package/dist/util.js +47 -14
- package/esm/ChordVariantDisplay/models/stateModelFactory.d.ts +1 -1
- package/esm/LinearVariantDisplay/model.d.ts +5 -5
- package/esm/MultiLinearVariantDisplay/components/Crosshair.d.ts +7 -0
- package/esm/MultiLinearVariantDisplay/components/Crosshair.js +30 -0
- package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.d.ts +1 -2
- package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +5 -26
- package/esm/MultiLinearVariantDisplay/index.js +1 -1
- package/esm/MultiLinearVariantDisplay/model.d.ts +113 -40
- package/esm/MultiLinearVariantDisplay/model.js +7 -169
- package/esm/MultiLinearVariantDisplay/renderSvg.d.ts +1 -2
- package/esm/MultiLinearVariantDisplay/renderSvg.js +2 -5
- package/esm/MultiLinearVariantMatrixDisplay/components/Crosshair.d.ts +7 -0
- package/esm/MultiLinearVariantMatrixDisplay/components/Crosshair.js +23 -0
- package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.d.ts +1 -2
- package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +13 -13
- package/esm/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.d.ts +1 -2
- package/esm/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +6 -33
- package/esm/MultiLinearVariantMatrixDisplay/model.d.ts +109 -27
- package/esm/MultiLinearVariantMatrixDisplay/model.js +14 -129
- package/esm/MultiLinearVariantMatrixDisplay/renderSvg.d.ts +1 -2
- package/esm/MultiLinearVariantMatrixDisplay/renderSvg.js +3 -7
- package/esm/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.d.ts +4 -32
- package/esm/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.js +11 -63
- package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +3 -2
- package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +31 -2
- package/esm/MultiLinearVariantMatrixRenderer/index.js +1 -1
- package/esm/MultiLinearVariantMatrixRenderer/makeImageData.d.ts +10 -0
- package/esm/MultiLinearVariantMatrixRenderer/makeImageData.js +97 -0
- package/esm/MultiLinearVariantMatrixRenderer/types.d.ts +15 -0
- package/esm/MultiLinearVariantMatrixRenderer/types.js +1 -0
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +4 -21
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.js +6 -26
- package/esm/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +7 -3
- package/esm/MultiLinearVariantRenderer/MultiVariantRendering.js +34 -5
- package/esm/MultiLinearVariantRenderer/configSchema.d.ts +1 -33
- package/esm/MultiLinearVariantRenderer/configSchema.js +0 -2
- package/esm/MultiLinearVariantRenderer/makeImageData.d.ts +4 -0
- package/esm/MultiLinearVariantRenderer/makeImageData.js +61 -0
- package/esm/MultiLinearVariantRenderer/types.d.ts +19 -0
- package/esm/MultiLinearVariantRenderer/types.js +1 -0
- package/esm/MultiVariantBaseRenderer.d.ts +4 -4
- package/esm/StructuralVariantChordRenderer/Chord.d.ts +2 -19
- package/esm/StructuralVariantChordRenderer/Chord.js +3 -2
- package/esm/StructuralVariantChordRenderer/ReactComponent.d.ts +2 -3
- package/esm/StructuralVariantChordRenderer/ReactComponent.js +7 -6
- package/esm/StructuralVariantChordRenderer/types.d.ts +17 -0
- package/esm/StructuralVariantChordRenderer/types.js +1 -0
- package/esm/Tooltip.d.ts +2 -2
- package/esm/Tooltip.js +6 -9
- package/esm/VariantFeatureWidget/Checkbox2.d.ts +1 -2
- package/esm/VariantFeatureWidget/Checkbox2.js +2 -2
- package/esm/VariantFeatureWidget/LaunchBreakendPanel.d.ts +2 -3
- package/esm/VariantFeatureWidget/LaunchBreakendPanel.js +48 -61
- package/esm/VariantFeatureWidget/LaunchBreakendWidgetArea.d.ts +4 -0
- package/esm/VariantFeatureWidget/LaunchBreakendWidgetArea.js +24 -0
- package/esm/VariantFeatureWidget/VariantConsequenceDataGrid.d.ts +5 -0
- package/esm/VariantFeatureWidget/VariantConsequenceDataGrid.js +9 -0
- package/esm/VariantFeatureWidget/VariantConsequenceDataGridWrapper.d.ts +5 -0
- package/esm/VariantFeatureWidget/VariantConsequenceDataGridWrapper.js +17 -0
- package/esm/VariantFeatureWidget/VariantConsequencePanel.d.ts +5 -0
- package/esm/VariantFeatureWidget/VariantConsequencePanel.js +9 -0
- package/esm/VariantFeatureWidget/VariantFeatureWidget.d.ts +1 -2
- package/esm/VariantFeatureWidget/VariantFeatureWidget.js +30 -29
- package/esm/VariantFeatureWidget/VariantSampleFilters.d.ts +9 -0
- package/esm/VariantFeatureWidget/VariantSampleFilters.js +7 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid.d.ts +9 -7
- package/esm/VariantFeatureWidget/VariantSampleGrid.js +15 -22
- package/esm/VariantFeatureWidget/types.d.ts +16 -0
- package/esm/VariantFeatureWidget/types.js +1 -0
- package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.js +10 -27
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +12 -7
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.js +27 -37
- package/esm/VcfAdapter/VcfAdapter.d.ts +7 -0
- package/esm/VcfAdapter/VcfAdapter.js +31 -5
- package/esm/VcfAdapter/configSchema.d.ts +8 -0
- package/esm/VcfAdapter/configSchema.js +12 -1
- package/esm/VcfFeature/index.js +2 -1
- package/esm/VcfFeature/util.js +3 -4
- package/esm/VcfTabixAdapter/VcfTabixAdapter.js +38 -12
- package/esm/VcfTabixAdapter/configSchema.d.ts +8 -0
- package/esm/VcfTabixAdapter/configSchema.js +8 -0
- package/esm/extensionPoints.js +21 -33
- package/esm/getMultiVariantFeaturesAutorun.d.ts +4 -7
- package/esm/getMultiVariantFeaturesAutorun.js +16 -15
- package/esm/getMultiVariantSourcesAutorun.d.ts +1 -6
- package/esm/shared/BulkEditPanel.d.ts +4 -5
- package/esm/shared/BulkEditPanel.js +70 -66
- package/esm/shared/ClusterDialog.d.ts +4 -5
- package/esm/shared/ClusterDialog.js +44 -62
- package/esm/shared/ColorLegend.d.ts +2 -3
- package/esm/shared/ColorLegend.js +8 -10
- package/esm/shared/HelpfulTips.d.ts +1 -0
- package/esm/shared/HelpfulTips.js +4 -0
- package/esm/shared/LegendBar.d.ts +3 -3
- package/esm/shared/LegendBar.js +7 -13
- package/esm/shared/MAFFilterDialog.d.ts +2 -3
- package/esm/shared/MAFFilterDialog.js +14 -19
- package/esm/shared/MultiVariantBaseModel.d.ts +341 -0
- package/esm/shared/MultiVariantBaseModel.js +277 -0
- package/esm/shared/MultiVariantTooltip.d.ts +6 -0
- package/esm/shared/MultiVariantTooltip.js +17 -0
- package/esm/shared/RectBg.d.ts +2 -3
- package/esm/shared/RectBg.js +3 -4
- package/esm/shared/RowPalettizer.d.ts +2 -3
- package/esm/shared/RowPalettizer.js +30 -25
- package/esm/shared/SetColorDialog.d.ts +2 -3
- package/esm/shared/SetColorDialog.js +26 -42
- package/esm/shared/SetMinMaxDialog.d.ts +1 -2
- package/esm/shared/SetMinMaxDialog.js +11 -18
- package/esm/shared/SetRowHeightDialog.d.ts +8 -0
- package/esm/shared/SetRowHeightDialog.js +15 -0
- package/esm/shared/SharedVariantMixin.d.ts +7 -7
- package/esm/shared/SourcesDataGrid.d.ts +6 -0
- package/esm/shared/SourcesDataGrid.js +62 -0
- package/esm/shared/SourcesGrid.d.ts +2 -3
- package/esm/shared/SourcesGrid.js +5 -111
- package/esm/shared/SourcesGridHeader.d.ts +7 -0
- package/esm/shared/SourcesGridHeader.js +35 -0
- package/esm/shared/multiVariantColor.d.ts +3 -0
- package/esm/shared/multiVariantColor.js +45 -0
- package/esm/types.d.ts +14 -0
- package/esm/types.js +1 -0
- package/esm/util.d.ts +6 -9
- package/esm/util.js +43 -13
- package/package.json +6 -7
- package/dist/VariantFeatureWidget/AnnotGrid.d.ts +0 -6
- package/dist/VariantFeatureWidget/AnnotGrid.js +0 -39
- package/dist/VariantFeatureWidget/VariantAnnotationTable.d.ts +0 -6
- package/dist/VariantFeatureWidget/VariantAnnotationTable.js +0 -16
- package/dist/configSchema.d.ts +0 -34
- package/dist/configSchema.js +0 -44
- package/dist/shared/DraggableDialog.d.ts +0 -6
- package/dist/shared/DraggableDialog.js +0 -62
- package/dist/shared/Tooltip.d.ts +0 -18
- package/dist/shared/Tooltip.js +0 -38
- package/esm/VariantFeatureWidget/AnnotGrid.d.ts +0 -6
- package/esm/VariantFeatureWidget/AnnotGrid.js +0 -13
- package/esm/VariantFeatureWidget/VariantAnnotationTable.d.ts +0 -6
- package/esm/VariantFeatureWidget/VariantAnnotationTable.js +0 -10
- package/esm/configSchema.d.ts +0 -34
- package/esm/configSchema.js +0 -42
- package/esm/shared/DraggableDialog.d.ts +0 -6
- package/esm/shared/DraggableDialog.js +0 -34
- package/esm/shared/Tooltip.d.ts +0 -18
- package/esm/shared/Tooltip.js +0 -33
|
@@ -1,32 +1,37 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { set1 } from '@jbrowse/core/ui/colors';
|
|
3
3
|
import { Button } from '@mui/material';
|
|
4
4
|
import { randomColor } from '../util';
|
|
5
5
|
export default function RowPalettizer({ setCurrLayout, currLayout, }) {
|
|
6
6
|
var _a;
|
|
7
|
-
return (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
return (_jsxs("div", { children: ["Create color palette based on...", Object.keys((_a = currLayout[0]) !== null && _a !== void 0 ? _a : [])
|
|
8
|
+
.filter(f => f !== 'name' &&
|
|
9
|
+
f !== 'color' &&
|
|
10
|
+
f !== 'label' &&
|
|
11
|
+
f !== 'id' &&
|
|
12
|
+
f !== 'HP')
|
|
13
|
+
.map(r => (_jsx(Button, { variant: "contained", color: "inherit", onClick: () => {
|
|
14
|
+
const map = new Map();
|
|
15
|
+
for (const row of currLayout) {
|
|
16
|
+
const val = map.get(row[r]);
|
|
17
|
+
if (!val) {
|
|
18
|
+
map.set(row[r], 1);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
map.set(row[r], val + 1);
|
|
22
|
+
}
|
|
16
23
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
r));
|
|
31
|
-
})));
|
|
24
|
+
const ret = Object.fromEntries([...map.entries()]
|
|
25
|
+
.sort((a, b) => a[1] - b[1])
|
|
26
|
+
.map((r, idx) => [r[0], set1[idx] || randomColor(r[0])]));
|
|
27
|
+
setCurrLayout(currLayout.map(row => ({
|
|
28
|
+
...row,
|
|
29
|
+
color: ret[row[r]],
|
|
30
|
+
})));
|
|
31
|
+
}, children: r }, r))), _jsx(Button, { onClick: () => {
|
|
32
|
+
setCurrLayout(currLayout.map(row => ({
|
|
33
|
+
...row,
|
|
34
|
+
color: undefined,
|
|
35
|
+
})));
|
|
36
|
+
}, children: "Clear colors" })] }));
|
|
32
37
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { type Source } from '../util';
|
|
1
|
+
import type { Source } from '../types';
|
|
3
2
|
interface ReducedModel {
|
|
4
3
|
sources?: Source[];
|
|
5
4
|
setLayout: (s: Source[]) => void;
|
|
@@ -8,5 +7,5 @@ interface ReducedModel {
|
|
|
8
7
|
export default function SetColorDialog({ model, handleClose, }: {
|
|
9
8
|
model: ReducedModel;
|
|
10
9
|
handleClose: () => void;
|
|
11
|
-
}):
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
11
|
export {};
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import DraggableDialog from '@jbrowse/core/ui/DraggableDialog';
|
|
2
4
|
import { useLocalStorage } from '@jbrowse/core/util';
|
|
3
5
|
import { Button, DialogActions, DialogContent } from '@mui/material';
|
|
4
6
|
import { makeStyles } from 'tss-react/mui';
|
|
5
|
-
import DraggableDialog from './DraggableDialog';
|
|
6
|
-
import SourcesGrid from './SourcesGrid';
|
|
7
7
|
import BulkEditPanel from './BulkEditPanel';
|
|
8
|
+
import HelpfulTips from './HelpfulTips';
|
|
8
9
|
import RowPalettizer from './RowPalettizer';
|
|
10
|
+
import SourcesGrid from './SourcesGrid';
|
|
9
11
|
const useStyles = makeStyles()({
|
|
10
12
|
content: {
|
|
11
13
|
minWidth: 800,
|
|
12
14
|
},
|
|
13
15
|
fr: {
|
|
14
16
|
float: 'right',
|
|
17
|
+
display: 'flex',
|
|
18
|
+
gap: 8,
|
|
15
19
|
},
|
|
16
20
|
textAreaFont: {
|
|
17
21
|
fontFamily: 'Courier New',
|
|
@@ -23,43 +27,23 @@ export default function SetColorDialog({ model, handleClose, }) {
|
|
|
23
27
|
const [showBulkEditor, setShowBulkEditor] = useState(false);
|
|
24
28
|
const [currLayout, setCurrLayout] = useState(sources || []);
|
|
25
29
|
const [showTips, setShowTips] = useLocalStorage('multivariant-showTips', false);
|
|
26
|
-
return (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
46
|
-
handleClose();
|
|
47
|
-
setCurrLayout([...(model.sources || [])]);
|
|
48
|
-
} }, "Cancel"),
|
|
49
|
-
React.createElement(Button, { variant: "contained", color: "primary", type: "submit", onClick: () => {
|
|
50
|
-
model.setLayout(currLayout);
|
|
51
|
-
handleClose();
|
|
52
|
-
} }, "Submit"))));
|
|
53
|
-
}
|
|
54
|
-
function HelpfulTips() {
|
|
55
|
-
return (React.createElement(React.Fragment, null,
|
|
56
|
-
"Helpful tips",
|
|
57
|
-
React.createElement("ul", null,
|
|
58
|
-
React.createElement("li", null, "You can select rows in the table with the checkboxes"),
|
|
59
|
-
React.createElement("li", null, "Multi-select is enabled with shift-click and control-click"),
|
|
60
|
-
React.createElement("li", null, "The \"Move selected items up/down\" can re-arrange subtracks"),
|
|
61
|
-
React.createElement("li", null, "Sorting the data grid itself can also re-arrange subtracks"),
|
|
62
|
-
React.createElement("li", null, "Changes are applied when you hit Submit"),
|
|
63
|
-
React.createElement("li", null, "You can click and drag the dialog box to move it on the screen"),
|
|
64
|
-
React.createElement("li", null, "Columns in the table can be hidden using a vertical '...' menu on the right side of each column"))));
|
|
30
|
+
return (_jsx(DraggableDialog, { open: true, onClose: handleClose, maxWidth: "xl", title: "Multi-variant color/arrangement editor", children: showBulkEditor ? (_jsx(BulkEditPanel, { currLayout: currLayout, onClose: arg => {
|
|
31
|
+
if (arg) {
|
|
32
|
+
setCurrLayout(arg);
|
|
33
|
+
}
|
|
34
|
+
setShowBulkEditor(false);
|
|
35
|
+
} })) : (_jsxs(_Fragment, { children: [_jsxs(DialogContent, { className: classes.content, children: [_jsxs("div", { className: classes.fr, children: [_jsx(Button, { variant: "contained", onClick: () => {
|
|
36
|
+
setShowTips(!showTips);
|
|
37
|
+
}, children: showTips ? 'Hide tips' : 'Show tips' }), _jsx(Button, { color: "secondary", variant: "contained", onClick: () => {
|
|
38
|
+
setShowBulkEditor(!showBulkEditor);
|
|
39
|
+
}, children: "Show Bulk row editor" })] }), showTips ? _jsx(HelpfulTips, {}) : null, _jsx("br", {}), _jsx(RowPalettizer, { currLayout: currLayout, setCurrLayout: setCurrLayout }), _jsx(SourcesGrid, { rows: currLayout, onChange: setCurrLayout, showTips: showTips })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", type: "submit", color: "inherit", onClick: () => {
|
|
40
|
+
model.clearLayout();
|
|
41
|
+
setCurrLayout(model.sources || []);
|
|
42
|
+
}, children: "Clear custom settings" }), _jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
43
|
+
handleClose();
|
|
44
|
+
setCurrLayout([...(model.sources || [])]);
|
|
45
|
+
}, children: "Cancel" }), _jsx(Button, { variant: "contained", color: "primary", type: "submit", onClick: () => {
|
|
46
|
+
model.setLayout(currLayout);
|
|
47
|
+
handleClose();
|
|
48
|
+
}, children: "Submit" })] })] })) }));
|
|
65
49
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export default function SetMinMaxDialog(props: {
|
|
3
2
|
model: {
|
|
4
3
|
minScore: number;
|
|
@@ -8,4 +7,4 @@ export default function SetMinMaxDialog(props: {
|
|
|
8
7
|
setMaxScore: (arg?: number) => void;
|
|
9
8
|
};
|
|
10
9
|
handleClose: () => void;
|
|
11
|
-
}):
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
2
3
|
import { Dialog } from '@jbrowse/core/ui';
|
|
3
4
|
import { Button, DialogActions, DialogContent, TextField, Typography, } from '@mui/material';
|
|
4
5
|
export default function SetMinMaxDialog(props) {
|
|
@@ -10,21 +11,13 @@ export default function SetMinMaxDialog(props) {
|
|
|
10
11
|
? +max > +min
|
|
11
12
|
: true;
|
|
12
13
|
const logOk = scaleType === 'log' && min !== '' && !Number.isNaN(+min) ? +min > 0 : true;
|
|
13
|
-
return (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
setMax(event.target.value);
|
|
23
|
-
}, placeholder: "Enter max score" })),
|
|
24
|
-
React.createElement(DialogActions, null,
|
|
25
|
-
React.createElement(Button, { variant: "contained", color: "primary", type: "submit", style: { marginLeft: 20 }, disabled: !ok, onClick: () => {
|
|
26
|
-
model.setMinScore(min !== '' && !Number.isNaN(+min) ? +min : undefined);
|
|
27
|
-
model.setMaxScore(max !== '' && !Number.isNaN(+max) ? +max : undefined);
|
|
28
|
-
handleClose();
|
|
29
|
-
} }, "Submit"))));
|
|
14
|
+
return (_jsxs(Dialog, { open: true, onClose: handleClose, title: "Set min/max score for track", children: [_jsxs(DialogContent, { children: [_jsx(Typography, { children: "Enter min/max score: " }), !ok ? (_jsx(Typography, { color: "error", children: "Max is greater than or equal to min" })) : null, !logOk ? (_jsx(Typography, { color: "error", children: "Min score should be greater than 0 for log scale" })) : null, _jsx(TextField, { value: min, onChange: event => {
|
|
15
|
+
setMin(event.target.value);
|
|
16
|
+
}, placeholder: "Enter min score" }), _jsx(TextField, { value: max, onChange: event => {
|
|
17
|
+
setMax(event.target.value);
|
|
18
|
+
}, placeholder: "Enter max score" })] }), _jsx(DialogActions, { children: _jsx(Button, { variant: "contained", color: "primary", type: "submit", style: { marginLeft: 20 }, disabled: !ok, onClick: () => {
|
|
19
|
+
model.setMinScore(min !== '' && !Number.isNaN(+min) ? +min : undefined);
|
|
20
|
+
model.setMaxScore(max !== '' && !Number.isNaN(+max) ? +max : undefined);
|
|
21
|
+
handleClose();
|
|
22
|
+
}, children: "Submit" }) })] }));
|
|
30
23
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Dialog } from '@jbrowse/core/ui';
|
|
4
|
+
import { Button, DialogActions, DialogContent, TextField } from '@mui/material';
|
|
5
|
+
export default function SetRowHeight({ model, handleClose, }) {
|
|
6
|
+
const [value, setValue] = useState(`${model.rowHeight}`);
|
|
7
|
+
return (_jsxs(Dialog, { open: true, title: "Set row height", onClose: handleClose, children: [_jsx(DialogContent, { children: _jsx(TextField, { value: value, onChange: event => {
|
|
8
|
+
setValue(event.target.value);
|
|
9
|
+
} }) }), _jsxs(DialogActions, { children: [_jsx(Button, { disabled: Number.isNaN(+value), variant: "contained", onClick: () => {
|
|
10
|
+
model.setRowHeight(+value);
|
|
11
|
+
handleClose();
|
|
12
|
+
}, children: "Submit" }), _jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
13
|
+
handleClose();
|
|
14
|
+
}, children: "Cancel" })] })] }));
|
|
15
|
+
}
|
|
@@ -35,7 +35,7 @@ export default function SharedVariantMixin(configSchema: AnyConfigurationSchemaT
|
|
|
35
35
|
status?: string;
|
|
36
36
|
reactElement?: React.ReactElement;
|
|
37
37
|
};
|
|
38
|
-
}) => import("react").JSX.Element | undefined;
|
|
38
|
+
}) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
39
39
|
renderProps: any;
|
|
40
40
|
} & {
|
|
41
41
|
doReload(): void;
|
|
@@ -172,13 +172,13 @@ export default function SharedVariantMixin(configSchema: AnyConfigurationSchemaT
|
|
|
172
172
|
} & {
|
|
173
173
|
readonly statsReadyAndRegionNotTooLarge: boolean;
|
|
174
174
|
regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
|
|
175
|
-
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react").JSX.Element | null;
|
|
175
|
+
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react/jsx-runtime").JSX.Element | null;
|
|
176
176
|
} & {
|
|
177
177
|
featureIdUnderMouse: undefined | string;
|
|
178
178
|
contextMenuFeature: undefined | Feature;
|
|
179
179
|
} & {
|
|
180
|
-
readonly DisplayMessageComponent:
|
|
181
|
-
readonly blockType: "
|
|
180
|
+
readonly DisplayMessageComponent: undefined | React.FC<any>;
|
|
181
|
+
readonly blockType: "staticBlocks" | "dynamicBlocks";
|
|
182
182
|
readonly blockDefinitions: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
183
183
|
} & {
|
|
184
184
|
readonly renderDelay: number;
|
|
@@ -205,7 +205,7 @@ export default function SharedVariantMixin(configSchema: AnyConfigurationSchemaT
|
|
|
205
205
|
contextMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
206
206
|
renderProps(): any;
|
|
207
207
|
} & {
|
|
208
|
-
renderSvg(opts: import("@jbrowse/plugin-linear-genome-view").ExportSvgDisplayOptions): Promise<import("react").JSX.Element>;
|
|
208
|
+
renderSvg(opts: import("@jbrowse/plugin-linear-genome-view").ExportSvgDisplayOptions): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
209
209
|
afterAttach(): void;
|
|
210
210
|
} & {
|
|
211
211
|
message: undefined | string;
|
|
@@ -257,7 +257,7 @@ export default function SharedVariantMixin(configSchema: AnyConfigurationSchemaT
|
|
|
257
257
|
status?: string;
|
|
258
258
|
reactElement?: React.ReactElement;
|
|
259
259
|
};
|
|
260
|
-
}) => import("react").JSX.Element | undefined;
|
|
260
|
+
}) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
261
261
|
renderProps: any;
|
|
262
262
|
} & {
|
|
263
263
|
doReload(): void;
|
|
@@ -299,8 +299,8 @@ export default function SharedVariantMixin(configSchema: AnyConfigurationSchemaT
|
|
|
299
299
|
};
|
|
300
300
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
|
|
301
301
|
}>> & import("mobx-state-tree/dist/internal").NonEmptyObject & import("mobx-state-tree")._NotCustomized, {
|
|
302
|
-
type: string;
|
|
303
302
|
id: string;
|
|
303
|
+
type: string;
|
|
304
304
|
configuration: import("mobx-state-tree").ModelSnapshotType<Record<string, any>>;
|
|
305
305
|
rpcDriverName: string | undefined;
|
|
306
306
|
heightPreConfig: number | undefined;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { SanitizedHTML } from '@jbrowse/core/ui';
|
|
4
|
+
import ColorPicker from '@jbrowse/core/ui/ColorPicker';
|
|
5
|
+
import { getStr, measureGridWidth } from '@jbrowse/core/util';
|
|
6
|
+
import { DataGrid } from '@mui/x-data-grid';
|
|
7
|
+
import { makeStyles } from 'tss-react/mui';
|
|
8
|
+
const useStyles = makeStyles()({
|
|
9
|
+
cell: {
|
|
10
|
+
whiteSpace: 'nowrap',
|
|
11
|
+
overflow: 'hidden',
|
|
12
|
+
textOverflow: 'ellipsis',
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
export default function SourcesDataGrid({ rows, onChange, setSelected, }) {
|
|
16
|
+
const { classes } = useStyles();
|
|
17
|
+
const { id: _id, name: _name, label: _label, color: _color, baseUri: _baseUri, HP: _HP, ...rest } = rows[0];
|
|
18
|
+
const [currSort, setCurrSort] = useState({
|
|
19
|
+
idx: 0,
|
|
20
|
+
field: null,
|
|
21
|
+
});
|
|
22
|
+
return (_jsx("div", { style: { height: 400, width: '100%' }, children: _jsx(DataGrid, { checkboxSelection: true, disableRowSelectionOnClick: true, onRowSelectionModelChange: arg => {
|
|
23
|
+
setSelected(arg);
|
|
24
|
+
}, rows: rows, rowHeight: 25, columnHeaderHeight: 33, columns: [
|
|
25
|
+
{
|
|
26
|
+
field: 'color',
|
|
27
|
+
headerName: 'Color',
|
|
28
|
+
renderCell: params => {
|
|
29
|
+
const { value, id } = params;
|
|
30
|
+
return (_jsx(ColorPicker, { color: value || 'blue', onChange: c => {
|
|
31
|
+
const elt = rows.find(f => f.name === id);
|
|
32
|
+
if (elt) {
|
|
33
|
+
elt.color = c;
|
|
34
|
+
}
|
|
35
|
+
onChange([...rows]);
|
|
36
|
+
} }));
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
field: 'label',
|
|
41
|
+
headerName: 'Name',
|
|
42
|
+
width: measureGridWidth(rows.map(r => r.label)),
|
|
43
|
+
},
|
|
44
|
+
...Object.keys(rest).map(val => ({
|
|
45
|
+
field: val,
|
|
46
|
+
renderCell: ({ value }) => (_jsx("div", { className: classes.cell, children: _jsx(SanitizedHTML, { html: getStr(value) }) })),
|
|
47
|
+
width: measureGridWidth(rows.map(r => `${r[val]}`)),
|
|
48
|
+
})),
|
|
49
|
+
], sortModel: [], onSortModelChange: args => {
|
|
50
|
+
const sort = args[0];
|
|
51
|
+
const idx = (currSort.idx + 1) % 2;
|
|
52
|
+
const field = sort.field || currSort.field;
|
|
53
|
+
setCurrSort({ idx, field });
|
|
54
|
+
onChange(field
|
|
55
|
+
? [...rows].sort((a, b) => {
|
|
56
|
+
const aa = getStr(a[field]);
|
|
57
|
+
const bb = getStr(b[field]);
|
|
58
|
+
return idx === 1 ? aa.localeCompare(bb) : bb.localeCompare(aa);
|
|
59
|
+
})
|
|
60
|
+
: rows);
|
|
61
|
+
} }) }));
|
|
62
|
+
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { Source } from '../util';
|
|
1
|
+
import type { Source } from '../types';
|
|
3
2
|
declare function SourcesGrid({ rows, onChange, showTips, }: {
|
|
4
3
|
rows: Source[];
|
|
5
4
|
onChange: (arg: Source[]) => void;
|
|
6
5
|
showTips: boolean;
|
|
7
|
-
}):
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export default SourcesGrid;
|
|
@@ -1,115 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|
|
6
|
-
import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';
|
|
7
|
-
import KeyboardDoubleArrowDownIcon from '@mui/icons-material/KeyboardDoubleArrowDown';
|
|
8
|
-
import KeyboardDoubleArrowUpIcon from '@mui/icons-material/KeyboardDoubleArrowUp';
|
|
9
|
-
import { Button } from '@mui/material';
|
|
10
|
-
import { DataGrid } from '@mui/x-data-grid';
|
|
11
|
-
import { makeStyles } from 'tss-react/mui';
|
|
12
|
-
import { moveDown, moveUp } from './util';
|
|
13
|
-
const useStyles = makeStyles()({
|
|
14
|
-
cell: {
|
|
15
|
-
whiteSpace: 'nowrap',
|
|
16
|
-
overflow: 'hidden',
|
|
17
|
-
textOverflow: 'ellipsis',
|
|
18
|
-
},
|
|
19
|
-
});
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import SourcesDataGrid from './SourcesDataGrid';
|
|
4
|
+
import SourcesGridHeader from './SourcesGridHeader';
|
|
20
5
|
function SourcesGrid({ rows, onChange, showTips, }) {
|
|
21
|
-
const { classes } = useStyles();
|
|
22
6
|
const [selected, setSelected] = useState([]);
|
|
23
|
-
|
|
24
|
-
const [currSort, setCurrSort] = useState({
|
|
25
|
-
idx: 0,
|
|
26
|
-
field: null,
|
|
27
|
-
});
|
|
28
|
-
return (React.createElement("div", null,
|
|
29
|
-
React.createElement(GridHeader, { selected: selected, rows: rows, showTips: showTips, onChange: onChange }),
|
|
30
|
-
React.createElement("div", { style: { height: 400, width: '100%' } },
|
|
31
|
-
React.createElement(DataGrid, { getRowId: row => row.name, checkboxSelection: true, disableRowSelectionOnClick: true, onRowSelectionModelChange: arg => {
|
|
32
|
-
setSelected(arg);
|
|
33
|
-
}, rows: rows, rowHeight: 25, columnHeaderHeight: 33, columns: [
|
|
34
|
-
{
|
|
35
|
-
field: 'color',
|
|
36
|
-
headerName: 'Color',
|
|
37
|
-
renderCell: params => {
|
|
38
|
-
const { value, id } = params;
|
|
39
|
-
return (React.createElement(ColorPicker, { color: value || 'blue', onChange: c => {
|
|
40
|
-
const elt = rows.find(f => f.name === id);
|
|
41
|
-
if (elt) {
|
|
42
|
-
elt.color = c;
|
|
43
|
-
}
|
|
44
|
-
onChange([...rows]);
|
|
45
|
-
} }));
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
field: 'name',
|
|
50
|
-
headerName: 'Name',
|
|
51
|
-
width: measureGridWidth(rows.map(r => r.name)),
|
|
52
|
-
},
|
|
53
|
-
...Object.keys(rest).map(val => ({
|
|
54
|
-
field: val,
|
|
55
|
-
renderCell: ({ value }) => (React.createElement("div", { className: classes.cell },
|
|
56
|
-
React.createElement(SanitizedHTML, { html: getStr(value) }))),
|
|
57
|
-
width: measureGridWidth(rows.map(r => `${r[val]}`)),
|
|
58
|
-
})),
|
|
59
|
-
], sortModel: [], onSortModelChange: args => {
|
|
60
|
-
const sort = args[0];
|
|
61
|
-
const idx = (currSort.idx + 1) % 2;
|
|
62
|
-
const field = sort.field || currSort.field;
|
|
63
|
-
setCurrSort({ idx, field });
|
|
64
|
-
onChange(field
|
|
65
|
-
? [...rows].sort((a, b) => {
|
|
66
|
-
const aa = getStr(a[field]);
|
|
67
|
-
const bb = getStr(b[field]);
|
|
68
|
-
return idx === 1
|
|
69
|
-
? aa.localeCompare(bb)
|
|
70
|
-
: bb.localeCompare(aa);
|
|
71
|
-
})
|
|
72
|
-
: rows);
|
|
73
|
-
} }))));
|
|
74
|
-
}
|
|
75
|
-
function GridHeader({ selected, onChange, rows, showTips, }) {
|
|
76
|
-
const [anchorEl, setAnchorEl] = useState(null);
|
|
77
|
-
const [widgetColor, setWidgetColor] = useState('blue');
|
|
78
|
-
return (React.createElement(React.Fragment, null,
|
|
79
|
-
React.createElement(Button, { disabled: !selected.length, onClick: event => {
|
|
80
|
-
setAnchorEl(event.currentTarget);
|
|
81
|
-
} }, "Change color of selected items"),
|
|
82
|
-
React.createElement(Button, { onClick: () => {
|
|
83
|
-
onChange(moveUp([...rows], selected));
|
|
84
|
-
}, disabled: !selected.length },
|
|
85
|
-
React.createElement(KeyboardArrowUpIcon, null),
|
|
86
|
-
showTips ? 'Move selected items up' : null),
|
|
87
|
-
React.createElement(Button, { onClick: () => {
|
|
88
|
-
onChange(moveDown([...rows], selected));
|
|
89
|
-
}, disabled: !selected.length },
|
|
90
|
-
React.createElement(KeyboardArrowDownIcon, null),
|
|
91
|
-
showTips ? 'Move selected items down' : null),
|
|
92
|
-
React.createElement(Button, { onClick: () => {
|
|
93
|
-
onChange(moveUp([...rows], selected, rows.length));
|
|
94
|
-
}, disabled: !selected.length },
|
|
95
|
-
React.createElement(KeyboardDoubleArrowUpIcon, null),
|
|
96
|
-
showTips ? 'Move selected items to top' : null),
|
|
97
|
-
React.createElement(Button, { onClick: () => {
|
|
98
|
-
onChange(moveDown([...rows], selected, rows.length));
|
|
99
|
-
}, disabled: !selected.length },
|
|
100
|
-
React.createElement(KeyboardDoubleArrowDownIcon, null),
|
|
101
|
-
showTips ? 'Move selected items to bottom' : null),
|
|
102
|
-
React.createElement(ColorPopover, { anchorEl: anchorEl, color: widgetColor, onChange: c => {
|
|
103
|
-
setWidgetColor(c);
|
|
104
|
-
selected.forEach(id => {
|
|
105
|
-
const elt = rows.find(f => f.name === id);
|
|
106
|
-
if (elt) {
|
|
107
|
-
elt.color = c;
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
onChange([...rows]);
|
|
111
|
-
}, onClose: () => {
|
|
112
|
-
setAnchorEl(null);
|
|
113
|
-
} })));
|
|
7
|
+
return (_jsxs("div", { children: [_jsx(SourcesGridHeader, { selected: selected, rows: rows, showTips: showTips, onChange: onChange }), _jsx(SourcesDataGrid, { rows: rows, onChange: onChange, setSelected: setSelected })] }));
|
|
114
8
|
}
|
|
115
9
|
export default SourcesGrid;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Source } from '../types';
|
|
2
|
+
export default function SourcesGridHeader({ selected, onChange, rows, showTips, }: {
|
|
3
|
+
onChange: (arg: Source[]) => void;
|
|
4
|
+
rows: Source[];
|
|
5
|
+
selected: string[];
|
|
6
|
+
showTips: boolean;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { ColorPopover } from '@jbrowse/core/ui/ColorPicker';
|
|
4
|
+
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|
|
5
|
+
import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';
|
|
6
|
+
import KeyboardDoubleArrowDownIcon from '@mui/icons-material/KeyboardDoubleArrowDown';
|
|
7
|
+
import KeyboardDoubleArrowUpIcon from '@mui/icons-material/KeyboardDoubleArrowUp';
|
|
8
|
+
import { Button } from '@mui/material';
|
|
9
|
+
import { moveDown, moveUp } from './util';
|
|
10
|
+
export default function SourcesGridHeader({ selected, onChange, rows, showTips, }) {
|
|
11
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
12
|
+
const [widgetColor, setWidgetColor] = useState('blue');
|
|
13
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, { disabled: !selected.length, onClick: event => {
|
|
14
|
+
setAnchorEl(event.currentTarget);
|
|
15
|
+
}, children: "Change color of selected items" }), _jsxs(Button, { onClick: () => {
|
|
16
|
+
onChange(moveUp([...rows], selected));
|
|
17
|
+
}, disabled: !selected.length, children: [_jsx(KeyboardArrowUpIcon, {}), showTips ? 'Move selected items up' : null] }), _jsxs(Button, { onClick: () => {
|
|
18
|
+
onChange(moveDown([...rows], selected));
|
|
19
|
+
}, disabled: !selected.length, children: [_jsx(KeyboardArrowDownIcon, {}), showTips ? 'Move selected items down' : null] }), _jsxs(Button, { onClick: () => {
|
|
20
|
+
onChange(moveUp([...rows], selected, rows.length));
|
|
21
|
+
}, disabled: !selected.length, children: [_jsx(KeyboardDoubleArrowUpIcon, {}), showTips ? 'Move selected items to top' : null] }), _jsxs(Button, { onClick: () => {
|
|
22
|
+
onChange(moveDown([...rows], selected, rows.length));
|
|
23
|
+
}, disabled: !selected.length, children: [_jsx(KeyboardDoubleArrowDownIcon, {}), showTips ? 'Move selected items to bottom' : null] }), _jsx(ColorPopover, { anchorEl: anchorEl, color: widgetColor, onChange: c => {
|
|
24
|
+
setWidgetColor(c);
|
|
25
|
+
selected.forEach(id => {
|
|
26
|
+
const elt = rows.find(f => f.name === id);
|
|
27
|
+
if (elt) {
|
|
28
|
+
elt.color = c;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
onChange([...rows]);
|
|
32
|
+
}, onClose: () => {
|
|
33
|
+
setAnchorEl(null);
|
|
34
|
+
} })] }));
|
|
35
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { set1 } from '@jbrowse/core/ui/colors';
|
|
2
|
+
import { colord } from '@jbrowse/core/util/colord';
|
|
3
|
+
import { colorify } from '../util';
|
|
4
|
+
export function getColorAlleleCount(alleles) {
|
|
5
|
+
const total = alleles.length;
|
|
6
|
+
let alt = 0;
|
|
7
|
+
let uncalled = 0;
|
|
8
|
+
let alt2 = 0;
|
|
9
|
+
let ref = 0;
|
|
10
|
+
for (const allele of alleles) {
|
|
11
|
+
if (allele === '1') {
|
|
12
|
+
alt++;
|
|
13
|
+
}
|
|
14
|
+
else if (allele === '0') {
|
|
15
|
+
ref++;
|
|
16
|
+
}
|
|
17
|
+
else if (allele === '.') {
|
|
18
|
+
uncalled++;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
alt2++;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (ref === total) {
|
|
25
|
+
return `#ccc`;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
let a1 = colord(`hsl(200,50%,${80 - (alt / total) * 50}%)`);
|
|
29
|
+
if (alt2) {
|
|
30
|
+
a1 = a1.mix(`hsla(0,100%,20%,${alt2 / total})`);
|
|
31
|
+
}
|
|
32
|
+
if (uncalled) {
|
|
33
|
+
a1 = a1.mix(`hsla(50,50%,50%,${uncalled / total / 2})`);
|
|
34
|
+
}
|
|
35
|
+
return a1.toHex();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export function getColorPhased(alleles, HP) {
|
|
39
|
+
const c = +alleles[HP];
|
|
40
|
+
return c ? set1[c - 1] || 'black' : '#ccc';
|
|
41
|
+
}
|
|
42
|
+
export function getColorPhasedWithPhaseSet(alleles, HP, PS) {
|
|
43
|
+
const c = +alleles[HP];
|
|
44
|
+
return c ? colorify(+PS) || 'black' : '#ccc';
|
|
45
|
+
}
|
package/esm/types.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface Source {
|
|
2
|
+
baseUri?: string;
|
|
3
|
+
name: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
color?: string;
|
|
6
|
+
group?: string;
|
|
7
|
+
HP?: number;
|
|
8
|
+
id?: string;
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
export interface SampleInfo {
|
|
12
|
+
isPhased: boolean;
|
|
13
|
+
maxPloidy: number;
|
|
14
|
+
}
|
package/esm/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|