@jbrowse/plugin-variants 3.2.0 → 3.3.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/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +3 -3
- package/dist/MultiLinearVariantDisplay/index.js +1 -1
- package/dist/MultiLinearVariantDisplay/model.d.ts +39 -3
- package/dist/MultiLinearVariantDisplay/model.js +0 -1
- package/dist/MultiLinearVariantDisplay/renderSvg.js +2 -2
- package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +15 -5
- package/dist/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +3 -3
- package/dist/MultiLinearVariantMatrixDisplay/index.js +1 -1
- package/dist/MultiLinearVariantMatrixDisplay/model.d.ts +39 -2
- package/dist/MultiLinearVariantMatrixDisplay/model.js +1 -0
- package/dist/MultiLinearVariantMatrixDisplay/renderSvg.js +2 -2
- package/dist/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.d.ts → MultiLinearVariantMatrixRenderer.d.ts} +7 -3
- package/dist/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.d.ts +8 -0
- package/dist/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.js +41 -0
- package/dist/MultiLinearVariantMatrixRenderer/index.js +4 -4
- package/dist/MultiLinearVariantMatrixRenderer/makeImageData.d.ts +2 -2
- package/dist/MultiLinearVariantMatrixRenderer/makeImageData.js +12 -13
- package/dist/MultiLinearVariantMatrixRenderer/types.d.ts +2 -4
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +30 -1
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.js +11 -5
- package/dist/MultiLinearVariantRenderer/components/{MultiVariantRendering.d.ts → MultiLinearVariantRendering.d.ts} +10 -4
- package/dist/MultiLinearVariantRenderer/{MultiVariantRendering.js → components/MultiLinearVariantRendering.js} +25 -7
- package/dist/MultiLinearVariantRenderer/components/util.d.ts +1 -0
- package/dist/MultiLinearVariantRenderer/components/util.js +15 -0
- package/dist/MultiLinearVariantRenderer/index.js +2 -2
- package/dist/MultiLinearVariantRenderer/makeImageData.d.ts +9 -0
- package/dist/MultiLinearVariantRenderer/makeImageData.js +60 -28
- package/dist/MultiLinearVariantRenderer/types.d.ts +1 -0
- package/dist/SplitVcfTabixAdapter/configSchema.js +4 -2
- package/dist/VariantFeatureWidget/AltFormatter.d.ts +4 -0
- package/dist/VariantFeatureWidget/AltFormatter.js +13 -0
- package/dist/VariantFeatureWidget/Checkbox2.js +1 -8
- package/dist/VariantFeatureWidget/Formatter.d.ts +3 -0
- package/dist/VariantFeatureWidget/Formatter.js +23 -0
- package/dist/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.js → VariantConsequence/VariantConsequenceDataGridWrapper.js} +3 -5
- package/dist/VariantFeatureWidget/VariantFeatureWidget.js +7 -2
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.d.ts +4 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.js +80 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.d.ts +3 -9
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.js +41 -20
- package/dist/VariantFeatureWidget/VariantSampleGrid/types.d.ts +21 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid/util.d.ts +1 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid/util.js +14 -0
- package/dist/VariantRPC/MultiVariantClusterGenotypeMatrix.d.ts +2 -16
- package/dist/VariantRPC/MultiVariantClusterGenotypeMatrix.js +4 -7
- package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +2 -15
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +3 -13
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.js +14 -8
- package/dist/VariantRPC/getGenotypeMatrix.js +10 -5
- package/dist/VariantRPC/types.d.ts +23 -0
- package/dist/VcfFeature/index.js +0 -1
- package/dist/VcfFeature/util.d.ts +2 -0
- package/dist/VcfFeature/util.js +123 -25
- package/dist/VcfTabixAdapter/VcfTabixAdapter.js +12 -7
- package/dist/getMultiVariantFeaturesAutorun.d.ts +2 -0
- package/dist/getMultiVariantFeaturesAutorun.js +9 -2
- package/dist/getMultiVariantSourcesAutorun.js +3 -2
- package/dist/shared/MultiVariantBaseModel.d.ts +40 -3
- package/dist/shared/MultiVariantBaseModel.js +69 -3
- package/dist/shared/components/AddFiltersDialog.d.ts +9 -0
- package/dist/shared/components/AddFiltersDialog.js +61 -0
- package/dist/shared/components/MultiVariantBaseDisplayComponent.d.ts +5 -0
- package/dist/shared/components/MultiVariantBaseDisplayComponent.js +29 -0
- package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialog.js +2 -2
- package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.js +8 -3
- package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.js +29 -28
- package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/types.d.ts +1 -0
- package/dist/shared/components/MultiVariantClusterDialog/types.js +2 -0
- package/{esm/shared/components/ColorLegend.d.ts → dist/shared/components/MultiVariantColorLegend.d.ts} +2 -2
- package/dist/shared/components/{ColorLegend.js → MultiVariantColorLegend.js} +5 -3
- package/dist/shared/components/MultiVariantCrosshairs.d.ts +7 -0
- package/dist/shared/components/MultiVariantCrosshairs.js +40 -0
- package/dist/shared/components/MultiVariantLegendBar.d.ts +7 -0
- package/dist/shared/components/{LegendBar.js → MultiVariantLegendBar.js} +2 -2
- package/dist/shared/components/MultiVariantTooltip.d.ts +4 -0
- package/dist/shared/components/MultiVariantTooltip.js +3 -2
- package/dist/shared/components/RectBg.js +4 -2
- package/dist/shared/components/SetColorDialog.js +1 -1
- package/dist/shared/components/SourcesDataGrid.d.ts +2 -1
- package/dist/shared/components/SourcesDataGrid.js +40 -47
- package/dist/shared/components/SourcesGrid.js +1 -1
- package/dist/shared/components/SourcesGridHeader.d.ts +2 -1
- package/dist/shared/drawAlleleCount.d.ts +1 -1
- package/dist/shared/drawAlleleCount.js +29 -5
- package/dist/shared/drawPhased.d.ts +1 -1
- package/dist/shared/drawPhased.js +14 -10
- package/dist/shared/minorAlleleFrequencyUtils.d.ts +6 -1
- package/dist/shared/minorAlleleFrequencyUtils.js +4 -5
- package/dist/shared/sourcesGridUtils.d.ts +3 -2
- package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +2 -2
- package/esm/MultiLinearVariantDisplay/index.js +1 -1
- package/esm/MultiLinearVariantDisplay/model.d.ts +39 -3
- package/esm/MultiLinearVariantDisplay/model.js +0 -1
- package/esm/MultiLinearVariantDisplay/renderSvg.js +1 -1
- package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +15 -8
- package/esm/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +2 -2
- package/esm/MultiLinearVariantMatrixDisplay/index.js +1 -1
- package/esm/MultiLinearVariantMatrixDisplay/model.d.ts +39 -2
- package/esm/MultiLinearVariantMatrixDisplay/model.js +1 -0
- package/esm/MultiLinearVariantMatrixDisplay/renderSvg.js +1 -1
- package/esm/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.d.ts → MultiLinearVariantMatrixRenderer.d.ts} +7 -3
- package/esm/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.d.ts +8 -0
- package/esm/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.js +39 -0
- package/esm/MultiLinearVariantMatrixRenderer/index.js +4 -4
- package/esm/MultiLinearVariantMatrixRenderer/makeImageData.d.ts +2 -2
- package/esm/MultiLinearVariantMatrixRenderer/makeImageData.js +13 -14
- package/esm/MultiLinearVariantMatrixRenderer/types.d.ts +2 -4
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +30 -1
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.js +11 -5
- package/esm/MultiLinearVariantRenderer/components/{MultiVariantRendering.d.ts → MultiLinearVariantRendering.d.ts} +10 -4
- package/esm/MultiLinearVariantRenderer/components/{MultiVariantRendering.js → MultiLinearVariantRendering.js} +25 -7
- package/esm/MultiLinearVariantRenderer/components/util.d.ts +1 -0
- package/esm/MultiLinearVariantRenderer/components/util.js +12 -0
- package/esm/MultiLinearVariantRenderer/index.js +1 -1
- package/esm/MultiLinearVariantRenderer/makeImageData.d.ts +9 -0
- package/esm/MultiLinearVariantRenderer/makeImageData.js +61 -29
- package/esm/MultiLinearVariantRenderer/types.d.ts +1 -0
- package/esm/SplitVcfTabixAdapter/configSchema.js +4 -2
- package/esm/VariantFeatureWidget/AltFormatter.d.ts +4 -0
- package/esm/VariantFeatureWidget/AltFormatter.js +10 -0
- package/esm/VariantFeatureWidget/Checkbox2.js +2 -9
- package/esm/VariantFeatureWidget/Formatter.d.ts +3 -0
- package/esm/VariantFeatureWidget/Formatter.js +17 -0
- package/esm/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.js → VariantConsequence/VariantConsequenceDataGridWrapper.js} +4 -6
- package/esm/VariantFeatureWidget/VariantFeatureWidget.js +7 -2
- package/esm/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.d.ts +4 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.js +74 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.d.ts +3 -9
- package/esm/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.js +43 -22
- package/esm/VariantFeatureWidget/VariantSampleGrid/types.d.ts +21 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid/util.d.ts +1 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid/util.js +11 -0
- package/esm/VariantRPC/MultiVariantClusterGenotypeMatrix.d.ts +2 -16
- package/esm/VariantRPC/MultiVariantClusterGenotypeMatrix.js +4 -7
- package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +2 -15
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +3 -13
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.js +14 -8
- package/esm/VariantRPC/getGenotypeMatrix.js +10 -5
- package/esm/VariantRPC/types.d.ts +23 -0
- package/esm/VcfFeature/index.js +0 -1
- package/esm/VcfFeature/util.d.ts +2 -0
- package/esm/VcfFeature/util.js +121 -25
- package/esm/VcfTabixAdapter/VcfTabixAdapter.js +13 -8
- package/esm/getMultiVariantFeaturesAutorun.d.ts +2 -0
- package/esm/getMultiVariantFeaturesAutorun.js +9 -2
- package/esm/getMultiVariantSourcesAutorun.js +3 -2
- package/esm/shared/MultiVariantBaseModel.d.ts +40 -3
- package/esm/shared/MultiVariantBaseModel.js +71 -5
- package/esm/shared/components/AddFiltersDialog.d.ts +9 -0
- package/esm/shared/components/AddFiltersDialog.js +59 -0
- package/esm/shared/components/MultiVariantBaseDisplayComponent.d.ts +5 -0
- package/esm/shared/components/MultiVariantBaseDisplayComponent.js +24 -0
- package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialog.js +2 -2
- package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.js +9 -4
- package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.js +29 -28
- package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/types.d.ts +1 -0
- package/esm/shared/components/MultiVariantClusterDialog/types.js +1 -0
- package/{dist/shared/components/ColorLegend.d.ts → esm/shared/components/MultiVariantColorLegend.d.ts} +2 -2
- package/esm/shared/components/{ColorLegend.js → MultiVariantColorLegend.js} +6 -4
- package/esm/shared/components/MultiVariantCrosshairs.d.ts +7 -0
- package/esm/shared/components/MultiVariantCrosshairs.js +35 -0
- package/esm/shared/components/MultiVariantLegendBar.d.ts +7 -0
- package/esm/shared/components/{LegendBar.js → MultiVariantLegendBar.js} +1 -1
- package/esm/shared/components/MultiVariantTooltip.d.ts +4 -0
- package/esm/shared/components/MultiVariantTooltip.js +3 -2
- package/esm/shared/components/RectBg.js +4 -2
- package/esm/shared/components/SetColorDialog.js +1 -1
- package/esm/shared/components/SourcesDataGrid.d.ts +2 -1
- package/esm/shared/components/SourcesDataGrid.js +40 -47
- package/esm/shared/components/SourcesGrid.js +1 -1
- package/esm/shared/components/SourcesGridHeader.d.ts +2 -1
- package/esm/shared/drawAlleleCount.d.ts +1 -1
- package/esm/shared/drawAlleleCount.js +29 -5
- package/esm/shared/drawPhased.d.ts +1 -1
- package/esm/shared/drawPhased.js +14 -10
- package/esm/shared/minorAlleleFrequencyUtils.d.ts +6 -1
- package/esm/shared/minorAlleleFrequencyUtils.js +5 -6
- package/esm/shared/sourcesGridUtils.d.ts +3 -2
- package/package.json +10 -9
- package/dist/MultiLinearVariantDisplay/components/Crosshair.d.ts +0 -7
- package/dist/MultiLinearVariantDisplay/components/Crosshair.js +0 -35
- package/dist/MultiLinearVariantMatrixDisplay/components/Crosshair.d.ts +0 -7
- package/dist/MultiLinearVariantMatrixDisplay/components/Crosshair.js +0 -28
- package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +0 -7
- package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +0 -38
- package/dist/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +0 -22
- package/dist/MultiLinearVariantRenderer/components/MultiVariantRendering.js +0 -52
- package/dist/VariantFeatureWidget/VariantConsequencePanel.d.ts +0 -5
- package/dist/VariantFeatureWidget/VariantConsequencePanel.js +0 -15
- package/dist/VariantRPC/cluster.d.ts +0 -17
- package/dist/VariantRPC/cluster.js +0 -84
- package/dist/shared/components/LegendBar.d.ts +0 -18
- package/esm/MultiLinearVariantDisplay/components/Crosshair.d.ts +0 -7
- package/esm/MultiLinearVariantDisplay/components/Crosshair.js +0 -30
- package/esm/MultiLinearVariantMatrixDisplay/components/Crosshair.d.ts +0 -7
- package/esm/MultiLinearVariantMatrixDisplay/components/Crosshair.js +0 -23
- package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +0 -7
- package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +0 -36
- package/esm/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +0 -22
- package/esm/MultiLinearVariantRenderer/MultiVariantRendering.js +0 -47
- package/esm/VariantFeatureWidget/VariantConsequencePanel.d.ts +0 -5
- package/esm/VariantFeatureWidget/VariantConsequencePanel.js +0 -9
- package/esm/VariantRPC/cluster.d.ts +0 -17
- package/esm/VariantRPC/cluster.js +0 -79
- package/esm/shared/components/LegendBar.d.ts +0 -18
- /package/dist/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.js → MultiLinearVariantMatrixRenderer.js} +0 -0
- /package/dist/VariantFeatureWidget/{VariantConsequenceDataGrid.d.ts → VariantConsequence/VariantConsequenceDataGrid.d.ts} +0 -0
- /package/dist/VariantFeatureWidget/{VariantConsequenceDataGrid.js → VariantConsequence/VariantConsequenceDataGrid.js} +0 -0
- /package/dist/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.d.ts → VariantConsequence/VariantConsequenceDataGridWrapper.d.ts} +0 -0
- /package/dist/{shared/components/ClusterDialog → VariantFeatureWidget/VariantSampleGrid}/types.js +0 -0
- /package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialog.d.ts +0 -0
- /package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.d.ts +0 -0
- /package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.d.ts +0 -0
- /package/esm/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.js → MultiLinearVariantMatrixRenderer.js} +0 -0
- /package/esm/VariantFeatureWidget/{VariantConsequenceDataGrid.d.ts → VariantConsequence/VariantConsequenceDataGrid.d.ts} +0 -0
- /package/esm/VariantFeatureWidget/{VariantConsequenceDataGrid.js → VariantConsequence/VariantConsequenceDataGrid.js} +0 -0
- /package/esm/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.d.ts → VariantConsequence/VariantConsequenceDataGridWrapper.d.ts} +0 -0
- /package/esm/{shared/components/ClusterDialog → VariantFeatureWidget/VariantSampleGrid}/types.js +0 -0
- /package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialog.d.ts +0 -0
- /package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.d.ts +0 -0
- /package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.d.ts +0 -0
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import RBush from 'rbush';
|
|
2
|
-
import type { Source } from '../shared/types';
|
|
3
|
-
import type { Feature } from '@jbrowse/core/util';
|
|
4
|
-
import type { Region } from '@jbrowse/core/util/types';
|
|
5
|
-
declare const MultiVariantRendering: (props: {
|
|
6
|
-
regions: Region[];
|
|
7
|
-
features: Map<string, Feature>;
|
|
8
|
-
bpPerPx: number;
|
|
9
|
-
width: number;
|
|
10
|
-
height: number;
|
|
11
|
-
sources: Source[];
|
|
12
|
-
scrollTop: number;
|
|
13
|
-
totalHeight: number;
|
|
14
|
-
rbush: RBush<{
|
|
15
|
-
genotype: string;
|
|
16
|
-
}>;
|
|
17
|
-
displayModel: any;
|
|
18
|
-
onMouseLeave?: (event: React.MouseEvent) => void;
|
|
19
|
-
onMouseMove?: (event: React.MouseEvent, arg?: Feature) => void;
|
|
20
|
-
onFeatureClick?: (event: React.MouseEvent, arg?: Feature) => void;
|
|
21
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export default MultiVariantRendering;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const ui_1 = require("@jbrowse/core/ui");
|
|
9
|
-
const mobx_react_1 = require("mobx-react");
|
|
10
|
-
const rbush_1 = __importDefault(require("rbush"));
|
|
11
|
-
const MultiVariantRendering = (0, mobx_react_1.observer)(function (props) {
|
|
12
|
-
const { totalHeight, scrollTop } = props;
|
|
13
|
-
const { rbush, displayModel } = props;
|
|
14
|
-
const ref = (0, react_1.useRef)(null);
|
|
15
|
-
const rbush2 = (0, react_1.useMemo)(() => new rbush_1.default().fromJSON(rbush), [rbush]);
|
|
16
|
-
function getFeatureUnderMouse(eventClientX, eventClientY) {
|
|
17
|
-
var _a;
|
|
18
|
-
let offsetX = 0;
|
|
19
|
-
let offsetY = 0;
|
|
20
|
-
if (ref.current) {
|
|
21
|
-
const r = ref.current.getBoundingClientRect();
|
|
22
|
-
offsetX = eventClientX - r.left;
|
|
23
|
-
offsetY = eventClientY - r.top;
|
|
24
|
-
}
|
|
25
|
-
const ret = rbush2.search({
|
|
26
|
-
minX: offsetX,
|
|
27
|
-
maxX: offsetX + 3,
|
|
28
|
-
minY: offsetY,
|
|
29
|
-
maxY: offsetY + 3,
|
|
30
|
-
});
|
|
31
|
-
return (_a = ret[0]) === null || _a === void 0 ? void 0 : _a.genotype;
|
|
32
|
-
}
|
|
33
|
-
return ((0, jsx_runtime_1.jsx)("div", { ref: ref, onMouseMove: e => {
|
|
34
|
-
var _a;
|
|
35
|
-
return (_a = displayModel.setHoveredGenotype) === null || _a === void 0 ? void 0 : _a.call(displayModel, getFeatureUnderMouse(e.clientX, e.clientY));
|
|
36
|
-
}, onMouseLeave: () => {
|
|
37
|
-
var _a;
|
|
38
|
-
(_a = displayModel.setHoveredGenotype) === null || _a === void 0 ? void 0 : _a.call(displayModel, undefined);
|
|
39
|
-
}, onMouseOut: () => {
|
|
40
|
-
var _a;
|
|
41
|
-
(_a = displayModel.setHoveredGenotype) === null || _a === void 0 ? void 0 : _a.call(displayModel, undefined);
|
|
42
|
-
}, style: {
|
|
43
|
-
overflow: 'visible',
|
|
44
|
-
position: 'relative',
|
|
45
|
-
height: totalHeight,
|
|
46
|
-
}, children: (0, jsx_runtime_1.jsx)(ui_1.PrerenderedCanvas, { ...props, style: {
|
|
47
|
-
position: 'absolute',
|
|
48
|
-
left: 0,
|
|
49
|
-
top: scrollTop,
|
|
50
|
-
} }) }));
|
|
51
|
-
});
|
|
52
|
-
exports.default = MultiVariantRendering;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = VariantConsequencePanel;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const BaseCard_1 = __importDefault(require("@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard"));
|
|
9
|
-
const VariantConsequenceDataGridWrapper_1 = __importDefault(require("./VariantConsequenceDataGridWrapper"));
|
|
10
|
-
function VariantConsequencePanel({ data, fields, title, }) {
|
|
11
|
-
return data.length ? ((0, jsx_runtime_1.jsx)(BaseCard_1.default, { title: title, children: (0, jsx_runtime_1.jsx)(VariantConsequenceDataGridWrapper_1.default, { rows: data.map((elt, id) => ({
|
|
12
|
-
id,
|
|
13
|
-
...Object.fromEntries(elt.split('|').map((e, i) => [fields[i], e])),
|
|
14
|
-
})), columns: fields.map(c => ({ field: c })) }) })) : null;
|
|
15
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare function euclideanDistance(a: number[], b: number[]): number;
|
|
2
|
-
export declare function averageDistance(setA: number[], setB: number[], distances: number[][]): number;
|
|
3
|
-
export declare function clusterData({ data, distance, linkage, onProgress, stopToken, }: {
|
|
4
|
-
data: number[][];
|
|
5
|
-
distance?: (a: number[], b: number[]) => number;
|
|
6
|
-
linkage?: (a: number[], b: number[], distances: number[][]) => number;
|
|
7
|
-
onProgress?: (a: number) => void;
|
|
8
|
-
stopToken?: string;
|
|
9
|
-
}): {
|
|
10
|
-
clusters: {
|
|
11
|
-
height: number;
|
|
12
|
-
indexes: number[];
|
|
13
|
-
} | undefined;
|
|
14
|
-
distances: number[][];
|
|
15
|
-
order: number[];
|
|
16
|
-
clustersGivenK: number[][][];
|
|
17
|
-
};
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.euclideanDistance = euclideanDistance;
|
|
4
|
-
exports.averageDistance = averageDistance;
|
|
5
|
-
exports.clusterData = clusterData;
|
|
6
|
-
const stopToken_1 = require("@jbrowse/core/util/stopToken");
|
|
7
|
-
function euclideanDistance(a, b) {
|
|
8
|
-
const size = Math.min(a.length, b.length);
|
|
9
|
-
let sum = 0;
|
|
10
|
-
for (let index = 0; index < size; index++) {
|
|
11
|
-
sum += (a[index] - b[index]) * (a[index] - b[index]);
|
|
12
|
-
}
|
|
13
|
-
return Math.sqrt(sum);
|
|
14
|
-
}
|
|
15
|
-
function averageDistance(setA, setB, distances) {
|
|
16
|
-
let distance = 0;
|
|
17
|
-
for (const a of setA) {
|
|
18
|
-
for (const b of setB) {
|
|
19
|
-
distance += distances[a][b];
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return distance / setA.length / setB.length;
|
|
23
|
-
}
|
|
24
|
-
function updateProgress(stepNumber, stepProgress, onProgress) {
|
|
25
|
-
onProgress(stepNumber / 2 + stepProgress / 2);
|
|
26
|
-
}
|
|
27
|
-
function clusterData({ data, distance = euclideanDistance, linkage = averageDistance, onProgress, stopToken, }) {
|
|
28
|
-
const distances = data.map((datum, index) => {
|
|
29
|
-
if (onProgress) {
|
|
30
|
-
updateProgress(0, index / (data.length - 1), onProgress);
|
|
31
|
-
}
|
|
32
|
-
return data.map(otherDatum => distance(datum, otherDatum));
|
|
33
|
-
});
|
|
34
|
-
const clusters = data.map((_datum, index) => ({
|
|
35
|
-
height: 0,
|
|
36
|
-
indexes: [Number(index)],
|
|
37
|
-
}));
|
|
38
|
-
let clustersGivenK = [];
|
|
39
|
-
let start = performance.now();
|
|
40
|
-
for (let iteration = 0; iteration < data.length; iteration++) {
|
|
41
|
-
if (performance.now() - start > 2000) {
|
|
42
|
-
(0, stopToken_1.checkStopToken)(stopToken);
|
|
43
|
-
start = performance.now();
|
|
44
|
-
}
|
|
45
|
-
if (onProgress) {
|
|
46
|
-
updateProgress(1, (iteration + 1) / data.length, onProgress);
|
|
47
|
-
}
|
|
48
|
-
clustersGivenK.push(clusters.map(cluster => cluster.indexes));
|
|
49
|
-
if (iteration >= data.length - 1) {
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
let nearestDistance = Infinity;
|
|
53
|
-
let nearestRow = 0;
|
|
54
|
-
let nearestCol = 0;
|
|
55
|
-
for (let row = 0; row < clusters.length; row++) {
|
|
56
|
-
for (let col = row + 1; col < clusters.length; col++) {
|
|
57
|
-
const distance = linkage(clusters[row].indexes, clusters[col].indexes, distances);
|
|
58
|
-
if (distance < nearestDistance) {
|
|
59
|
-
nearestDistance = distance;
|
|
60
|
-
nearestRow = row;
|
|
61
|
-
nearestCol = col;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
const newCluster = {
|
|
66
|
-
indexes: [
|
|
67
|
-
...clusters[nearestRow].indexes,
|
|
68
|
-
...clusters[nearestCol].indexes,
|
|
69
|
-
],
|
|
70
|
-
height: nearestDistance,
|
|
71
|
-
children: [clusters[nearestRow], clusters[nearestCol]],
|
|
72
|
-
};
|
|
73
|
-
clusters.splice(Math.max(nearestRow, nearestCol), 1);
|
|
74
|
-
clusters.splice(Math.min(nearestRow, nearestCol), 1);
|
|
75
|
-
clusters.push(newCluster);
|
|
76
|
-
}
|
|
77
|
-
clustersGivenK = [[], ...clustersGivenK.reverse()];
|
|
78
|
-
return {
|
|
79
|
-
clusters: clusters[0],
|
|
80
|
-
distances: distances,
|
|
81
|
-
order: clusters[0].indexes,
|
|
82
|
-
clustersGivenK: clustersGivenK,
|
|
83
|
-
};
|
|
84
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Source } from '../types';
|
|
2
|
-
interface ReducedModel {
|
|
3
|
-
scrollTop: number;
|
|
4
|
-
totalHeight: number;
|
|
5
|
-
rowHeight: number;
|
|
6
|
-
lineZoneHeight?: number;
|
|
7
|
-
sources?: Source[];
|
|
8
|
-
canDisplayLabels: boolean;
|
|
9
|
-
height: number;
|
|
10
|
-
samplePloidy?: Record<string, number>;
|
|
11
|
-
id: string;
|
|
12
|
-
}
|
|
13
|
-
export declare const LegendBar: (props: {
|
|
14
|
-
model: ReducedModel;
|
|
15
|
-
orientation?: string;
|
|
16
|
-
exportSVG?: boolean;
|
|
17
|
-
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
-
export default LegendBar;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { MultiLinearVariantDisplayModel } from '../model';
|
|
2
|
-
declare const Crosshair: ({ mouseX, mouseY, model, }: {
|
|
3
|
-
mouseX: number;
|
|
4
|
-
mouseY: number;
|
|
5
|
-
model: MultiLinearVariantDisplayModel;
|
|
6
|
-
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
-
export default Crosshair;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { getContainingView } from '@jbrowse/core/util';
|
|
3
|
-
import { observer } from 'mobx-react';
|
|
4
|
-
import { makeStyles } from 'tss-react/mui';
|
|
5
|
-
import MultiVariantTooltip from '../../shared/components/MultiVariantTooltip';
|
|
6
|
-
const useStyles = makeStyles()({
|
|
7
|
-
rel: {
|
|
8
|
-
position: 'relative',
|
|
9
|
-
},
|
|
10
|
-
cursor: {
|
|
11
|
-
pointerEvents: 'none',
|
|
12
|
-
zIndex: 800,
|
|
13
|
-
position: 'absolute',
|
|
14
|
-
},
|
|
15
|
-
color: {
|
|
16
|
-
width: 10,
|
|
17
|
-
height: 10,
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
const Crosshair = observer(function ({ mouseX, mouseY, model, }) {
|
|
21
|
-
const { classes } = useStyles();
|
|
22
|
-
const { hoveredGenotype, height, scrollTop, rowHeight, sources } = model;
|
|
23
|
-
const { width } = getContainingView(model);
|
|
24
|
-
const source = sources === null || sources === void 0 ? void 0 : sources[Math.floor(mouseY / rowHeight)];
|
|
25
|
-
const y = mouseY - scrollTop;
|
|
26
|
-
return source ? (_jsxs("div", { className: classes.rel, children: [_jsxs("svg", { className: classes.cursor, width: width, height: height, style: {
|
|
27
|
-
top: scrollTop,
|
|
28
|
-
}, children: [_jsx("line", { x1: 0, x2: width, y1: y, y2: y, stroke: "black" }), _jsx("line", { x1: mouseX, x2: mouseX, y1: 0, y2: height, stroke: "black" })] }), _jsx(MultiVariantTooltip, { source: { ...source, hoveredGenotype } })] })) : null;
|
|
29
|
-
});
|
|
30
|
-
export default Crosshair;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { MultiLinearVariantMatrixDisplayModel } from '../model';
|
|
2
|
-
declare const Crosshair: ({ mouseX, mouseY, model, }: {
|
|
3
|
-
mouseX: number;
|
|
4
|
-
mouseY: number;
|
|
5
|
-
model: MultiLinearVariantMatrixDisplayModel;
|
|
6
|
-
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
-
export default Crosshair;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { getContainingView } from '@jbrowse/core/util';
|
|
3
|
-
import { observer } from 'mobx-react';
|
|
4
|
-
import { makeStyles } from 'tss-react/mui';
|
|
5
|
-
import MultiVariantTooltip from '../../shared/components/MultiVariantTooltip';
|
|
6
|
-
const useStyles = makeStyles()({
|
|
7
|
-
cursor: {
|
|
8
|
-
pointerEvents: 'none',
|
|
9
|
-
zIndex: 800,
|
|
10
|
-
position: 'relative',
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
const Crosshair = observer(function ({ mouseX, mouseY, model, }) {
|
|
14
|
-
const { classes } = useStyles();
|
|
15
|
-
const { hoveredGenotype, lineZoneHeight, totalHeight, rowHeight, sources } = model;
|
|
16
|
-
const { width } = getContainingView(model);
|
|
17
|
-
const source = sources === null || sources === void 0 ? void 0 : sources[Math.floor((mouseY - lineZoneHeight) / rowHeight)];
|
|
18
|
-
const yoff = mouseY - lineZoneHeight;
|
|
19
|
-
return source ? (_jsxs(_Fragment, { children: [_jsxs("svg", { className: classes.cursor, width: width, height: totalHeight, style: {
|
|
20
|
-
top: lineZoneHeight,
|
|
21
|
-
}, children: [_jsx("line", { x1: 0, x2: width, y1: yoff, y2: yoff, stroke: "black" }), _jsx("line", { x1: mouseX, x2: mouseX, y1: 0, y2: totalHeight, stroke: "black" })] }), _jsx(MultiVariantTooltip, { source: { ...source, hoveredGenotype } })] })) : null;
|
|
22
|
-
});
|
|
23
|
-
export default Crosshair;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useRef } from 'react';
|
|
3
|
-
import { PrerenderedCanvas } from '@jbrowse/core/ui';
|
|
4
|
-
import { observer } from 'mobx-react';
|
|
5
|
-
const LinearVariantMatrixRendering = observer(function (props) {
|
|
6
|
-
const { arr, width, height, displayModel } = props;
|
|
7
|
-
const ref = useRef(null);
|
|
8
|
-
function getFeatureUnderMouse(eventClientX, eventClientY) {
|
|
9
|
-
var _a, _b;
|
|
10
|
-
let offsetX = 0;
|
|
11
|
-
let offsetY = 0;
|
|
12
|
-
if (ref.current) {
|
|
13
|
-
const r = ref.current.getBoundingClientRect();
|
|
14
|
-
offsetX = eventClientX - r.left;
|
|
15
|
-
offsetY = eventClientY - r.top;
|
|
16
|
-
}
|
|
17
|
-
const dimY = arr.length;
|
|
18
|
-
const dimX = ((_a = arr[0]) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
19
|
-
return (_b = arr[Math.floor((offsetX / width) * dimY)]) === null || _b === void 0 ? void 0 : _b[Math.floor((offsetY / height) * dimX)];
|
|
20
|
-
}
|
|
21
|
-
return (_jsx("div", { ref: ref, onMouseMove: e => {
|
|
22
|
-
var _a;
|
|
23
|
-
return (_a = displayModel.setHoveredGenotype) === null || _a === void 0 ? void 0 : _a.call(displayModel, getFeatureUnderMouse(e.clientX, e.clientY));
|
|
24
|
-
}, onMouseLeave: () => {
|
|
25
|
-
var _a;
|
|
26
|
-
(_a = displayModel.setHoveredGenotype) === null || _a === void 0 ? void 0 : _a.call(displayModel, undefined);
|
|
27
|
-
}, onMouseOut: () => {
|
|
28
|
-
var _a;
|
|
29
|
-
(_a = displayModel.setHoveredGenotype) === null || _a === void 0 ? void 0 : _a.call(displayModel, undefined);
|
|
30
|
-
}, style: {
|
|
31
|
-
overflow: 'visible',
|
|
32
|
-
position: 'relative',
|
|
33
|
-
height,
|
|
34
|
-
}, children: _jsx(PrerenderedCanvas, { ...props }) }));
|
|
35
|
-
});
|
|
36
|
-
export default LinearVariantMatrixRendering;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import RBush from 'rbush';
|
|
2
|
-
import type { Source } from '../shared/types';
|
|
3
|
-
import type { Feature } from '@jbrowse/core/util';
|
|
4
|
-
import type { Region } from '@jbrowse/core/util/types';
|
|
5
|
-
declare const MultiVariantRendering: (props: {
|
|
6
|
-
regions: Region[];
|
|
7
|
-
features: Map<string, Feature>;
|
|
8
|
-
bpPerPx: number;
|
|
9
|
-
width: number;
|
|
10
|
-
height: number;
|
|
11
|
-
sources: Source[];
|
|
12
|
-
scrollTop: number;
|
|
13
|
-
totalHeight: number;
|
|
14
|
-
rbush: RBush<{
|
|
15
|
-
genotype: string;
|
|
16
|
-
}>;
|
|
17
|
-
displayModel: any;
|
|
18
|
-
onMouseLeave?: (event: React.MouseEvent) => void;
|
|
19
|
-
onMouseMove?: (event: React.MouseEvent, arg?: Feature) => void;
|
|
20
|
-
onFeatureClick?: (event: React.MouseEvent, arg?: Feature) => void;
|
|
21
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export default MultiVariantRendering;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo, useRef } from 'react';
|
|
3
|
-
import { PrerenderedCanvas } from '@jbrowse/core/ui';
|
|
4
|
-
import { observer } from 'mobx-react';
|
|
5
|
-
import RBush from 'rbush';
|
|
6
|
-
const MultiVariantRendering = observer(function (props) {
|
|
7
|
-
const { totalHeight, scrollTop } = props;
|
|
8
|
-
const { rbush, displayModel } = props;
|
|
9
|
-
const ref = useRef(null);
|
|
10
|
-
const rbush2 = useMemo(() => new RBush().fromJSON(rbush), [rbush]);
|
|
11
|
-
function getFeatureUnderMouse(eventClientX, eventClientY) {
|
|
12
|
-
var _a;
|
|
13
|
-
let offsetX = 0;
|
|
14
|
-
let offsetY = 0;
|
|
15
|
-
if (ref.current) {
|
|
16
|
-
const r = ref.current.getBoundingClientRect();
|
|
17
|
-
offsetX = eventClientX - r.left;
|
|
18
|
-
offsetY = eventClientY - r.top;
|
|
19
|
-
}
|
|
20
|
-
const ret = rbush2.search({
|
|
21
|
-
minX: offsetX,
|
|
22
|
-
maxX: offsetX + 3,
|
|
23
|
-
minY: offsetY,
|
|
24
|
-
maxY: offsetY + 3,
|
|
25
|
-
});
|
|
26
|
-
return (_a = ret[0]) === null || _a === void 0 ? void 0 : _a.genotype;
|
|
27
|
-
}
|
|
28
|
-
return (_jsx("div", { ref: ref, onMouseMove: e => {
|
|
29
|
-
var _a;
|
|
30
|
-
return (_a = displayModel.setHoveredGenotype) === null || _a === void 0 ? void 0 : _a.call(displayModel, getFeatureUnderMouse(e.clientX, e.clientY));
|
|
31
|
-
}, onMouseLeave: () => {
|
|
32
|
-
var _a;
|
|
33
|
-
(_a = displayModel.setHoveredGenotype) === null || _a === void 0 ? void 0 : _a.call(displayModel, undefined);
|
|
34
|
-
}, onMouseOut: () => {
|
|
35
|
-
var _a;
|
|
36
|
-
(_a = displayModel.setHoveredGenotype) === null || _a === void 0 ? void 0 : _a.call(displayModel, undefined);
|
|
37
|
-
}, style: {
|
|
38
|
-
overflow: 'visible',
|
|
39
|
-
position: 'relative',
|
|
40
|
-
height: totalHeight,
|
|
41
|
-
}, children: _jsx(PrerenderedCanvas, { ...props, style: {
|
|
42
|
-
position: 'absolute',
|
|
43
|
-
left: 0,
|
|
44
|
-
top: scrollTop,
|
|
45
|
-
} }) }));
|
|
46
|
-
});
|
|
47
|
-
export default MultiVariantRendering;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import BaseCard from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard';
|
|
3
|
-
import VariantConsequenceDataGridWrapper from './VariantConsequenceDataGridWrapper';
|
|
4
|
-
export default function VariantConsequencePanel({ data, fields, title, }) {
|
|
5
|
-
return data.length ? (_jsx(BaseCard, { title: title, children: _jsx(VariantConsequenceDataGridWrapper, { rows: data.map((elt, id) => ({
|
|
6
|
-
id,
|
|
7
|
-
...Object.fromEntries(elt.split('|').map((e, i) => [fields[i], e])),
|
|
8
|
-
})), columns: fields.map(c => ({ field: c })) }) })) : null;
|
|
9
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare function euclideanDistance(a: number[], b: number[]): number;
|
|
2
|
-
export declare function averageDistance(setA: number[], setB: number[], distances: number[][]): number;
|
|
3
|
-
export declare function clusterData({ data, distance, linkage, onProgress, stopToken, }: {
|
|
4
|
-
data: number[][];
|
|
5
|
-
distance?: (a: number[], b: number[]) => number;
|
|
6
|
-
linkage?: (a: number[], b: number[], distances: number[][]) => number;
|
|
7
|
-
onProgress?: (a: number) => void;
|
|
8
|
-
stopToken?: string;
|
|
9
|
-
}): {
|
|
10
|
-
clusters: {
|
|
11
|
-
height: number;
|
|
12
|
-
indexes: number[];
|
|
13
|
-
} | undefined;
|
|
14
|
-
distances: number[][];
|
|
15
|
-
order: number[];
|
|
16
|
-
clustersGivenK: number[][][];
|
|
17
|
-
};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { checkStopToken } from '@jbrowse/core/util/stopToken';
|
|
2
|
-
export function euclideanDistance(a, b) {
|
|
3
|
-
const size = Math.min(a.length, b.length);
|
|
4
|
-
let sum = 0;
|
|
5
|
-
for (let index = 0; index < size; index++) {
|
|
6
|
-
sum += (a[index] - b[index]) * (a[index] - b[index]);
|
|
7
|
-
}
|
|
8
|
-
return Math.sqrt(sum);
|
|
9
|
-
}
|
|
10
|
-
export function averageDistance(setA, setB, distances) {
|
|
11
|
-
let distance = 0;
|
|
12
|
-
for (const a of setA) {
|
|
13
|
-
for (const b of setB) {
|
|
14
|
-
distance += distances[a][b];
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return distance / setA.length / setB.length;
|
|
18
|
-
}
|
|
19
|
-
function updateProgress(stepNumber, stepProgress, onProgress) {
|
|
20
|
-
onProgress(stepNumber / 2 + stepProgress / 2);
|
|
21
|
-
}
|
|
22
|
-
export function clusterData({ data, distance = euclideanDistance, linkage = averageDistance, onProgress, stopToken, }) {
|
|
23
|
-
const distances = data.map((datum, index) => {
|
|
24
|
-
if (onProgress) {
|
|
25
|
-
updateProgress(0, index / (data.length - 1), onProgress);
|
|
26
|
-
}
|
|
27
|
-
return data.map(otherDatum => distance(datum, otherDatum));
|
|
28
|
-
});
|
|
29
|
-
const clusters = data.map((_datum, index) => ({
|
|
30
|
-
height: 0,
|
|
31
|
-
indexes: [Number(index)],
|
|
32
|
-
}));
|
|
33
|
-
let clustersGivenK = [];
|
|
34
|
-
let start = performance.now();
|
|
35
|
-
for (let iteration = 0; iteration < data.length; iteration++) {
|
|
36
|
-
if (performance.now() - start > 2000) {
|
|
37
|
-
checkStopToken(stopToken);
|
|
38
|
-
start = performance.now();
|
|
39
|
-
}
|
|
40
|
-
if (onProgress) {
|
|
41
|
-
updateProgress(1, (iteration + 1) / data.length, onProgress);
|
|
42
|
-
}
|
|
43
|
-
clustersGivenK.push(clusters.map(cluster => cluster.indexes));
|
|
44
|
-
if (iteration >= data.length - 1) {
|
|
45
|
-
break;
|
|
46
|
-
}
|
|
47
|
-
let nearestDistance = Infinity;
|
|
48
|
-
let nearestRow = 0;
|
|
49
|
-
let nearestCol = 0;
|
|
50
|
-
for (let row = 0; row < clusters.length; row++) {
|
|
51
|
-
for (let col = row + 1; col < clusters.length; col++) {
|
|
52
|
-
const distance = linkage(clusters[row].indexes, clusters[col].indexes, distances);
|
|
53
|
-
if (distance < nearestDistance) {
|
|
54
|
-
nearestDistance = distance;
|
|
55
|
-
nearestRow = row;
|
|
56
|
-
nearestCol = col;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
const newCluster = {
|
|
61
|
-
indexes: [
|
|
62
|
-
...clusters[nearestRow].indexes,
|
|
63
|
-
...clusters[nearestCol].indexes,
|
|
64
|
-
],
|
|
65
|
-
height: nearestDistance,
|
|
66
|
-
children: [clusters[nearestRow], clusters[nearestCol]],
|
|
67
|
-
};
|
|
68
|
-
clusters.splice(Math.max(nearestRow, nearestCol), 1);
|
|
69
|
-
clusters.splice(Math.min(nearestRow, nearestCol), 1);
|
|
70
|
-
clusters.push(newCluster);
|
|
71
|
-
}
|
|
72
|
-
clustersGivenK = [[], ...clustersGivenK.reverse()];
|
|
73
|
-
return {
|
|
74
|
-
clusters: clusters[0],
|
|
75
|
-
distances: distances,
|
|
76
|
-
order: clusters[0].indexes,
|
|
77
|
-
clustersGivenK: clustersGivenK,
|
|
78
|
-
};
|
|
79
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Source } from '../types';
|
|
2
|
-
interface ReducedModel {
|
|
3
|
-
scrollTop: number;
|
|
4
|
-
totalHeight: number;
|
|
5
|
-
rowHeight: number;
|
|
6
|
-
lineZoneHeight?: number;
|
|
7
|
-
sources?: Source[];
|
|
8
|
-
canDisplayLabels: boolean;
|
|
9
|
-
height: number;
|
|
10
|
-
samplePloidy?: Record<string, number>;
|
|
11
|
-
id: string;
|
|
12
|
-
}
|
|
13
|
-
export declare const LegendBar: (props: {
|
|
14
|
-
model: ReducedModel;
|
|
15
|
-
orientation?: string;
|
|
16
|
-
exportSVG?: boolean;
|
|
17
|
-
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
-
export default LegendBar;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{shared/components/ClusterDialog → VariantFeatureWidget/VariantSampleGrid}/types.js
RENAMED
|
File without changes
|
/package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialog.d.ts
RENAMED
|
File without changes
|
/package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.d.ts
RENAMED
|
File without changes
|
/package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/esm/{shared/components/ClusterDialog → VariantFeatureWidget/VariantSampleGrid}/types.js
RENAMED
|
File without changes
|
/package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialog.d.ts
RENAMED
|
File without changes
|
/package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.d.ts
RENAMED
|
File without changes
|
/package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.d.ts
RENAMED
|
File without changes
|