@jbrowse/plugin-linear-genome-view 1.7.11 → 2.1.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/BaseLinearDisplay/components/BaseLinearDisplay.js +119 -139
- package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -0
- package/dist/BaseLinearDisplay/components/Block.js +53 -74
- package/dist/BaseLinearDisplay/components/Block.js.map +1 -0
- package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +11 -1
- package/dist/BaseLinearDisplay/components/LinearBlocks.js +64 -103
- package/dist/BaseLinearDisplay/components/LinearBlocks.js.map +1 -0
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +146 -175
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -0
- package/dist/BaseLinearDisplay/components/Tooltip.js +109 -116
- package/dist/BaseLinearDisplay/components/Tooltip.js.map +1 -0
- package/dist/BaseLinearDisplay/index.js +13 -40
- package/dist/BaseLinearDisplay/index.js.map +1 -0
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +19 -14
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +605 -684
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -0
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +15 -22
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -0
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +7 -8
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +266 -312
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -0
- package/dist/LinearBareDisplay/configSchema.js +11 -17
- package/dist/LinearBareDisplay/configSchema.js.map +1 -0
- package/dist/LinearBareDisplay/index.js +7 -20
- package/dist/LinearBareDisplay/index.js.map +1 -0
- package/dist/LinearBareDisplay/model.d.ts +15 -13
- package/dist/LinearBareDisplay/model.js +36 -42
- package/dist/LinearBareDisplay/model.js.map +1 -0
- package/dist/LinearBasicDisplay/components/SetMaxHeight.d.ts +1 -1
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js +76 -85
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -0
- package/dist/LinearBasicDisplay/configSchema.js +15 -23
- package/dist/LinearBasicDisplay/configSchema.js.map +1 -0
- package/dist/LinearBasicDisplay/index.js +10 -22
- package/dist/LinearBasicDisplay/index.js.map +1 -0
- package/dist/LinearBasicDisplay/model.d.ts +20 -14
- package/dist/LinearBasicDisplay/model.js +180 -159
- package/dist/LinearBasicDisplay/model.js.map +1 -0
- package/dist/LinearGenomeView/components/CenterLine.d.ts +2 -8
- package/dist/LinearGenomeView/components/CenterLine.js +60 -74
- package/dist/LinearGenomeView/components/CenterLine.js.map +1 -0
- package/dist/LinearGenomeView/components/ExportSvgDialog.js +141 -141
- package/dist/LinearGenomeView/components/ExportSvgDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/Gridlines.d.ts +8 -0
- package/dist/LinearGenomeView/components/Gridlines.js +78 -0
- package/dist/LinearGenomeView/components/Gridlines.js.map +1 -0
- package/dist/LinearGenomeView/components/Header.d.ts +1 -0
- package/dist/LinearGenomeView/components/Header.js +70 -125
- package/dist/LinearGenomeView/components/Header.js.map +1 -0
- package/dist/LinearGenomeView/components/HelpDialog.d.ts +0 -1
- package/dist/LinearGenomeView/components/HelpDialog.js +62 -44
- package/dist/LinearGenomeView/components/HelpDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/ImportForm.d.ts +1 -0
- package/dist/LinearGenomeView/components/ImportForm.js +222 -289
- package/dist/LinearGenomeView/components/ImportForm.js.map +1 -0
- package/dist/LinearGenomeView/components/LinearGenomeView.js +60 -124
- package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -0
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +198 -337
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -0
- package/dist/LinearGenomeView/components/MiniControls.js +64 -78
- package/dist/LinearGenomeView/components/MiniControls.js.map +1 -0
- package/dist/LinearGenomeView/components/OverviewRubberBand.js +229 -293
- package/dist/LinearGenomeView/components/OverviewRubberBand.js.map +1 -0
- package/dist/LinearGenomeView/components/OverviewScaleBar.d.ts +3 -3
- package/dist/LinearGenomeView/components/OverviewScaleBar.js +275 -370
- package/dist/LinearGenomeView/components/OverviewScaleBar.js.map +1 -0
- package/dist/LinearGenomeView/components/RefNameAutocomplete.d.ts +1 -1
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js +237 -324
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -0
- package/dist/LinearGenomeView/components/RubberBand.js +228 -296
- package/dist/LinearGenomeView/components/RubberBand.js.map +1 -0
- package/dist/LinearGenomeView/components/Ruler.js +45 -90
- package/dist/LinearGenomeView/components/Ruler.js.map +1 -0
- package/dist/LinearGenomeView/components/ScaleBar.d.ts +8 -403
- package/dist/LinearGenomeView/components/ScaleBar.js +121 -172
- package/dist/LinearGenomeView/components/ScaleBar.js.map +1 -0
- package/dist/LinearGenomeView/components/SearchBox.js +155 -166
- package/dist/LinearGenomeView/components/SearchBox.js.map +1 -0
- package/dist/LinearGenomeView/components/SearchResultsDialog.d.ts +0 -1
- package/dist/LinearGenomeView/components/SearchResultsDialog.js +105 -149
- package/dist/LinearGenomeView/components/SearchResultsDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/SequenceDialog.js +219 -272
- package/dist/LinearGenomeView/components/SequenceDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/TrackContainer.d.ts +2 -1
- package/dist/LinearGenomeView/components/TrackContainer.js +113 -158
- package/dist/LinearGenomeView/components/TrackContainer.js.map +1 -0
- package/dist/LinearGenomeView/components/TrackLabel.d.ts +6 -42
- package/dist/LinearGenomeView/components/TrackLabel.js +113 -133
- package/dist/LinearGenomeView/components/TrackLabel.js.map +1 -0
- package/dist/LinearGenomeView/components/TracksContainer.d.ts +1 -1
- package/dist/LinearGenomeView/components/TracksContainer.js +172 -199
- package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -0
- package/dist/LinearGenomeView/components/ZoomControls.js +72 -87
- package/dist/LinearGenomeView/components/ZoomControls.js.map +1 -0
- package/dist/LinearGenomeView/components/util.js +94 -71
- package/dist/LinearGenomeView/components/util.js.map +1 -0
- package/dist/LinearGenomeView/index.d.ts +64 -77
- package/dist/LinearGenomeView/index.js +1035 -1412
- package/dist/LinearGenomeView/index.js.map +1 -0
- package/dist/LinearGenomeView/util.js +76 -83
- package/dist/LinearGenomeView/util.js.map +1 -0
- package/dist/index.d.ts +98 -48
- package/dist/index.js +225 -295
- package/dist/index.js.map +1 -0
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +9 -0
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +68 -0
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -0
- package/esm/BaseLinearDisplay/components/Block.d.ts +15 -0
- package/esm/BaseLinearDisplay/components/Block.js +46 -0
- package/esm/BaseLinearDisplay/components/Block.js.map +1 -0
- package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +22 -0
- package/esm/BaseLinearDisplay/components/LinearBlocks.js +62 -0
- package/esm/BaseLinearDisplay/components/LinearBlocks.js.map +1 -0
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +4 -0
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +114 -0
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -0
- package/esm/BaseLinearDisplay/components/Tooltip.d.ts +8 -0
- package/esm/BaseLinearDisplay/components/Tooltip.js +64 -0
- package/esm/BaseLinearDisplay/components/Tooltip.js.map +1 -0
- package/esm/BaseLinearDisplay/index.d.ts +5 -0
- package/esm/BaseLinearDisplay/index.js +4 -0
- package/esm/BaseLinearDisplay/index.js.map +1 -0
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +232 -0
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +541 -0
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -0
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.d.ts +1 -0
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +14 -0
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -0
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +96 -0
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +225 -0
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -0
- package/esm/LinearBareDisplay/configSchema.d.ts +2 -0
- package/esm/LinearBareDisplay/configSchema.js +9 -0
- package/esm/LinearBareDisplay/configSchema.js.map +1 -0
- package/esm/LinearBareDisplay/index.d.ts +2 -0
- package/esm/LinearBareDisplay/index.js +3 -0
- package/esm/LinearBareDisplay/index.js.map +1 -0
- package/esm/LinearBareDisplay/model.d.ts +194 -0
- package/esm/LinearBareDisplay/model.js +28 -0
- package/esm/LinearBareDisplay/model.js.map +1 -0
- package/esm/LinearBasicDisplay/components/SetMaxHeight.d.ts +10 -0
- package/esm/LinearBasicDisplay/components/SetMaxHeight.js +40 -0
- package/esm/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -0
- package/esm/LinearBasicDisplay/configSchema.d.ts +2 -0
- package/esm/LinearBasicDisplay/configSchema.js +14 -0
- package/esm/LinearBasicDisplay/configSchema.js.map +1 -0
- package/esm/LinearBasicDisplay/index.d.ts +2 -0
- package/esm/LinearBasicDisplay/index.js +3 -0
- package/esm/LinearBasicDisplay/index.js.map +1 -0
- package/esm/LinearBasicDisplay/model.d.ts +218 -0
- package/esm/LinearBasicDisplay/model.js +127 -0
- package/esm/LinearBasicDisplay/model.js.map +1 -0
- package/esm/LinearGenomeView/components/CenterLine.d.ts +8 -0
- package/esm/LinearGenomeView/components/CenterLine.js +40 -0
- package/esm/LinearGenomeView/components/CenterLine.js.map +1 -0
- package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +6 -0
- package/esm/LinearGenomeView/components/ExportSvgDialog.js +52 -0
- package/esm/LinearGenomeView/components/ExportSvgDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/Gridlines.d.ts +8 -0
- package/esm/LinearGenomeView/components/Gridlines.js +71 -0
- package/esm/LinearGenomeView/components/Gridlines.js.map +1 -0
- package/esm/LinearGenomeView/components/Header.d.ts +7 -0
- package/esm/LinearGenomeView/components/Header.js +81 -0
- package/esm/LinearGenomeView/components/Header.js.map +1 -0
- package/esm/LinearGenomeView/components/HelpDialog.d.ts +4 -0
- package/esm/LinearGenomeView/components/HelpDialog.js +58 -0
- package/esm/LinearGenomeView/components/HelpDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/ImportForm.d.ts +7 -0
- package/esm/LinearGenomeView/components/ImportForm.js +141 -0
- package/esm/LinearGenomeView/components/ImportForm.js.map +1 -0
- package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +7 -0
- package/esm/LinearGenomeView/components/LinearGenomeView.js +63 -0
- package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -0
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.d.ts +4 -0
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js +132 -0
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -0
- package/esm/LinearGenomeView/components/MiniControls.d.ts +6 -0
- package/esm/LinearGenomeView/components/MiniControls.js +25 -0
- package/esm/LinearGenomeView/components/MiniControls.js.map +1 -0
- package/esm/LinearGenomeView/components/OverviewRubberBand.d.ts +22 -0
- package/esm/LinearGenomeView/components/OverviewRubberBand.js +197 -0
- package/esm/LinearGenomeView/components/OverviewRubberBand.js.map +1 -0
- package/esm/LinearGenomeView/components/OverviewScaleBar.d.ts +148 -0
- package/esm/LinearGenomeView/components/OverviewScaleBar.js +287 -0
- package/esm/LinearGenomeView/components/OverviewScaleBar.js.map +1 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete.d.ts +22 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js +136 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -0
- package/esm/LinearGenomeView/components/RubberBand.d.ts +9 -0
- package/esm/LinearGenomeView/components/RubberBand.js +197 -0
- package/esm/LinearGenomeView/components/RubberBand.js.map +1 -0
- package/esm/LinearGenomeView/components/Ruler.d.ts +27 -0
- package/esm/LinearGenomeView/components/Ruler.js +50 -0
- package/esm/LinearGenomeView/components/Ruler.js.map +1 -0
- package/esm/LinearGenomeView/components/ScaleBar.d.ts +10 -0
- package/esm/LinearGenomeView/components/ScaleBar.js +112 -0
- package/esm/LinearGenomeView/components/ScaleBar.js.map +1 -0
- package/esm/LinearGenomeView/components/SearchBox.d.ts +8 -0
- package/esm/LinearGenomeView/components/SearchBox.js +94 -0
- package/esm/LinearGenomeView/components/SearchBox.js.map +1 -0
- package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +7 -0
- package/esm/LinearGenomeView/components/SearchResultsDialog.js +107 -0
- package/esm/LinearGenomeView/components/SearchResultsDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/SequenceDialog.d.ts +8 -0
- package/esm/LinearGenomeView/components/SequenceDialog.js +147 -0
- package/esm/LinearGenomeView/components/SequenceDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/TrackContainer.d.ts +10 -0
- package/esm/LinearGenomeView/components/TrackContainer.js +104 -0
- package/esm/LinearGenomeView/components/TrackContainer.js.map +1 -0
- package/esm/LinearGenomeView/components/TrackLabel.d.ts +8 -0
- package/esm/LinearGenomeView/components/TrackLabel.js +88 -0
- package/esm/LinearGenomeView/components/TrackLabel.js.map +1 -0
- package/{dist/LinearGenomeView/components/VerticalGuides.d.ts → esm/LinearGenomeView/components/TracksContainer.d.ts} +4 -3
- package/esm/LinearGenomeView/components/TracksContainer.js +142 -0
- package/esm/LinearGenomeView/components/TracksContainer.js.map +1 -0
- package/esm/LinearGenomeView/components/ZoomControls.d.ts +7 -0
- package/esm/LinearGenomeView/components/ZoomControls.js +32 -0
- package/esm/LinearGenomeView/components/ZoomControls.js.map +1 -0
- package/esm/LinearGenomeView/components/util.d.ts +14 -0
- package/esm/LinearGenomeView/components/util.js +17 -0
- package/esm/LinearGenomeView/components/util.js.map +1 -0
- package/esm/LinearGenomeView/index.d.ts +275 -0
- package/esm/LinearGenomeView/index.js +978 -0
- package/esm/LinearGenomeView/index.js.map +1 -0
- package/esm/LinearGenomeView/util.d.ts +14 -0
- package/esm/LinearGenomeView/util.js +62 -0
- package/esm/LinearGenomeView/util.js.map +1 -0
- package/esm/index.d.ts +615 -0
- package/esm/index.js +127 -0
- package/esm/index.js.map +1 -0
- package/package.json +22 -15
- package/src/BaseLinearDisplay/components/BaseLinearDisplay.tsx +4 -4
- package/src/BaseLinearDisplay/components/Block.tsx +5 -5
- package/src/BaseLinearDisplay/components/LinearBlocks.tsx +4 -4
- package/src/BaseLinearDisplay/components/ServerSideRenderedBlockContent.tsx +9 -9
- package/src/BaseLinearDisplay/components/Tooltip.tsx +14 -4
- package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +6 -4
- package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +1 -1
- package/src/LinearBasicDisplay/components/SetMaxHeight.tsx +10 -7
- package/src/LinearBasicDisplay/model.ts +19 -11
- package/src/LinearGenomeView/components/CenterLine.tsx +6 -11
- package/src/LinearGenomeView/components/ExportSvgDialog.tsx +5 -5
- package/src/LinearGenomeView/components/{VerticalGuides.tsx → Gridlines.tsx} +9 -11
- package/src/LinearGenomeView/components/Header.tsx +10 -15
- package/src/LinearGenomeView/components/HelpDialog.tsx +5 -5
- package/src/LinearGenomeView/components/ImportForm.tsx +6 -12
- package/src/LinearGenomeView/components/LinearGenomeView.test.js +16 -6
- package/src/LinearGenomeView/components/LinearGenomeView.tsx +6 -9
- package/src/LinearGenomeView/components/MiniControls.tsx +29 -40
- package/src/LinearGenomeView/components/OverviewRubberBand.tsx +20 -29
- package/src/LinearGenomeView/components/OverviewScaleBar.tsx +61 -59
- package/src/LinearGenomeView/components/RefNameAutocomplete.tsx +13 -44
- package/src/LinearGenomeView/components/RubberBand.tsx +12 -18
- package/src/LinearGenomeView/components/Ruler.tsx +5 -11
- package/src/LinearGenomeView/components/ScaleBar.tsx +23 -27
- package/src/LinearGenomeView/components/SearchBox.tsx +4 -3
- package/src/LinearGenomeView/components/SearchResultsDialog.tsx +7 -6
- package/src/LinearGenomeView/components/SequenceDialog.tsx +10 -10
- package/src/LinearGenomeView/components/TrackContainer.tsx +29 -39
- package/src/LinearGenomeView/components/TrackLabel.tsx +76 -79
- package/src/LinearGenomeView/components/TracksContainer.tsx +10 -15
- package/src/LinearGenomeView/components/ZoomControls.tsx +12 -13
- package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap +500 -550
- package/src/LinearGenomeView/index.test.ts +15 -36
- package/src/LinearGenomeView/index.tsx +390 -564
- package/src/index.ts +1 -1
- package/dist/LinearBareDisplay/index.test.js +0 -33
- package/dist/LinearGenomeView/components/LinearGenomeView.test.js +0 -234
- package/dist/LinearGenomeView/components/ScaleBar.test.js +0 -180
- package/dist/LinearGenomeView/components/VerticalGuides.js +0 -116
- package/dist/LinearGenomeView/index.test.js +0 -1187
- package/dist/LinearGenomeView/util.test.js +0 -78
package/esm/index.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { lazy } from 'react';
|
|
2
|
+
import { when } from 'mobx';
|
|
3
|
+
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
4
|
+
import { createBaseTrackConfig, createBaseTrackModel, } from '@jbrowse/core/pluggableElementTypes/models';
|
|
5
|
+
import TrackType from '@jbrowse/core/pluggableElementTypes/TrackType';
|
|
6
|
+
import DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType';
|
|
7
|
+
import ViewType from '@jbrowse/core/pluggableElementTypes/ViewType';
|
|
8
|
+
import Plugin from '@jbrowse/core/Plugin';
|
|
9
|
+
import { isAbstractMenuManager } from '@jbrowse/core/util';
|
|
10
|
+
import LineStyleIcon from '@mui/icons-material/LineStyle';
|
|
11
|
+
import { BaseLinearDisplay, BaseLinearDisplayComponent, baseLinearDisplayConfigSchema, } from './BaseLinearDisplay';
|
|
12
|
+
import { configSchemaFactory as linearBareDisplayConfigSchemaFactory, stateModelFactory as LinearBareDisplayStateModelFactory, } from './LinearBareDisplay';
|
|
13
|
+
import { stateModelFactory as linearGenomeViewStateModelFactory, renderToSvg, RefNameAutocomplete, SearchBox, } from './LinearGenomeView';
|
|
14
|
+
import { configSchema as linearBasicDisplayConfigSchemaFactory, modelFactory as linearBasicDisplayModelFactory, } from './LinearBasicDisplay';
|
|
15
|
+
export default class LinearGenomeViewPlugin extends Plugin {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.name = 'LinearGenomeViewPlugin';
|
|
19
|
+
this.exports = {
|
|
20
|
+
BaseLinearDisplayComponent,
|
|
21
|
+
BaseLinearDisplay,
|
|
22
|
+
baseLinearDisplayConfigSchema,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
install(pluginManager) {
|
|
26
|
+
pluginManager.addTrackType(() => {
|
|
27
|
+
const configSchema = ConfigurationSchema('FeatureTrack', {}, {
|
|
28
|
+
baseConfiguration: createBaseTrackConfig(pluginManager),
|
|
29
|
+
explicitIdentifier: 'trackId',
|
|
30
|
+
});
|
|
31
|
+
return new TrackType({
|
|
32
|
+
name: 'FeatureTrack',
|
|
33
|
+
configSchema,
|
|
34
|
+
stateModel: createBaseTrackModel(pluginManager, 'FeatureTrack', configSchema),
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
pluginManager.addTrackType(() => {
|
|
38
|
+
const configSchema = ConfigurationSchema('BasicTrack', {}, {
|
|
39
|
+
baseConfiguration: createBaseTrackConfig(pluginManager),
|
|
40
|
+
explicitIdentifier: 'trackId',
|
|
41
|
+
});
|
|
42
|
+
return new TrackType({
|
|
43
|
+
name: 'BasicTrack',
|
|
44
|
+
configSchema,
|
|
45
|
+
stateModel: createBaseTrackModel(pluginManager, 'BasicTrack', configSchema),
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
pluginManager.addDisplayType(() => {
|
|
49
|
+
const configSchema = linearBareDisplayConfigSchemaFactory(pluginManager);
|
|
50
|
+
return new DisplayType({
|
|
51
|
+
name: 'LinearBareDisplay',
|
|
52
|
+
configSchema,
|
|
53
|
+
stateModel: LinearBareDisplayStateModelFactory(configSchema),
|
|
54
|
+
trackType: 'BasicTrack',
|
|
55
|
+
viewType: 'LinearGenomeView',
|
|
56
|
+
ReactComponent: BaseLinearDisplayComponent,
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
pluginManager.addDisplayType(() => {
|
|
60
|
+
const configSchema = linearBasicDisplayConfigSchemaFactory(pluginManager);
|
|
61
|
+
return new DisplayType({
|
|
62
|
+
name: 'LinearBasicDisplay',
|
|
63
|
+
configSchema,
|
|
64
|
+
stateModel: linearBasicDisplayModelFactory(configSchema),
|
|
65
|
+
trackType: 'FeatureTrack',
|
|
66
|
+
viewType: 'LinearGenomeView',
|
|
67
|
+
ReactComponent: BaseLinearDisplayComponent,
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
pluginManager.addViewType(() => new ViewType({
|
|
71
|
+
name: 'LinearGenomeView',
|
|
72
|
+
stateModel: linearGenomeViewStateModelFactory(pluginManager),
|
|
73
|
+
ReactComponent: lazy(() => import('./LinearGenomeView/components/LinearGenomeView')),
|
|
74
|
+
}));
|
|
75
|
+
pluginManager.addToExtensionPoint('LaunchView-LinearGenomeView',
|
|
76
|
+
// @ts-ignore
|
|
77
|
+
async ({ session, assembly, loc, tracks = [], }) => {
|
|
78
|
+
try {
|
|
79
|
+
const { assemblyManager } = session;
|
|
80
|
+
const view = session.addView('LinearGenomeView', {});
|
|
81
|
+
await when(() => !!view.volatileWidth);
|
|
82
|
+
if (!assembly) {
|
|
83
|
+
throw new Error('No assembly provided when launching linear genome view');
|
|
84
|
+
}
|
|
85
|
+
const asm = await assemblyManager.waitForAssembly(assembly);
|
|
86
|
+
if (!asm) {
|
|
87
|
+
throw new Error(`Assembly "${assembly}" not found when launching linear genome view`);
|
|
88
|
+
}
|
|
89
|
+
view.navToLocString(loc, assembly);
|
|
90
|
+
const idsNotFound = [];
|
|
91
|
+
tracks.forEach(track => {
|
|
92
|
+
try {
|
|
93
|
+
view.showTrack(track);
|
|
94
|
+
}
|
|
95
|
+
catch (e) {
|
|
96
|
+
if (`${e}`.match('Could not resolve identifier')) {
|
|
97
|
+
idsNotFound.push(track);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
throw e;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
if (idsNotFound.length) {
|
|
105
|
+
throw new Error(`Could not resolve identifiers: ${idsNotFound.join(',')}`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
catch (e) {
|
|
109
|
+
session.notify(`${e}`, 'error');
|
|
110
|
+
throw e;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
configure(pluginManager) {
|
|
115
|
+
if (isAbstractMenuManager(pluginManager.rootModel)) {
|
|
116
|
+
pluginManager.rootModel.appendToSubMenu(['Add'], {
|
|
117
|
+
label: 'Linear genome view',
|
|
118
|
+
icon: LineStyleIcon,
|
|
119
|
+
onClick: (session) => {
|
|
120
|
+
session.addView('LinearGenomeView', {});
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
export { baseLinearDisplayConfigSchema, linearBareDisplayConfigSchemaFactory, linearBasicDisplayConfigSchemaFactory, linearBasicDisplayModelFactory, renderToSvg, BaseLinearDisplayComponent, BaseLinearDisplay, RefNameAutocomplete, SearchBox, };
|
|
127
|
+
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-linear-genome-view",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "JBrowse 2 linear genome view",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -16,47 +16,54 @@
|
|
|
16
16
|
},
|
|
17
17
|
"author": "JBrowse Team",
|
|
18
18
|
"distMain": "dist/index.js",
|
|
19
|
+
"distModule": "esm/index.js",
|
|
19
20
|
"srcMain": "src/index.ts",
|
|
21
|
+
"srcModule": "src/index.ts",
|
|
20
22
|
"main": "dist/index.js",
|
|
21
23
|
"files": [
|
|
22
24
|
"dist",
|
|
23
|
-
"src"
|
|
25
|
+
"src",
|
|
26
|
+
"esm"
|
|
24
27
|
],
|
|
25
28
|
"scripts": {
|
|
26
|
-
"
|
|
29
|
+
"prebuild": "npm run clean",
|
|
30
|
+
"build": "npm-run-all build:*",
|
|
31
|
+
"build:esm": "tsc --build tsconfig.build.esm.json",
|
|
32
|
+
"build:es5": "tsc --build tsconfig.build.es5.json",
|
|
33
|
+
"clean": "rimraf dist esm *.tsbuildinfo",
|
|
27
34
|
"test": "cd ../..; jest plugins/linear-genome-view",
|
|
28
35
|
"prepublishOnly": "yarn test",
|
|
29
36
|
"prepack": "yarn build; yarn useDist",
|
|
30
37
|
"postpack": "yarn useSrc",
|
|
31
38
|
"useDist": "node ../../scripts/useDist.js",
|
|
32
|
-
"useSrc": "node ../../scripts/useSrc.js"
|
|
33
|
-
"postbuild": "tsc --build tsconfig.build.json"
|
|
39
|
+
"useSrc": "node ../../scripts/useSrc.js"
|
|
34
40
|
},
|
|
35
41
|
"dependencies": {
|
|
36
42
|
"@babel/runtime": "^7.17.9",
|
|
37
|
-
"@
|
|
43
|
+
"@mui/icons-material": "^5.0.1",
|
|
38
44
|
"@popperjs/core": "^2.11.0",
|
|
39
45
|
"clone": "^2.1.2",
|
|
40
46
|
"clsx": "^1.0.4",
|
|
41
47
|
"copy-to-clipboard": "^3.3.1",
|
|
42
48
|
"file-saver": "^2.0.0",
|
|
43
|
-
"material-ui-popup-state": "^
|
|
49
|
+
"material-ui-popup-state": "^3.0.0",
|
|
44
50
|
"normalize-wheel": "^1.0.1",
|
|
45
51
|
"react-popper": "^2.0.0"
|
|
46
52
|
},
|
|
47
53
|
"peerDependencies": {
|
|
48
|
-
"@jbrowse/core": "^
|
|
49
|
-
"@material
|
|
50
|
-
"
|
|
51
|
-
"mobx": "^
|
|
52
|
-
"mobx-
|
|
53
|
-
"mobx-state-tree": "3.14.1",
|
|
54
|
+
"@jbrowse/core": "^2.0.0",
|
|
55
|
+
"@mui/material": "^5.0.0",
|
|
56
|
+
"mobx": "^6.0.0",
|
|
57
|
+
"mobx-react": "^7.0.0",
|
|
58
|
+
"mobx-state-tree": "^5.0.0",
|
|
54
59
|
"prop-types": "^15.0.0",
|
|
55
60
|
"react": ">=16.8.0",
|
|
56
|
-
"react-dom": ">=16.8.0"
|
|
61
|
+
"react-dom": ">=16.8.0",
|
|
62
|
+
"tss-react": "^3.0.0"
|
|
57
63
|
},
|
|
58
64
|
"publishConfig": {
|
|
59
65
|
"access": "public"
|
|
60
66
|
},
|
|
61
|
-
"
|
|
67
|
+
"module": "esm/index.js",
|
|
68
|
+
"gitHead": "0db0462fa1f9f15ab4869da085bcab032b9483c3"
|
|
62
69
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useState, useRef } from 'react'
|
|
2
2
|
import { observer } from 'mobx-react'
|
|
3
|
-
import { useTheme
|
|
3
|
+
import { useTheme } from '@mui/material'
|
|
4
|
+
import { makeStyles } from 'tss-react/mui'
|
|
4
5
|
import { getConf } from '@jbrowse/core/configuration'
|
|
5
6
|
import { Menu } from '@jbrowse/core/ui'
|
|
6
7
|
|
|
@@ -9,7 +10,7 @@ import Tooltip from './Tooltip'
|
|
|
9
10
|
import LinearBlocks from './LinearBlocks'
|
|
10
11
|
import { BaseLinearDisplayModel } from '../models/BaseLinearDisplayModel'
|
|
11
12
|
|
|
12
|
-
const useStyles = makeStyles({
|
|
13
|
+
const useStyles = makeStyles()({
|
|
13
14
|
display: {
|
|
14
15
|
position: 'relative',
|
|
15
16
|
whiteSpace: 'nowrap',
|
|
@@ -22,7 +23,7 @@ const useStyles = makeStyles({
|
|
|
22
23
|
type Coord = [number, number]
|
|
23
24
|
const BaseLinearDisplay = observer(
|
|
24
25
|
(props: { model: BaseLinearDisplayModel; children?: React.ReactNode }) => {
|
|
25
|
-
const classes = useStyles()
|
|
26
|
+
const { classes } = useStyles()
|
|
26
27
|
const theme = useTheme()
|
|
27
28
|
const ref = useRef<HTMLDivElement>(null)
|
|
28
29
|
const [clientRect, setClientRect] = useState<DOMRect>()
|
|
@@ -103,7 +104,6 @@ const BaseLinearDisplay = observer(
|
|
|
103
104
|
}
|
|
104
105
|
style={{ zIndex: theme.zIndex.tooltip }}
|
|
105
106
|
menuItems={contextMenuItems()}
|
|
106
|
-
data-testid="base_linear_display_context_menu"
|
|
107
107
|
/>
|
|
108
108
|
</div>
|
|
109
109
|
)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { BaseBlock } from '@jbrowse/core/util/blockTypes'
|
|
3
|
-
import { makeStyles } from '
|
|
3
|
+
import { makeStyles } from 'tss-react/mui'
|
|
4
4
|
import { observer } from 'mobx-react'
|
|
5
5
|
|
|
6
|
-
const useStyles = makeStyles(theme => ({
|
|
6
|
+
const useStyles = makeStyles()(theme => ({
|
|
7
7
|
contentBlock: {
|
|
8
8
|
position: 'relative',
|
|
9
9
|
minHeight: '100%',
|
|
@@ -30,7 +30,7 @@ const useStyles = makeStyles(theme => ({
|
|
|
30
30
|
|
|
31
31
|
const ContentBlock = observer(
|
|
32
32
|
({ block, children }: { block: BaseBlock; children: React.ReactNode }) => {
|
|
33
|
-
const classes = useStyles()
|
|
33
|
+
const { classes } = useStyles()
|
|
34
34
|
const { widthPx } = block
|
|
35
35
|
return (
|
|
36
36
|
<div style={{ width: widthPx }} className={classes.contentBlock}>
|
|
@@ -41,7 +41,7 @@ const ContentBlock = observer(
|
|
|
41
41
|
)
|
|
42
42
|
|
|
43
43
|
function ElidedBlock({ width }: { width: number }) {
|
|
44
|
-
const classes = useStyles()
|
|
44
|
+
const { classes } = useStyles()
|
|
45
45
|
return <div className={classes.elidedBlock} style={{ width }} />
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -54,7 +54,7 @@ function InterRegionPaddingBlock({
|
|
|
54
54
|
width: number
|
|
55
55
|
style?: React.CSSProperties
|
|
56
56
|
}) {
|
|
57
|
-
const classes = useStyles()
|
|
57
|
+
const { classes } = useStyles()
|
|
58
58
|
return (
|
|
59
59
|
<div
|
|
60
60
|
style={{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { makeStyles } from '
|
|
2
|
+
import { makeStyles } from 'tss-react/mui'
|
|
3
3
|
import { getContainingView } from '@jbrowse/core/util'
|
|
4
4
|
import { observer } from 'mobx-react'
|
|
5
5
|
import {
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from './Block'
|
|
17
17
|
import { LinearGenomeViewModel } from '../../LinearGenomeView'
|
|
18
18
|
|
|
19
|
-
const useStyles = makeStyles({
|
|
19
|
+
const useStyles = makeStyles()({
|
|
20
20
|
linearBlocks: {
|
|
21
21
|
whiteSpace: 'nowrap',
|
|
22
22
|
textAlign: 'left',
|
|
@@ -39,7 +39,7 @@ const useStyles = makeStyles({
|
|
|
39
39
|
})
|
|
40
40
|
const RenderedBlocks = observer(
|
|
41
41
|
({ model }: { model: BaseLinearDisplayModel }) => {
|
|
42
|
-
const classes = useStyles()
|
|
42
|
+
const { classes } = useStyles()
|
|
43
43
|
const { blockDefinitions, blockState } = model
|
|
44
44
|
return (
|
|
45
45
|
<>
|
|
@@ -95,7 +95,7 @@ const RenderedBlocks = observer(
|
|
|
95
95
|
},
|
|
96
96
|
)
|
|
97
97
|
function LinearBlocks({ model }: { model: BaseLinearDisplayModel }) {
|
|
98
|
-
const classes = useStyles()
|
|
98
|
+
const { classes } = useStyles()
|
|
99
99
|
const { blockDefinitions } = model
|
|
100
100
|
const viewModel = getContainingView(model) as LinearGenomeViewModel
|
|
101
101
|
return (
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
|
-
import Typography from '@material
|
|
3
|
-
import { makeStyles } from '
|
|
2
|
+
import { Typography, Button } from '@mui/material'
|
|
3
|
+
import { makeStyles } from 'tss-react/mui'
|
|
4
4
|
import { observer } from 'mobx-react'
|
|
5
5
|
import { getParent } from 'mobx-state-tree'
|
|
6
6
|
import { getParentRenderProps } from '@jbrowse/core/util/tracks'
|
|
7
|
-
import
|
|
8
|
-
import RefreshIcon from '@material-ui/icons/Refresh'
|
|
7
|
+
import RefreshIcon from '@mui/icons-material/Refresh'
|
|
9
8
|
|
|
10
|
-
const useStyles = makeStyles(theme => ({
|
|
9
|
+
const useStyles = makeStyles()(theme => ({
|
|
11
10
|
loading: {
|
|
12
11
|
paddingLeft: '0.6em',
|
|
13
12
|
backgroundColor: theme.palette.action.disabledBackground,
|
|
@@ -73,7 +72,7 @@ function Repeater({ children }: { children: React.ReactNode }) {
|
|
|
73
72
|
const LoadingMessage = observer(({ model }: { model: any }) => {
|
|
74
73
|
// only show the loading message after 300ms to prevent excessive flickering
|
|
75
74
|
const [shown, setShown] = useState(false)
|
|
76
|
-
const classes = useStyles()
|
|
75
|
+
const { classes } = useStyles()
|
|
77
76
|
useEffect(() => {
|
|
78
77
|
let killed = false
|
|
79
78
|
const timeout = setTimeout(() => {
|
|
@@ -88,7 +87,8 @@ const LoadingMessage = observer(({ model }: { model: any }) => {
|
|
|
88
87
|
}, [])
|
|
89
88
|
|
|
90
89
|
const { status: blockStatus } = model
|
|
91
|
-
|
|
90
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
91
|
+
const { message: displayStatus } = getParent<any>(model, 2)
|
|
92
92
|
const status = displayStatus || blockStatus
|
|
93
93
|
return (
|
|
94
94
|
<>
|
|
@@ -108,7 +108,7 @@ function BlockMessage({
|
|
|
108
108
|
}: {
|
|
109
109
|
messageContent: string | React.ReactNode
|
|
110
110
|
}) {
|
|
111
|
-
const classes = useStyles()
|
|
111
|
+
const { classes } = useStyles()
|
|
112
112
|
|
|
113
113
|
return React.isValidElement(messageContent) ? (
|
|
114
114
|
<div className={classes.blockReactNodeMessage}>{messageContent}</div>
|
|
@@ -128,7 +128,7 @@ function BlockError({
|
|
|
128
128
|
reload: () => void
|
|
129
129
|
displayHeight: number
|
|
130
130
|
}) {
|
|
131
|
-
const classes = useStyles()
|
|
131
|
+
const { classes } = useStyles()
|
|
132
132
|
return (
|
|
133
133
|
<div className={classes.blockError} style={{ height: displayHeight }}>
|
|
134
134
|
{reload ? (
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React, { useState, useMemo } from 'react'
|
|
2
2
|
import { getConf } from '@jbrowse/core/configuration'
|
|
3
|
+
import { SanitizedHTML } from '@jbrowse/core/ui'
|
|
3
4
|
import { observer } from 'mobx-react'
|
|
4
|
-
import { Portal, alpha
|
|
5
|
+
import { Portal, alpha } from '@mui/material'
|
|
6
|
+
import { makeStyles } from 'tss-react/mui'
|
|
5
7
|
import { usePopper } from 'react-popper'
|
|
6
8
|
|
|
7
9
|
// locals
|
|
@@ -10,7 +12,7 @@ import { BaseLinearDisplayModel } from '../models/BaseLinearDisplayModel'
|
|
|
10
12
|
function round(value: number) {
|
|
11
13
|
return Math.round(value * 1e5) / 1e5
|
|
12
14
|
}
|
|
13
|
-
const useStyles = makeStyles(theme => ({
|
|
15
|
+
const useStyles = makeStyles()(theme => ({
|
|
14
16
|
// these styles come from
|
|
15
17
|
// https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/Tooltip/Tooltip.js
|
|
16
18
|
tooltip: {
|
|
@@ -31,7 +33,15 @@ const TooltipContents = React.forwardRef<
|
|
|
31
33
|
HTMLDivElement,
|
|
32
34
|
{ message: React.ReactNode | string }
|
|
33
35
|
>(({ message }: { message: React.ReactNode | string }, ref) => {
|
|
34
|
-
return
|
|
36
|
+
return (
|
|
37
|
+
<div ref={ref}>
|
|
38
|
+
{React.isValidElement(message) ? (
|
|
39
|
+
message
|
|
40
|
+
) : message ? (
|
|
41
|
+
<SanitizedHTML html={String(message)} />
|
|
42
|
+
) : null}
|
|
43
|
+
</div>
|
|
44
|
+
)
|
|
35
45
|
})
|
|
36
46
|
|
|
37
47
|
type Coord = [number, number]
|
|
@@ -43,7 +53,7 @@ const Tooltip = observer(
|
|
|
43
53
|
model: BaseLinearDisplayModel
|
|
44
54
|
clientMouseCoord: Coord
|
|
45
55
|
}) => {
|
|
46
|
-
const classes = useStyles()
|
|
56
|
+
const { classes } = useStyles()
|
|
47
57
|
const { featureUnderMouse } = model
|
|
48
58
|
const [width, setWidth] = useState(0)
|
|
49
59
|
const [popperElt, setPopperElt] = useState<HTMLDivElement | null>(null)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import { Button, Typography } from '@material
|
|
3
|
+
import { Button, Typography } from '@mui/material'
|
|
4
4
|
import { BaseDisplay } from '@jbrowse/core/pluggableElementTypes/models'
|
|
5
5
|
import { getConf } from '@jbrowse/core/configuration'
|
|
6
6
|
import { MenuItem } from '@jbrowse/core/ui'
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
import { autorun } from 'mobx'
|
|
26
26
|
import { addDisposer, isAlive, types, Instance } from 'mobx-state-tree'
|
|
27
27
|
// icons
|
|
28
|
-
import MenuOpenIcon from '@
|
|
28
|
+
import MenuOpenIcon from '@mui/icons-material/MenuOpen'
|
|
29
29
|
|
|
30
30
|
import { LinearGenomeViewModel, ExportSvgOptions } from '../../LinearGenomeView'
|
|
31
31
|
import { Tooltip } from '../components/BaseLinearDisplay'
|
|
@@ -552,7 +552,7 @@ export const BaseLinearDisplay = types
|
|
|
552
552
|
renderProps() {
|
|
553
553
|
const view = getContainingView(self) as LGV
|
|
554
554
|
return {
|
|
555
|
-
...getParentRenderProps(self),
|
|
555
|
+
...(getParentRenderProps(self) as any),
|
|
556
556
|
notReady:
|
|
557
557
|
self.currBpPerPx !== view.bpPerPx || !self.estimatedRegionStats,
|
|
558
558
|
rpcDriverName: self.rpcDriverName,
|
|
@@ -679,7 +679,9 @@ export const BaseLinearDisplay = types
|
|
|
679
679
|
},
|
|
680
680
|
}))
|
|
681
681
|
.postProcessSnapshot(self => {
|
|
682
|
-
|
|
682
|
+
// xref https://github.com/mobxjs/mobx-state-tree/issues/1524 for Omit
|
|
683
|
+
const r = self as Omit<typeof self, symbol>
|
|
684
|
+
const { blockState, ...rest } = r
|
|
683
685
|
return rest
|
|
684
686
|
})
|
|
685
687
|
|
|
@@ -163,7 +163,7 @@ const blockState = types
|
|
|
163
163
|
self.maxHeightReached = false
|
|
164
164
|
self.ReactComponent = ServerSideRenderedBlockContent
|
|
165
165
|
self.renderProps = undefined
|
|
166
|
-
getParent(self, 2).reload()
|
|
166
|
+
getParent<any>(self, 2).reload()
|
|
167
167
|
},
|
|
168
168
|
beforeDestroy() {
|
|
169
169
|
if (renderInProgress && !renderInProgress.signal.aborted) {
|
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
IconButton,
|
|
10
10
|
Typography,
|
|
11
11
|
TextField,
|
|
12
|
-
|
|
13
|
-
} from '
|
|
12
|
+
} from '@mui/material'
|
|
13
|
+
import { makeStyles } from 'tss-react/mui'
|
|
14
14
|
|
|
15
|
-
import CloseIcon from '@
|
|
15
|
+
import CloseIcon from '@mui/icons-material/Close'
|
|
16
16
|
|
|
17
|
-
const useStyles = makeStyles(theme => ({
|
|
17
|
+
const useStyles = makeStyles()(theme => ({
|
|
18
18
|
root: {
|
|
19
19
|
width: 500,
|
|
20
20
|
},
|
|
@@ -29,15 +29,17 @@ const useStyles = makeStyles(theme => ({
|
|
|
29
29
|
},
|
|
30
30
|
}))
|
|
31
31
|
|
|
32
|
-
function SetMaxHeightDlg(
|
|
32
|
+
function SetMaxHeightDlg({
|
|
33
|
+
model,
|
|
34
|
+
handleClose,
|
|
35
|
+
}: {
|
|
33
36
|
model: {
|
|
34
37
|
maxHeight?: number
|
|
35
38
|
setMaxHeight: Function
|
|
36
39
|
}
|
|
37
40
|
handleClose: () => void
|
|
38
41
|
}) {
|
|
39
|
-
const {
|
|
40
|
-
const classes = useStyles()
|
|
42
|
+
const { classes } = useStyles()
|
|
41
43
|
const { maxHeight = '' } = model
|
|
42
44
|
const [max, setMax] = useState(`${maxHeight}`)
|
|
43
45
|
|
|
@@ -54,6 +56,7 @@ function SetMaxHeightDlg(props: {
|
|
|
54
56
|
aria-label="close"
|
|
55
57
|
className={classes.closeButton}
|
|
56
58
|
onClick={handleClose}
|
|
59
|
+
size="large"
|
|
57
60
|
>
|
|
58
61
|
<CloseIcon />
|
|
59
62
|
</IconButton>
|
|
@@ -9,7 +9,7 @@ import { MenuItem } from '@jbrowse/core/ui'
|
|
|
9
9
|
import { types, getEnv, Instance } from 'mobx-state-tree'
|
|
10
10
|
|
|
11
11
|
// icons
|
|
12
|
-
import VisibilityIcon from '@
|
|
12
|
+
import VisibilityIcon from '@mui/icons-material/Visibility'
|
|
13
13
|
|
|
14
14
|
// locals
|
|
15
15
|
import { BaseLinearDisplay } from '../BaseLinearDisplay'
|
|
@@ -51,19 +51,23 @@ const stateModelFactory = (configSchema: AnyConfigurationSchemaType) =>
|
|
|
51
51
|
},
|
|
52
52
|
|
|
53
53
|
get displayMode() {
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
return (
|
|
55
|
+
self.trackDisplayMode ?? getConf(self, ['renderer', 'displayMode'])
|
|
56
|
+
)
|
|
56
57
|
},
|
|
58
|
+
}))
|
|
59
|
+
.views(self => ({
|
|
57
60
|
get rendererConfig() {
|
|
58
61
|
const configBlob = getConf(self, ['renderer']) || {}
|
|
62
|
+
const config = configBlob as Omit<typeof configBlob, symbol>
|
|
59
63
|
|
|
60
64
|
return self.rendererType.configSchema.create(
|
|
61
65
|
{
|
|
62
|
-
...
|
|
63
|
-
showLabels:
|
|
64
|
-
showDescriptions:
|
|
65
|
-
displayMode:
|
|
66
|
-
maxHeight:
|
|
66
|
+
...config,
|
|
67
|
+
showLabels: self.showLabels,
|
|
68
|
+
showDescriptions: self.showDescriptions,
|
|
69
|
+
displayMode: self.displayMode,
|
|
70
|
+
maxHeight: self.maxHeight,
|
|
67
71
|
},
|
|
68
72
|
getEnv(self),
|
|
69
73
|
)
|
|
@@ -92,9 +96,13 @@ const stateModelFactory = (configSchema: AnyConfigurationSchemaType) =>
|
|
|
92
96
|
return {
|
|
93
97
|
renderProps() {
|
|
94
98
|
const config = self.rendererConfig
|
|
99
|
+
const superProps = superRenderProps()
|
|
100
|
+
|
|
101
|
+
const superPropsOmit = superProps as Omit<typeof superProps, symbol>
|
|
95
102
|
|
|
96
103
|
return {
|
|
97
|
-
...
|
|
104
|
+
...superPropsOmit,
|
|
105
|
+
|
|
98
106
|
config,
|
|
99
107
|
}
|
|
100
108
|
},
|
|
@@ -136,9 +144,9 @@ const stateModelFactory = (configSchema: AnyConfigurationSchemaType) =>
|
|
|
136
144
|
{
|
|
137
145
|
label: 'Set max height',
|
|
138
146
|
onClick: () => {
|
|
139
|
-
getSession(self).queueDialog(
|
|
147
|
+
getSession(self).queueDialog(handleClose => [
|
|
140
148
|
SetMaxHeightDlg,
|
|
141
|
-
{ model: self, handleClose
|
|
149
|
+
{ model: self, handleClose },
|
|
142
150
|
])
|
|
143
151
|
},
|
|
144
152
|
},
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { makeStyles } from '@material-ui/core/styles'
|
|
2
|
-
import { observer, PropTypes as MobxPropTypes } from 'mobx-react'
|
|
3
1
|
import React, { useRef } from 'react'
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { makeStyles } from 'tss-react/mui'
|
|
3
|
+
import { observer } from 'mobx-react'
|
|
4
|
+
import { LinearGenomeViewModel } from '..'
|
|
6
5
|
|
|
7
|
-
type LGV =
|
|
6
|
+
type LGV = LinearGenomeViewModel
|
|
8
7
|
|
|
9
|
-
const useStyles = makeStyles(() => ({
|
|
8
|
+
const useStyles = makeStyles()(() => ({
|
|
10
9
|
centerLineContainer: {
|
|
11
10
|
background: 'transparent',
|
|
12
11
|
height: '100%',
|
|
@@ -28,7 +27,7 @@ const useStyles = makeStyles(() => ({
|
|
|
28
27
|
function CenterLine({ model }: { model: LGV }) {
|
|
29
28
|
const { bpPerPx, centerLineInfo, trackHeights, tracks, width } = model
|
|
30
29
|
const ref = useRef<HTMLDivElement>(null)
|
|
31
|
-
const classes = useStyles()
|
|
30
|
+
const { classes } = useStyles()
|
|
32
31
|
const startingPosition = width / 2
|
|
33
32
|
|
|
34
33
|
return tracks.length ? (
|
|
@@ -63,8 +62,4 @@ function CenterLine({ model }: { model: LGV }) {
|
|
|
63
62
|
) : null
|
|
64
63
|
}
|
|
65
64
|
|
|
66
|
-
CenterLine.propTypes = {
|
|
67
|
-
model: MobxPropTypes.objectOrObservableObject.isRequired,
|
|
68
|
-
}
|
|
69
|
-
|
|
70
65
|
export default observer(CenterLine)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
|
+
import { makeStyles } from 'tss-react/mui'
|
|
2
3
|
import {
|
|
3
4
|
Button,
|
|
4
5
|
Checkbox,
|
|
@@ -11,13 +12,12 @@ import {
|
|
|
11
12
|
IconButton,
|
|
12
13
|
TextField,
|
|
13
14
|
Typography,
|
|
14
|
-
|
|
15
|
-
} from '@material-ui/core'
|
|
15
|
+
} from '@mui/material'
|
|
16
16
|
import { ErrorMessage } from '@jbrowse/core/ui'
|
|
17
|
-
import CloseIcon from '@
|
|
17
|
+
import CloseIcon from '@mui/icons-material/Close'
|
|
18
18
|
import { LinearGenomeViewModel as LGV } from '..'
|
|
19
19
|
|
|
20
|
-
const useStyles = makeStyles(theme => ({
|
|
20
|
+
const useStyles = makeStyles()(theme => ({
|
|
21
21
|
closeButton: {
|
|
22
22
|
position: 'absolute',
|
|
23
23
|
right: theme.spacing(1),
|
|
@@ -48,7 +48,7 @@ export default function ExportSvgDlg({
|
|
|
48
48
|
const [loading, setLoading] = useState(false)
|
|
49
49
|
const [filename, setFilename] = useState('jbrowse.svg')
|
|
50
50
|
const [error, setError] = useState<unknown>()
|
|
51
|
-
const classes = useStyles()
|
|
51
|
+
const { classes } = useStyles()
|
|
52
52
|
return (
|
|
53
53
|
<Dialog open onClose={handleClose}>
|
|
54
54
|
<DialogTitle>
|