@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,6 +1,4 @@
|
|
|
1
|
-
import type { Source } from '../util';
|
|
2
1
|
import type { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
|
|
3
|
-
import type { Feature } from '@jbrowse/core/util';
|
|
4
2
|
import type { ExportSvgDisplayOptions } from '@jbrowse/plugin-linear-genome-view';
|
|
5
3
|
import type { Instance } from 'mobx-state-tree';
|
|
6
4
|
export default function stateModelFactory(configSchema: AnyConfigurationSchemaType): import("mobx-state-tree").IModelType<{
|
|
@@ -23,7 +21,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
23
21
|
stopToken: string | undefined;
|
|
24
22
|
filled: boolean;
|
|
25
23
|
reactElement: React.ReactElement | undefined;
|
|
26
|
-
features: Map<string, Feature> | undefined;
|
|
24
|
+
features: Map<string, import("@jbrowse/core/util").Feature> | undefined;
|
|
27
25
|
layout: any;
|
|
28
26
|
status: string;
|
|
29
27
|
error: unknown;
|
|
@@ -38,7 +36,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
38
36
|
status?: string;
|
|
39
37
|
reactElement?: React.ReactElement;
|
|
40
38
|
};
|
|
41
|
-
}) => import("react").JSX.Element | undefined;
|
|
39
|
+
}) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
42
40
|
renderProps: any;
|
|
43
41
|
} & {
|
|
44
42
|
doReload(): void;
|
|
@@ -84,10 +82,16 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
84
82
|
configuration: AnyConfigurationSchemaType;
|
|
85
83
|
} & {
|
|
86
84
|
type: import("mobx-state-tree").ISimpleType<"LinearVariantMatrixDisplay">;
|
|
87
|
-
layout: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<Source[], Source[], Source[]>, [undefined]>;
|
|
85
|
+
layout: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<import("../types").Source[], import("../types").Source[], import("../types").Source[]>, [undefined]>;
|
|
88
86
|
configuration: AnyConfigurationSchemaType;
|
|
89
|
-
|
|
87
|
+
minorAlleleFrequencyFilter: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
90
88
|
showSidebarLabelsSetting: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
89
|
+
renderingMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
90
|
+
rowHeightSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
91
|
+
autoHeight: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
92
|
+
} & {
|
|
93
|
+
type: import("mobx-state-tree").ISimpleType<"LinearVariantMatrixDisplay">;
|
|
94
|
+
rowHeightSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
91
95
|
}, {
|
|
92
96
|
rendererTypeName: string;
|
|
93
97
|
error: unknown;
|
|
@@ -179,32 +183,32 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
179
183
|
} & {
|
|
180
184
|
readonly statsReadyAndRegionNotTooLarge: boolean;
|
|
181
185
|
regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
|
|
182
|
-
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react").JSX.Element | null;
|
|
186
|
+
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react/jsx-runtime").JSX.Element | null;
|
|
183
187
|
} & {
|
|
184
188
|
featureIdUnderMouse: undefined | string;
|
|
185
|
-
contextMenuFeature: undefined | Feature;
|
|
189
|
+
contextMenuFeature: undefined | import("@jbrowse/core/util").Feature;
|
|
186
190
|
} & {
|
|
187
|
-
readonly DisplayMessageComponent:
|
|
188
|
-
readonly blockType: "
|
|
191
|
+
readonly DisplayMessageComponent: undefined | React.FC<any>;
|
|
192
|
+
readonly blockType: "staticBlocks" | "dynamicBlocks";
|
|
189
193
|
readonly blockDefinitions: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
190
194
|
} & {
|
|
191
195
|
readonly renderDelay: number;
|
|
192
196
|
readonly TooltipComponent: import("@jbrowse/core/util").AnyReactComponentType;
|
|
193
197
|
readonly selectedFeatureId: string | undefined;
|
|
194
198
|
} & {
|
|
195
|
-
readonly features: import("@jbrowse/core/util/compositeMap").default<string, Feature>;
|
|
196
|
-
readonly featureUnderMouse: Feature | undefined;
|
|
199
|
+
readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util").Feature>;
|
|
200
|
+
readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
|
|
197
201
|
getFeatureOverlapping(blockKey: string, x: number, y: number): string | undefined;
|
|
198
202
|
getFeatureByID(blockKey: string, id: string): [number, number, number, number] | undefined;
|
|
199
203
|
searchFeatureByID(id: string): [number, number, number, number] | undefined;
|
|
200
204
|
} & {
|
|
201
205
|
addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
|
|
202
206
|
deleteBlock(key: string): void;
|
|
203
|
-
selectFeature(feature: Feature): void;
|
|
204
|
-
navToFeature(feature: Feature): void;
|
|
207
|
+
selectFeature(feature: import("@jbrowse/core/util").Feature): void;
|
|
208
|
+
navToFeature(feature: import("@jbrowse/core/util").Feature): void;
|
|
205
209
|
clearFeatureSelection(): void;
|
|
206
210
|
setFeatureIdUnderMouse(feature?: string): void;
|
|
207
|
-
setContextMenuFeature(feature?: Feature): void;
|
|
211
|
+
setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature): void;
|
|
208
212
|
} & {
|
|
209
213
|
reload(): Promise<void>;
|
|
210
214
|
} & {
|
|
@@ -212,7 +216,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
212
216
|
contextMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
213
217
|
renderProps(): any;
|
|
214
218
|
} & {
|
|
215
|
-
renderSvg(opts: ExportSvgDisplayOptions): Promise<import("react").JSX.Element>;
|
|
219
|
+
renderSvg(opts: ExportSvgDisplayOptions): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
216
220
|
afterAttach(): void;
|
|
217
221
|
} & {
|
|
218
222
|
readonly rendererConfig: {
|
|
@@ -231,35 +235,113 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
231
235
|
renderProps(): any;
|
|
232
236
|
} & {
|
|
233
237
|
sourcesLoadingStopToken: string | undefined;
|
|
234
|
-
featureUnderMouseVolatile: Feature | undefined;
|
|
235
|
-
sourcesVolatile: Source[] | undefined;
|
|
236
|
-
featuresVolatile: Feature[] | undefined;
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
238
|
+
featureUnderMouseVolatile: import("@jbrowse/core/util").Feature | undefined;
|
|
239
|
+
sourcesVolatile: import("../types").Source[] | undefined;
|
|
240
|
+
featuresVolatile: import("@jbrowse/core/util").Feature[] | undefined;
|
|
241
|
+
hasPhased: boolean;
|
|
242
|
+
sampleInfo: undefined | Record<string, import("../types").SampleInfo>;
|
|
243
|
+
hoveredGenotype: string | undefined;
|
|
244
|
+
} & {
|
|
245
|
+
setRowHeight(arg: number): void;
|
|
246
|
+
setHoveredGenotype(arg: string): void;
|
|
247
|
+
setFeatures(f: import("@jbrowse/core/util").Feature[]): void;
|
|
248
|
+
setLayout(layout: import("../types").Source[]): void;
|
|
241
249
|
clearLayout(): void;
|
|
242
250
|
setSourcesLoading(str: string): void;
|
|
243
|
-
setSources(sources: Source[]): void;
|
|
251
|
+
setSources(sources: import("../types").Source[]): void;
|
|
244
252
|
setMafFilter(arg: number): void;
|
|
245
253
|
setShowSidebarLabels(arg: boolean): void;
|
|
254
|
+
setPhasedMode(arg: string): void;
|
|
255
|
+
setAutoHeight(arg: boolean): void;
|
|
256
|
+
setHasPhased(arg: boolean): void;
|
|
257
|
+
setSampleInfo(arg: Record<string, import("../types").SampleInfo>): void;
|
|
246
258
|
} & {
|
|
247
|
-
readonly preSources: Source[] | undefined;
|
|
259
|
+
readonly preSources: import("../types").Source[] | undefined;
|
|
248
260
|
readonly sources: {
|
|
249
|
-
|
|
261
|
+
label: string;
|
|
262
|
+
id: string;
|
|
250
263
|
baseUri?: string;
|
|
251
264
|
name: string;
|
|
265
|
+
color?: string;
|
|
252
266
|
group?: string;
|
|
267
|
+
HP?: number;
|
|
253
268
|
}[] | undefined;
|
|
254
269
|
} & {
|
|
270
|
+
readonly rowHeight: number;
|
|
255
271
|
adapterProps(): any;
|
|
256
272
|
trackMenuItems(): (import("@jbrowse/core/ui").MenuDivider | import("@jbrowse/core/ui").MenuSubHeader | import("@jbrowse/core/ui").NormalMenuItem | import("@jbrowse/core/ui").CheckboxMenuItem | import("@jbrowse/core/ui").RadioMenuItem | import("@jbrowse/core/ui").SubMenuItem | {
|
|
257
273
|
label: string;
|
|
274
|
+
icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
275
|
+
muiName: string;
|
|
276
|
+
};
|
|
258
277
|
type: string;
|
|
259
278
|
checked: boolean;
|
|
260
279
|
onClick: () => void;
|
|
280
|
+
subMenu?: undefined;
|
|
281
|
+
} | {
|
|
282
|
+
label: string;
|
|
283
|
+
icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
284
|
+
muiName: string;
|
|
285
|
+
};
|
|
286
|
+
subMenu: ({
|
|
287
|
+
label: string;
|
|
288
|
+
disabled: boolean;
|
|
289
|
+
onClick: () => void;
|
|
290
|
+
type?: undefined;
|
|
291
|
+
checked?: undefined;
|
|
292
|
+
} | {
|
|
293
|
+
label: string;
|
|
294
|
+
type: string;
|
|
295
|
+
checked: boolean;
|
|
296
|
+
onClick: () => void;
|
|
297
|
+
disabled?: undefined;
|
|
298
|
+
})[];
|
|
299
|
+
type?: undefined;
|
|
300
|
+
checked?: undefined;
|
|
301
|
+
onClick?: undefined;
|
|
302
|
+
} | {
|
|
303
|
+
label: string;
|
|
304
|
+
icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
305
|
+
muiName: string;
|
|
306
|
+
};
|
|
307
|
+
subMenu: ({
|
|
308
|
+
label: string;
|
|
309
|
+
type: string;
|
|
310
|
+
checked: boolean;
|
|
311
|
+
onClick: () => void;
|
|
312
|
+
disabled?: undefined;
|
|
313
|
+
} | {
|
|
314
|
+
label: string;
|
|
315
|
+
disabled: boolean;
|
|
316
|
+
checked: boolean;
|
|
317
|
+
type: string;
|
|
318
|
+
onClick: () => void;
|
|
319
|
+
})[];
|
|
320
|
+
type?: undefined;
|
|
321
|
+
checked?: undefined;
|
|
322
|
+
onClick?: undefined;
|
|
323
|
+
} | {
|
|
324
|
+
label: string;
|
|
325
|
+
icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
326
|
+
muiName: string;
|
|
327
|
+
};
|
|
328
|
+
subMenu: {
|
|
329
|
+
label: string;
|
|
330
|
+
onClick: () => void;
|
|
331
|
+
}[];
|
|
332
|
+
type?: undefined;
|
|
333
|
+
checked?: undefined;
|
|
334
|
+
onClick?: undefined;
|
|
261
335
|
})[];
|
|
262
336
|
} & {
|
|
337
|
+
readonly canDisplayLabels: boolean;
|
|
338
|
+
readonly totalHeight: number;
|
|
339
|
+
} & {
|
|
340
|
+
renderProps(): any;
|
|
341
|
+
} & {
|
|
342
|
+
lineZoneHeight: number;
|
|
343
|
+
} & {
|
|
344
|
+
readonly nrow: number;
|
|
263
345
|
readonly blockType: string;
|
|
264
346
|
readonly totalHeight: number;
|
|
265
347
|
readonly rowHeight: number;
|
|
@@ -268,7 +350,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
268
350
|
readonly canDisplayLabels: boolean;
|
|
269
351
|
} & {
|
|
270
352
|
afterAttach(): void;
|
|
271
|
-
renderSvg(opts: ExportSvgDisplayOptions): Promise<import("react").JSX.Element>;
|
|
353
|
+
renderSvg(opts: ExportSvgDisplayOptions): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
272
354
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
273
355
|
export type MultiLinearVariantMatrixDisplayStateModel = ReturnType<typeof stateModelFactory>;
|
|
274
356
|
export type MultiLinearVariantMatrixDisplayModel = Instance<MultiLinearVariantMatrixDisplayStateModel>;
|
|
@@ -1,148 +1,32 @@
|
|
|
1
|
-
import { lazy } from 'react';
|
|
2
|
-
import { ConfigurationReference } from '@jbrowse/core/configuration';
|
|
3
|
-
import { set1 } from '@jbrowse/core/ui/colors';
|
|
4
1
|
import { getSession } from '@jbrowse/core/util';
|
|
5
|
-
import { stopStopToken } from '@jbrowse/core/util/stopToken';
|
|
6
|
-
import { linearBareDisplayStateModelFactory } from '@jbrowse/plugin-linear-genome-view';
|
|
7
|
-
import deepEqual from 'fast-deep-equal';
|
|
8
2
|
import { isAlive, types } from 'mobx-state-tree';
|
|
9
|
-
import
|
|
10
|
-
const SetColorDialog = lazy(() => import('../shared/SetColorDialog'));
|
|
11
|
-
const MAFFilterDialog = lazy(() => import('../shared/MAFFilterDialog'));
|
|
12
|
-
const ClusterDialog = lazy(() => import('../shared/ClusterDialog'));
|
|
3
|
+
import MultiVariantBaseModelF from '../shared/MultiVariantBaseModel';
|
|
13
4
|
export default function stateModelFactory(configSchema) {
|
|
14
5
|
return types
|
|
15
|
-
.compose('LinearVariantMatrixDisplay',
|
|
6
|
+
.compose('LinearVariantMatrixDisplay', MultiVariantBaseModelF(configSchema), types.model({
|
|
16
7
|
type: types.literal('LinearVariantMatrixDisplay'),
|
|
17
|
-
|
|
18
|
-
configuration: ConfigurationReference(configSchema),
|
|
19
|
-
mafFilter: types.optional(types.number, 0.1),
|
|
20
|
-
showSidebarLabelsSetting: true,
|
|
8
|
+
rowHeightSetting: types.optional(types.number, 1),
|
|
21
9
|
}))
|
|
22
10
|
.volatile(() => ({
|
|
23
|
-
sourcesLoadingStopToken: undefined,
|
|
24
|
-
featureUnderMouseVolatile: undefined,
|
|
25
|
-
sourcesVolatile: undefined,
|
|
26
|
-
featuresVolatile: undefined,
|
|
27
11
|
lineZoneHeight: 20,
|
|
28
|
-
}))
|
|
29
|
-
.actions(self => ({
|
|
30
|
-
setFeatures(f) {
|
|
31
|
-
self.featuresVolatile = f;
|
|
32
|
-
},
|
|
33
|
-
setLayout(layout) {
|
|
34
|
-
self.layout = layout;
|
|
35
|
-
},
|
|
36
|
-
clearLayout() {
|
|
37
|
-
self.layout = [];
|
|
38
|
-
},
|
|
39
|
-
setSourcesLoading(str) {
|
|
40
|
-
if (self.sourcesLoadingStopToken) {
|
|
41
|
-
stopStopToken(self.sourcesLoadingStopToken);
|
|
42
|
-
}
|
|
43
|
-
self.sourcesLoadingStopToken = str;
|
|
44
|
-
},
|
|
45
|
-
setSources(sources) {
|
|
46
|
-
if (!deepEqual(sources, self.sourcesVolatile)) {
|
|
47
|
-
self.sourcesVolatile = sources;
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
setMafFilter(arg) {
|
|
51
|
-
self.mafFilter = arg;
|
|
52
|
-
},
|
|
53
|
-
setShowSidebarLabels(arg) {
|
|
54
|
-
self.showSidebarLabelsSetting = arg;
|
|
55
|
-
},
|
|
56
12
|
}))
|
|
57
13
|
.views(self => ({
|
|
58
|
-
get
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
get sources() {
|
|
62
|
-
var _a, _b;
|
|
63
|
-
const sources = Object.fromEntries(((_a = self.sourcesVolatile) === null || _a === void 0 ? void 0 : _a.map(s => [s.name, s])) || []);
|
|
64
|
-
return (_b = this.preSources) === null || _b === void 0 ? void 0 : _b.map(s => ({
|
|
65
|
-
...sources[s.name],
|
|
66
|
-
...s,
|
|
67
|
-
})).map((s, i) => ({
|
|
68
|
-
...s,
|
|
69
|
-
color: s.color || set1[i] || randomColor(s.name),
|
|
70
|
-
}));
|
|
14
|
+
get nrow() {
|
|
15
|
+
var _a;
|
|
16
|
+
return ((_a = self.sources) === null || _a === void 0 ? void 0 : _a.length) || 1;
|
|
71
17
|
},
|
|
72
|
-
}))
|
|
73
|
-
.views(self => {
|
|
74
|
-
const { trackMenuItems: superTrackMenuItems, renderProps: superRenderProps, } = self;
|
|
75
|
-
return {
|
|
76
|
-
adapterProps() {
|
|
77
|
-
const superProps = superRenderProps();
|
|
78
|
-
return {
|
|
79
|
-
...superProps,
|
|
80
|
-
rpcDriverName: self.rpcDriverName,
|
|
81
|
-
displayModel: self,
|
|
82
|
-
config: self.rendererConfig,
|
|
83
|
-
};
|
|
84
|
-
},
|
|
85
|
-
trackMenuItems() {
|
|
86
|
-
return [
|
|
87
|
-
...superTrackMenuItems(),
|
|
88
|
-
{
|
|
89
|
-
label: 'Show sidebar labels',
|
|
90
|
-
type: 'checkbox',
|
|
91
|
-
checked: self.showSidebarLabelsSetting,
|
|
92
|
-
onClick: () => {
|
|
93
|
-
self.setShowSidebarLabels(!self.showSidebarLabelsSetting);
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
label: 'Minimum allele frequency',
|
|
98
|
-
onClick: () => {
|
|
99
|
-
getSession(self).queueDialog(handleClose => [
|
|
100
|
-
MAFFilterDialog,
|
|
101
|
-
{
|
|
102
|
-
model: self,
|
|
103
|
-
handleClose,
|
|
104
|
-
},
|
|
105
|
-
]);
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
label: 'Cluster by genotype',
|
|
110
|
-
onClick: () => {
|
|
111
|
-
getSession(self).queueDialog(handleClose => [
|
|
112
|
-
ClusterDialog,
|
|
113
|
-
{
|
|
114
|
-
model: self,
|
|
115
|
-
handleClose,
|
|
116
|
-
},
|
|
117
|
-
]);
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
label: 'Edit colors/arrangement...',
|
|
122
|
-
onClick: () => {
|
|
123
|
-
getSession(self).queueDialog(handleClose => [
|
|
124
|
-
SetColorDialog,
|
|
125
|
-
{
|
|
126
|
-
model: self,
|
|
127
|
-
handleClose,
|
|
128
|
-
},
|
|
129
|
-
]);
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
];
|
|
133
|
-
},
|
|
134
|
-
};
|
|
135
|
-
})
|
|
136
|
-
.views(self => ({
|
|
137
18
|
get blockType() {
|
|
138
19
|
return 'dynamicBlocks';
|
|
139
20
|
},
|
|
140
21
|
get totalHeight() {
|
|
141
|
-
return self.
|
|
22
|
+
return self.autoHeight
|
|
23
|
+
? self.height - self.lineZoneHeight
|
|
24
|
+
: this.nrow * self.rowHeightSetting;
|
|
142
25
|
},
|
|
143
26
|
get rowHeight() {
|
|
144
|
-
|
|
145
|
-
|
|
27
|
+
return self.autoHeight
|
|
28
|
+
? self.totalHeight / this.nrow
|
|
29
|
+
: self.rowHeightSetting;
|
|
146
30
|
},
|
|
147
31
|
}))
|
|
148
32
|
.views(self => ({
|
|
@@ -151,7 +35,8 @@ export default function stateModelFactory(configSchema) {
|
|
|
151
35
|
return {
|
|
152
36
|
...superProps,
|
|
153
37
|
notReady: superProps.notReady || !self.sources || !self.featuresVolatile,
|
|
154
|
-
|
|
38
|
+
renderingMode: self.renderingMode,
|
|
39
|
+
minorAlleleFrequencyFilter: self.minorAlleleFrequencyFilter,
|
|
155
40
|
height: self.totalHeight,
|
|
156
41
|
sources: self.sources,
|
|
157
42
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { MultiLinearVariantMatrixDisplayModel } from './model';
|
|
3
2
|
import type { ExportSvgDisplayOptions } from '@jbrowse/plugin-linear-genome-view';
|
|
4
|
-
export declare function renderSvg(model: MultiLinearVariantMatrixDisplayModel, opts: ExportSvgDisplayOptions, superRenderSvg: (opts: ExportSvgDisplayOptions) => Promise<React.ReactNode>): Promise<
|
|
3
|
+
export declare function renderSvg(model: MultiLinearVariantMatrixDisplayModel, opts: ExportSvgDisplayOptions, superRenderSvg: (opts: ExportSvgDisplayOptions) => Promise<React.ReactNode>): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { getContainingView } from '@jbrowse/core/util';
|
|
3
3
|
import { when } from 'mobx';
|
|
4
4
|
import LegendBar from '../shared/LegendBar';
|
|
@@ -6,10 +6,6 @@ import LinesConnectingMatrixToGenomicPosition from './components/LinesConnecting
|
|
|
6
6
|
export async function renderSvg(model, opts, superRenderSvg) {
|
|
7
7
|
await when(() => !!model.regionCannotBeRenderedText);
|
|
8
8
|
const { offsetPx } = getContainingView(model);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
React.createElement(LinesConnectingMatrixToGenomicPosition, { exportSVG: true, model: model }),
|
|
12
|
-
React.createElement("g", { transform: `translate(0,${model.lineZoneHeight})` },
|
|
13
|
-
React.createElement("g", null, await superRenderSvg(opts)),
|
|
14
|
-
React.createElement(LegendBar, { model: model, orientation: "left", exportSVG: true })))));
|
|
9
|
+
const { lineZoneHeight } = model;
|
|
10
|
+
return (_jsx(_Fragment, { children: _jsxs("g", { transform: `translate(${Math.max(-offsetPx, 0)})`, children: [_jsx(LinesConnectingMatrixToGenomicPosition, { exportSVG: true, model: model }), _jsxs("g", { transform: `translate(0,${lineZoneHeight})`, children: [_jsx("g", { children: await superRenderSvg(opts) }), _jsx(LegendBar, { model: model, orientation: "left", exportSVG: true })] })] }) }));
|
|
15
11
|
}
|
|
@@ -1,36 +1,8 @@
|
|
|
1
1
|
import BoxRendererType from '@jbrowse/core/pluggableElementTypes/renderers/BoxRendererType';
|
|
2
|
-
import type {
|
|
3
|
-
import type { RenderArgsDeserialized as BoxRenderArgsDeserialized } from '@jbrowse/core/pluggableElementTypes/renderers/BoxRendererType';
|
|
2
|
+
import type { RenderArgsDeserialized } from './types';
|
|
4
3
|
import type { Feature } from '@jbrowse/core/util';
|
|
5
|
-
export interface SortParams {
|
|
6
|
-
type: string;
|
|
7
|
-
pos: number;
|
|
8
|
-
refName: string;
|
|
9
|
-
assemblyName: string;
|
|
10
|
-
tag?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface RenderArgsDeserialized extends BoxRenderArgsDeserialized {
|
|
13
|
-
sources: {
|
|
14
|
-
name: string;
|
|
15
|
-
}[];
|
|
16
|
-
mafFilter: number;
|
|
17
|
-
highResolutionScaling: number;
|
|
18
|
-
height: number;
|
|
19
|
-
}
|
|
20
|
-
export interface RenderArgsDeserializedWithFeaturesAndLayout extends RenderArgsDeserialized {
|
|
21
|
-
sources: Source[];
|
|
22
|
-
features: Map<string, Feature>;
|
|
23
|
-
}
|
|
24
4
|
export default class LinearVariantMatrixRenderer extends BoxRendererType {
|
|
25
5
|
supportsSVG: boolean;
|
|
26
|
-
makeImageData({ ctx, canvasWidth, canvasHeight, renderArgs, }: {
|
|
27
|
-
ctx: CanvasRenderingContext2D;
|
|
28
|
-
canvasWidth: number;
|
|
29
|
-
canvasHeight: number;
|
|
30
|
-
renderArgs: RenderArgsDeserializedWithFeaturesAndLayout;
|
|
31
|
-
}): {
|
|
32
|
-
mafs: Feature[];
|
|
33
|
-
};
|
|
34
6
|
render(renderProps: RenderArgsDeserialized): Promise<{
|
|
35
7
|
features: Map<any, any>;
|
|
36
8
|
simplifiedFeatures: any;
|
|
@@ -38,14 +10,14 @@ export default class LinearVariantMatrixRenderer extends BoxRendererType {
|
|
|
38
10
|
width: number;
|
|
39
11
|
canvasRecordedData: any;
|
|
40
12
|
layout: import("@jbrowse/core/util/layouts").BaseLayout<Feature>;
|
|
41
|
-
reactElement?:
|
|
13
|
+
reactElement?: React.ReactElement;
|
|
42
14
|
html?: string;
|
|
43
15
|
} | {
|
|
44
16
|
features: Map<any, any>;
|
|
45
17
|
simplifiedFeatures: any;
|
|
46
18
|
height: number;
|
|
47
19
|
width: number;
|
|
48
|
-
reactElement:
|
|
20
|
+
reactElement: import("react/jsx-runtime").JSX.Element;
|
|
49
21
|
layout: import("@jbrowse/core/util/layouts").BaseLayout<Feature>;
|
|
50
22
|
html?: string;
|
|
51
23
|
} | {
|
|
@@ -55,7 +27,7 @@ export default class LinearVariantMatrixRenderer extends BoxRendererType {
|
|
|
55
27
|
width: number;
|
|
56
28
|
imageData: any;
|
|
57
29
|
layout: import("@jbrowse/core/util/layouts").BaseLayout<Feature>;
|
|
58
|
-
reactElement?:
|
|
30
|
+
reactElement?: React.ReactElement;
|
|
59
31
|
html?: string;
|
|
60
32
|
}>;
|
|
61
33
|
}
|
|
@@ -1,79 +1,27 @@
|
|
|
1
1
|
import BoxRendererType from '@jbrowse/core/pluggableElementTypes/renderers/BoxRendererType';
|
|
2
2
|
import { SimpleFeature, renderToAbstractCanvas } from '@jbrowse/core/util';
|
|
3
|
-
import { getCol } from '../util';
|
|
4
|
-
const fudgeFactor = 0.6;
|
|
5
|
-
const f2 = fudgeFactor / 2;
|
|
6
3
|
export default class LinearVariantMatrixRenderer extends BoxRendererType {
|
|
7
4
|
constructor() {
|
|
8
5
|
super(...arguments);
|
|
9
6
|
this.supportsSVG = true;
|
|
10
7
|
}
|
|
11
|
-
makeImageData({ ctx, canvasWidth, canvasHeight, renderArgs, }) {
|
|
12
|
-
const { mafFilter, sources, features } = renderArgs;
|
|
13
|
-
const feats = [...features.values()];
|
|
14
|
-
const h = canvasHeight / sources.length;
|
|
15
|
-
const mafs = [];
|
|
16
|
-
for (const feat of feats) {
|
|
17
|
-
let c = 0;
|
|
18
|
-
let c2 = 0;
|
|
19
|
-
const samp = feat.get('genotypes');
|
|
20
|
-
if (feat.get('end') - feat.get('start') <= 10) {
|
|
21
|
-
for (const { name } of sources) {
|
|
22
|
-
const s = samp[name];
|
|
23
|
-
if (s === '0|0' || s === './.') {
|
|
24
|
-
c2++;
|
|
25
|
-
}
|
|
26
|
-
else if (s === '1|0' || s === '0|1') {
|
|
27
|
-
c++;
|
|
28
|
-
}
|
|
29
|
-
else if (s === '1|1') {
|
|
30
|
-
c++;
|
|
31
|
-
c2++;
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
c++;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
if (c / sources.length > mafFilter &&
|
|
38
|
-
c2 / sources.length < 1 - mafFilter) {
|
|
39
|
-
mafs.push(feat);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
const w = canvasWidth / mafs.length;
|
|
44
|
-
for (let i = 0; i < mafs.length; i++) {
|
|
45
|
-
const f = mafs[i];
|
|
46
|
-
if (f.get('end') - f.get('start') <= 10) {
|
|
47
|
-
const samp = f.get('genotypes');
|
|
48
|
-
const x = (i / mafs.length) * canvasWidth;
|
|
49
|
-
for (let j = 0; j < sources.length; j++) {
|
|
50
|
-
const y = (j / sources.length) * canvasHeight;
|
|
51
|
-
const { name } = sources[j];
|
|
52
|
-
ctx.fillStyle = getCol(samp[name]);
|
|
53
|
-
ctx.fillRect(x - f2, y - f2, w + f2, h + f2);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return { mafs };
|
|
58
|
-
}
|
|
59
8
|
async render(renderProps) {
|
|
60
9
|
const features = await this.getFeatures(renderProps);
|
|
61
10
|
const { height, sources, regions, bpPerPx } = renderProps;
|
|
62
11
|
const region = regions[0];
|
|
63
12
|
const { end, start } = region;
|
|
64
13
|
const width = (end - start) / bpPerPx;
|
|
65
|
-
const {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
});
|
|
14
|
+
const { makeImageData } = await import('./makeImageData');
|
|
15
|
+
const { mafs, ...res } = await renderToAbstractCanvas(width, height, renderProps, ctx => makeImageData({
|
|
16
|
+
ctx,
|
|
17
|
+
canvasWidth: width,
|
|
18
|
+
canvasHeight: height,
|
|
19
|
+
renderArgs: {
|
|
20
|
+
...renderProps,
|
|
21
|
+
features,
|
|
22
|
+
sources,
|
|
23
|
+
},
|
|
24
|
+
}));
|
|
77
25
|
const results = await super.render({
|
|
78
26
|
...renderProps,
|
|
79
27
|
...res,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
declare const LinearVariantMatrixRendering: (props: {
|
|
3
2
|
width: number;
|
|
4
3
|
height: number;
|
|
5
|
-
|
|
4
|
+
displayModel: any;
|
|
5
|
+
arr: string[];
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
export default LinearVariantMatrixRendering;
|
|
@@ -1,7 +1,36 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
2
3
|
import { PrerenderedCanvas } from '@jbrowse/core/ui';
|
|
3
4
|
import { observer } from 'mobx-react';
|
|
4
5
|
const LinearVariantMatrixRendering = observer(function (props) {
|
|
5
|
-
|
|
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 }) }));
|
|
6
35
|
});
|
|
7
36
|
export default LinearVariantMatrixRendering;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PrerenderedCanvas } from '@jbrowse/core/ui';
|
|
2
1
|
import LinearVariantMatrixRenderer from './LinearVariantMatrixRenderer';
|
|
2
|
+
import PrerenderedCanvas from './components/LinearVariantMatrixRendering';
|
|
3
3
|
import configSchema from './configSchema';
|
|
4
4
|
export default function LinearVariantMatrixRendererF(pluginManager) {
|
|
5
5
|
pluginManager.addRendererType(() => {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RenderArgsDeserializedWithFeaturesAndLayout } from './types';
|
|
2
|
+
export declare function makeImageData({ ctx, canvasWidth, canvasHeight, renderArgs, }: {
|
|
3
|
+
ctx: CanvasRenderingContext2D;
|
|
4
|
+
canvasWidth: number;
|
|
5
|
+
canvasHeight: number;
|
|
6
|
+
renderArgs: RenderArgsDeserializedWithFeaturesAndLayout;
|
|
7
|
+
}): {
|
|
8
|
+
mafs: import("@jbrowse/core/util").Feature[];
|
|
9
|
+
arr: string[][];
|
|
10
|
+
};
|