@jbrowse/plugin-linear-genome-view 2.3.4 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +2 -3
- package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js +4 -4
- package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -1
- package/dist/BaseLinearDisplay/components/Block.js +1 -1
- package/dist/BaseLinearDisplay/components/Block.js.map +1 -1
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +11 -11
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -1
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +82 -7
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +43 -28
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
- package/dist/BaseLinearDisplay/models/configSchema.js +8 -0
- package/dist/BaseLinearDisplay/models/configSchema.js.map +1 -1
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +1 -1
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +9 -5
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
- package/dist/BaseLinearDisplay/models/util.js +2 -2
- package/dist/BaseLinearDisplay/models/util.js.map +1 -1
- package/dist/LaunchLinearGenomeView/index.js +1 -1
- package/dist/LaunchLinearGenomeView/index.js.map +1 -1
- package/dist/LinearBareDisplay/index.d.ts +2 -3
- package/dist/LinearBareDisplay/index.js +4 -2
- package/dist/LinearBareDisplay/index.js.map +1 -1
- package/dist/LinearBareDisplay/model.d.ts +61 -3
- package/dist/LinearBasicDisplay/index.d.ts +2 -3
- package/dist/LinearBasicDisplay/index.js +4 -2
- package/dist/LinearBasicDisplay/index.js.map +1 -1
- package/dist/LinearBasicDisplay/model.d.ts +82 -14
- package/dist/LinearGenomeView/components/CenterLine.js +2 -2
- package/dist/LinearGenomeView/components/CenterLine.js.map +1 -1
- package/dist/LinearGenomeView/components/Cytobands.d.ts +118 -0
- package/dist/LinearGenomeView/components/Cytobands.js +92 -0
- package/dist/LinearGenomeView/components/Cytobands.js.map +1 -0
- package/dist/LinearGenomeView/components/ExportSvgDialog.d.ts +1 -1
- package/dist/LinearGenomeView/components/ExportSvgDialog.js +24 -3
- package/dist/LinearGenomeView/components/ExportSvgDialog.js.map +1 -1
- package/dist/LinearGenomeView/components/Gridlines.js +1 -1
- package/dist/LinearGenomeView/components/Gridlines.js.map +1 -1
- package/dist/LinearGenomeView/components/Header.js +3 -4
- package/dist/LinearGenomeView/components/Header.js.map +1 -1
- package/dist/LinearGenomeView/components/ImportForm.d.ts +2 -2
- package/dist/LinearGenomeView/components/ImportForm.js +15 -19
- package/dist/LinearGenomeView/components/ImportForm.js.map +1 -1
- package/dist/LinearGenomeView/components/LinearGenomeView.js +1 -1
- package/dist/LinearGenomeView/components/MiniControls.js +5 -4
- package/dist/LinearGenomeView/components/MiniControls.js.map +1 -1
- package/dist/LinearGenomeView/components/OverviewRubberband.d.ts +3 -4
- package/dist/LinearGenomeView/components/OverviewRubberband.js +8 -11
- package/dist/LinearGenomeView/components/OverviewRubberband.js.map +1 -1
- package/dist/LinearGenomeView/components/OverviewScalebar.d.ts +4 -119
- package/dist/LinearGenomeView/components/OverviewScalebar.js +19 -103
- package/dist/LinearGenomeView/components/OverviewScalebar.js.map +1 -1
- package/dist/LinearGenomeView/components/RefNameAutocomplete.d.ts +2 -1
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js +35 -31
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -1
- package/dist/LinearGenomeView/components/RubberbandSpan.d.ts +2 -2
- package/dist/LinearGenomeView/components/RubberbandSpan.js +4 -18
- package/dist/LinearGenomeView/components/RubberbandSpan.js.map +1 -1
- package/dist/LinearGenomeView/components/SearchBox.js +3 -3
- package/dist/LinearGenomeView/components/SearchBox.js.map +1 -1
- package/dist/LinearGenomeView/components/TrackLabel.js +6 -7
- package/dist/LinearGenomeView/components/TrackLabel.js.map +1 -1
- package/dist/LinearGenomeView/components/TracksContainer.d.ts +2 -3
- package/dist/LinearGenomeView/components/TracksContainer.js +9 -8
- package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -1
- package/dist/LinearGenomeView/components/ZoomControls.js +5 -4
- package/dist/LinearGenomeView/components/ZoomControls.js.map +1 -1
- package/dist/LinearGenomeView/components/hooks.d.ts +6 -1
- package/dist/LinearGenomeView/components/hooks.js +1 -1
- package/dist/LinearGenomeView/components/hooks.js.map +1 -1
- package/dist/LinearGenomeView/components/util.d.ts +6 -0
- package/dist/LinearGenomeView/components/util.js +11 -1
- package/dist/LinearGenomeView/components/util.js.map +1 -1
- package/dist/LinearGenomeView/index.js +8 -6
- package/dist/LinearGenomeView/index.js.map +1 -1
- package/dist/LinearGenomeView/model.d.ts +18 -12
- package/dist/LinearGenomeView/model.js +31 -34
- package/dist/LinearGenomeView/model.js.map +1 -1
- package/dist/LinearGenomeView/svgcomponents/SVGBackground.d.ts +6 -0
- package/dist/LinearGenomeView/svgcomponents/SVGBackground.js +13 -0
- package/dist/LinearGenomeView/svgcomponents/SVGBackground.js.map +1 -0
- package/dist/LinearGenomeView/svgcomponents/SVGHeader.d.ts +10 -0
- package/dist/LinearGenomeView/svgcomponents/SVGHeader.js +55 -0
- package/dist/LinearGenomeView/svgcomponents/SVGHeader.js.map +1 -0
- package/dist/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +12 -0
- package/dist/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +57 -0
- package/dist/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js.map +1 -0
- package/dist/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +8 -0
- package/dist/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +13 -0
- package/dist/LinearGenomeView/svgcomponents/SVGRegionSeparators.js.map +1 -0
- package/dist/LinearGenomeView/svgcomponents/SVGRuler.d.ts +8 -0
- package/dist/LinearGenomeView/svgcomponents/SVGRuler.js +51 -0
- package/dist/LinearGenomeView/svgcomponents/SVGRuler.js.map +1 -0
- package/dist/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +8 -0
- package/dist/LinearGenomeView/svgcomponents/SVGScalebar.js +22 -0
- package/dist/LinearGenomeView/svgcomponents/SVGScalebar.js.map +1 -0
- package/dist/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +8 -0
- package/dist/LinearGenomeView/svgcomponents/SVGTrackLabel.js +16 -0
- package/dist/LinearGenomeView/svgcomponents/SVGTrackLabel.js.map +1 -0
- package/dist/LinearGenomeView/svgcomponents/SVGTracks.d.ts +23 -0
- package/dist/LinearGenomeView/svgcomponents/SVGTracks.js +30 -0
- package/dist/LinearGenomeView/svgcomponents/SVGTracks.js.map +1 -0
- package/dist/LinearGenomeView/util.js +2 -2
- package/dist/LinearGenomeView/util.js.map +1 -1
- package/dist/index.d.ts +157 -44
- package/dist/index.js +21 -13
- package/dist/index.js.map +1 -1
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +2 -3
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +2 -3
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -1
- package/esm/BaseLinearDisplay/components/Block.js +1 -1
- package/esm/BaseLinearDisplay/components/Block.js.map +1 -1
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +11 -11
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -1
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +82 -7
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +44 -29
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
- package/esm/BaseLinearDisplay/models/configSchema.js +8 -0
- package/esm/BaseLinearDisplay/models/configSchema.js.map +1 -1
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +1 -1
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +9 -5
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
- package/esm/BaseLinearDisplay/models/util.js +2 -2
- package/esm/BaseLinearDisplay/models/util.js.map +1 -1
- package/esm/LaunchLinearGenomeView/index.js +1 -1
- package/esm/LaunchLinearGenomeView/index.js.map +1 -1
- package/esm/LinearBareDisplay/index.d.ts +2 -3
- package/esm/LinearBareDisplay/index.js +2 -1
- package/esm/LinearBareDisplay/index.js.map +1 -1
- package/esm/LinearBareDisplay/model.d.ts +61 -3
- package/esm/LinearBasicDisplay/index.d.ts +2 -3
- package/esm/LinearBasicDisplay/index.js +2 -1
- package/esm/LinearBasicDisplay/index.js.map +1 -1
- package/esm/LinearBasicDisplay/model.d.ts +82 -14
- package/esm/LinearGenomeView/components/CenterLine.js +2 -2
- package/esm/LinearGenomeView/components/CenterLine.js.map +1 -1
- package/esm/LinearGenomeView/components/Cytobands.d.ts +118 -0
- package/esm/LinearGenomeView/components/Cytobands.js +87 -0
- package/esm/LinearGenomeView/components/Cytobands.js.map +1 -0
- package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +1 -1
- package/esm/LinearGenomeView/components/ExportSvgDialog.js +25 -4
- package/esm/LinearGenomeView/components/ExportSvgDialog.js.map +1 -1
- package/esm/LinearGenomeView/components/Gridlines.js +1 -1
- package/esm/LinearGenomeView/components/Gridlines.js.map +1 -1
- package/esm/LinearGenomeView/components/Header.js +5 -6
- package/esm/LinearGenomeView/components/Header.js.map +1 -1
- package/esm/LinearGenomeView/components/ImportForm.d.ts +2 -2
- package/esm/LinearGenomeView/components/ImportForm.js +16 -20
- package/esm/LinearGenomeView/components/ImportForm.js.map +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeView.js +1 -1
- package/esm/LinearGenomeView/components/MiniControls.js +5 -4
- package/esm/LinearGenomeView/components/MiniControls.js.map +1 -1
- package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +3 -4
- package/esm/LinearGenomeView/components/OverviewRubberband.js +8 -11
- package/esm/LinearGenomeView/components/OverviewRubberband.js.map +1 -1
- package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +4 -119
- package/esm/LinearGenomeView/components/OverviewScalebar.js +16 -100
- package/esm/LinearGenomeView/components/OverviewScalebar.js.map +1 -1
- package/esm/LinearGenomeView/components/RefNameAutocomplete.d.ts +2 -1
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js +36 -32
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -1
- package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +2 -2
- package/esm/LinearGenomeView/components/RubberbandSpan.js +5 -20
- package/esm/LinearGenomeView/components/RubberbandSpan.js.map +1 -1
- package/esm/LinearGenomeView/components/SearchBox.js +3 -3
- package/esm/LinearGenomeView/components/SearchBox.js.map +1 -1
- package/esm/LinearGenomeView/components/TrackLabel.js +6 -7
- package/esm/LinearGenomeView/components/TrackLabel.js.map +1 -1
- package/esm/LinearGenomeView/components/TracksContainer.d.ts +2 -3
- package/esm/LinearGenomeView/components/TracksContainer.js +9 -8
- package/esm/LinearGenomeView/components/TracksContainer.js.map +1 -1
- package/esm/LinearGenomeView/components/ZoomControls.js +5 -4
- package/esm/LinearGenomeView/components/ZoomControls.js.map +1 -1
- package/esm/LinearGenomeView/components/hooks.d.ts +6 -1
- package/esm/LinearGenomeView/components/hooks.js +1 -1
- package/esm/LinearGenomeView/components/hooks.js.map +1 -1
- package/esm/LinearGenomeView/components/util.d.ts +6 -0
- package/esm/LinearGenomeView/components/util.js +9 -0
- package/esm/LinearGenomeView/components/util.js.map +1 -1
- package/esm/LinearGenomeView/index.js +8 -6
- package/esm/LinearGenomeView/index.js.map +1 -1
- package/esm/LinearGenomeView/model.d.ts +18 -12
- package/esm/LinearGenomeView/model.js +24 -28
- package/esm/LinearGenomeView/model.js.map +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +6 -0
- package/esm/LinearGenomeView/svgcomponents/SVGBackground.js +7 -0
- package/esm/LinearGenomeView/svgcomponents/SVGBackground.js.map +1 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +10 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +49 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.js.map +1 -0
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +12 -0
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +47 -0
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js.map +1 -0
- package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +8 -0
- package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +7 -0
- package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js.map +1 -0
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +8 -0
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +45 -0
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.js.map +1 -0
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +8 -0
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +16 -0
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js.map +1 -0
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +8 -0
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +10 -0
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js.map +1 -0
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +23 -0
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +24 -0
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.js.map +1 -0
- package/esm/LinearGenomeView/util.js +2 -2
- package/esm/LinearGenomeView/util.js.map +1 -1
- package/esm/index.d.ts +157 -44
- package/esm/index.js +9 -5
- package/esm/index.js.map +1 -1
- package/package.json +3 -3
- package/src/BaseLinearDisplay/components/BaseLinearDisplay.tsx +4 -3
- package/src/BaseLinearDisplay/components/Block.tsx +1 -1
- package/src/BaseLinearDisplay/components/ServerSideRenderedBlockContent.tsx +11 -12
- package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +55 -40
- package/src/BaseLinearDisplay/models/configSchema.ts +8 -0
- package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +15 -22
- package/src/BaseLinearDisplay/models/util.ts +2 -2
- package/src/LaunchLinearGenomeView/index.ts +1 -1
- package/src/LinearBareDisplay/index.ts +2 -1
- package/src/LinearBasicDisplay/index.ts +2 -1
- package/src/LinearGenomeView/components/CenterLine.tsx +2 -2
- package/src/LinearGenomeView/components/Cytobands.tsx +154 -0
- package/src/LinearGenomeView/components/ExportSvgDialog.tsx +56 -4
- package/src/LinearGenomeView/components/Gridlines.tsx +1 -1
- package/src/LinearGenomeView/components/Header.tsx +6 -13
- package/src/LinearGenomeView/components/ImportForm.tsx +17 -26
- package/src/LinearGenomeView/components/LinearGenomeView.test.tsx +8 -11
- package/src/LinearGenomeView/components/LinearGenomeView.tsx +1 -1
- package/src/LinearGenomeView/components/MiniControls.tsx +6 -7
- package/src/LinearGenomeView/components/OverviewRubberband.tsx +40 -49
- package/src/LinearGenomeView/components/OverviewScalebar.tsx +222 -385
- package/src/LinearGenomeView/components/RefNameAutocomplete.tsx +50 -48
- package/src/LinearGenomeView/components/RubberbandSpan.tsx +8 -25
- package/src/LinearGenomeView/components/SearchBox.tsx +3 -2
- package/src/LinearGenomeView/components/TrackLabel.tsx +76 -76
- package/src/LinearGenomeView/components/TracksContainer.tsx +8 -8
- package/src/LinearGenomeView/components/ZoomControls.tsx +3 -4
- package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.tsx.snap +1230 -1200
- package/src/LinearGenomeView/components/hooks.ts +7 -1
- package/src/LinearGenomeView/components/util.ts +13 -0
- package/src/LinearGenomeView/index.test.ts +12 -13
- package/src/LinearGenomeView/index.ts +8 -9
- package/src/LinearGenomeView/model.ts +41 -36
- package/src/LinearGenomeView/svgcomponents/SVGBackground.tsx +21 -0
- package/src/LinearGenomeView/svgcomponents/SVGHeader.tsx +93 -0
- package/src/LinearGenomeView/svgcomponents/SVGLinearGenomeView.tsx +114 -0
- package/src/LinearGenomeView/svgcomponents/SVGRegionSeparators.tsx +31 -0
- package/src/LinearGenomeView/svgcomponents/SVGRuler.tsx +125 -0
- package/src/LinearGenomeView/svgcomponents/SVGScalebar.tsx +57 -0
- package/src/LinearGenomeView/svgcomponents/SVGTrackLabel.tsx +47 -0
- package/src/LinearGenomeView/svgcomponents/SVGTracks.tsx +67 -0
- package/src/LinearGenomeView/util.test.ts +7 -4
- package/src/LinearGenomeView/util.ts +3 -3
- package/src/index.ts +22 -23
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.d.ts +0 -4
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +0 -141
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js.map +0 -1
- package/dist/LinearGenomeView/components/Ruler.d.ts +0 -11
- package/dist/LinearGenomeView/components/Ruler.js +0 -39
- package/dist/LinearGenomeView/components/Ruler.js.map +0 -1
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.d.ts +0 -4
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js +0 -134
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js.map +0 -1
- package/esm/LinearGenomeView/components/Ruler.d.ts +0 -11
- package/esm/LinearGenomeView/components/Ruler.js +0 -34
- package/esm/LinearGenomeView/components/Ruler.js.map +0 -1
- package/src/LinearGenomeView/components/LinearGenomeViewSvg.tsx +0 -307
- package/src/LinearGenomeView/components/Ruler.tsx +0 -78
package/esm/index.js
CHANGED
|
@@ -3,10 +3,10 @@ import { isAbstractMenuManager } from '@jbrowse/core/util';
|
|
|
3
3
|
// icons
|
|
4
4
|
import LineStyleIcon from '@mui/icons-material/LineStyle';
|
|
5
5
|
// locals
|
|
6
|
-
import { BaseLinearDisplay, BaseLinearDisplayComponent,
|
|
7
|
-
import LinearBareDisplayF
|
|
8
|
-
import LinearGenomeViewF, {
|
|
9
|
-
import LinearBasicDisplayF
|
|
6
|
+
import { BaseLinearDisplay, BaseLinearDisplayComponent, baseLinearDisplayConfigSchema, } from './BaseLinearDisplay';
|
|
7
|
+
import LinearBareDisplayF from './LinearBareDisplay';
|
|
8
|
+
import LinearGenomeViewF, { SearchBox, ZoomControls, LinearGenomeView, } from './LinearGenomeView';
|
|
9
|
+
import LinearBasicDisplayF from './LinearBasicDisplay';
|
|
10
10
|
import FeatureTrackF from './FeatureTrack';
|
|
11
11
|
import BasicTrackF from './BasicTrack';
|
|
12
12
|
import LaunchLinearGenomeViewF from './LaunchLinearGenomeView';
|
|
@@ -43,5 +43,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
export {
|
|
46
|
+
export { configSchemaFactory as linearBareDisplayConfigSchemaFactory } from './LinearBareDisplay';
|
|
47
|
+
export { BlockMsg, baseLinearDisplayConfigSchema, BaseLinearDisplayComponent, BaseLinearDisplay, } from './BaseLinearDisplay';
|
|
48
|
+
export { RefNameAutocomplete, SearchBox, } from './LinearGenomeView';
|
|
49
|
+
export { renderToSvg, SVGTracks, totalHeight, SVGRuler, } from './LinearGenomeView/svgcomponents/SVGLinearGenomeView';
|
|
50
|
+
export { configSchema as linearBasicDisplayConfigSchemaFactory, modelFactory as linearBasicDisplayModelFactory, } from './LinearBasicDisplay';
|
|
47
51
|
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,sBAAsB,CAAA;AAEzC,OAAO,EAAwB,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAEhF,QAAQ;AACR,OAAO,aAAa,MAAM,+BAA+B,CAAA;AAEzD,SAAS;AACT,OAAO,EACL,iBAAiB,EACjB,0BAA0B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,sBAAsB,CAAA;AAEzC,OAAO,EAAwB,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAEhF,QAAQ;AACR,OAAO,aAAa,MAAM,+BAA+B,CAAA;AAEzD,SAAS;AACT,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC1B,6BAA6B,GAC9B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,kBAAkB,MAAM,qBAAqB,CAAA;AACpD,OAAO,iBAAiB,EAAE,EACxB,SAAS,EACT,YAAY,EACZ,gBAAgB,GACjB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,mBAAmB,MAAM,sBAAsB,CAAA;AAEtD,OAAO,aAAa,MAAM,gBAAgB,CAAA;AAC1C,OAAO,WAAW,MAAM,cAAc,CAAA;AACtC,OAAO,uBAAuB,MAAM,0BAA0B,CAAA;AAE9D,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,MAAM;IAA1D;;QACE,SAAI,GAAG,wBAAwB,CAAA;QAE/B,YAAO,GAAG;YACR,0BAA0B;YAC1B,iBAAiB;YACjB,6BAA6B;YAC7B,SAAS;YACT,YAAY;YACZ,gBAAgB;SACjB,CAAA;IAsBH,CAAC;IApBC,OAAO,CAAC,aAA4B;QAClC,aAAa,CAAC,aAAa,CAAC,CAAA;QAC5B,WAAW,CAAC,aAAa,CAAC,CAAA;QAC1B,mBAAmB,CAAC,aAAa,CAAC,CAAA;QAClC,iBAAiB,CAAC,aAAa,CAAC,CAAA;QAChC,kBAAkB,CAAC,aAAa,CAAC,CAAA;QACjC,uBAAuB,CAAC,aAAa,CAAC,CAAA;IACxC,CAAC;IAED,SAAS,CAAC,aAA4B;QACpC,IAAI,qBAAqB,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE;YAClD,aAAa,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,EAAE;gBAC/C,KAAK,EAAE,oBAAoB;gBAC3B,IAAI,EAAE,aAAa;gBACnB,OAAO,EAAE,CAAC,OAA6B,EAAE,EAAE;oBACzC,OAAO,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAA;gBACzC,CAAC;aACF,CAAC,CAAA;SACH;IACH,CAAC;CACF;AAID,OAAO,EAAE,mBAAmB,IAAI,oCAAoC,EAAE,MAAM,qBAAqB,CAAA;AACjG,OAAO,EACL,QAAQ,EACR,6BAA6B,EAC7B,0BAA0B,EAC1B,iBAAiB,GAClB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAEL,mBAAmB,EAEnB,SAAS,GACV,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,WAAW,EACX,SAAS,EACT,WAAW,EACX,QAAQ,GACT,MAAM,sDAAsD,CAAA;AAC7D,OAAO,EACL,YAAY,IAAI,qCAAqC,EACrD,YAAY,IAAI,8BAA8B,GAC/C,MAAM,sBAAsB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-linear-genome-view",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"description": "JBrowse 2 linear genome view",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"clsx": "^1.0.4",
|
|
48
48
|
"copy-to-clipboard": "^3.3.1",
|
|
49
49
|
"file-saver": "^2.0.0",
|
|
50
|
-
"material-ui-popup-state": "^
|
|
50
|
+
"material-ui-popup-state": "^5.0.0",
|
|
51
51
|
"normalize-wheel": "^1.0.1",
|
|
52
52
|
"react-error-boundary": "^3.0.0",
|
|
53
53
|
"react-popper": "^2.0.0"
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"access": "public"
|
|
67
67
|
},
|
|
68
68
|
"module": "esm/index.js",
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "747c50c4edc0184827efa4f8dfc576ca9a72caeb"
|
|
70
70
|
}
|
|
@@ -6,8 +6,7 @@ import { getConf } from '@jbrowse/core/configuration'
|
|
|
6
6
|
import { Menu } from '@jbrowse/core/ui'
|
|
7
7
|
|
|
8
8
|
// locals
|
|
9
|
-
|
|
10
|
-
import BlockMsg from './BlockMsg'
|
|
9
|
+
|
|
11
10
|
import LinearBlocks from './LinearBlocks'
|
|
12
11
|
import { BaseLinearDisplayModel } from '../models/BaseLinearDisplayModel'
|
|
13
12
|
|
|
@@ -113,4 +112,6 @@ const BaseLinearDisplay = observer(function (props: {
|
|
|
113
112
|
})
|
|
114
113
|
|
|
115
114
|
export default BaseLinearDisplay
|
|
116
|
-
|
|
115
|
+
|
|
116
|
+
export { default as Tooltip } from './Tooltip'
|
|
117
|
+
export { default as BlockMsg } from './BlockMsg'
|
|
@@ -10,18 +10,17 @@ import RefreshIcon from '@mui/icons-material/Refresh'
|
|
|
10
10
|
// locals
|
|
11
11
|
import BlockMsg from './BlockMsg'
|
|
12
12
|
|
|
13
|
-
const useStyles = makeStyles()(theme =>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}))
|
|
13
|
+
const useStyles = makeStyles()(theme => {
|
|
14
|
+
const bg = theme.palette.action.disabledBackground
|
|
15
|
+
return {
|
|
16
|
+
loading: {
|
|
17
|
+
paddingLeft: '0.6em',
|
|
18
|
+
backgroundColor: theme.palette.background.default,
|
|
19
|
+
backgroundImage: `repeating-linear-gradient(45deg, transparent, transparent 5px, ${bg} 5px, ${bg} 10px)`,
|
|
20
|
+
textAlign: 'center',
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
})
|
|
25
24
|
|
|
26
25
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
26
|
const LoadingMessage = observer(({ model }: { model: any }) => {
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
isSessionModelWithWidgets,
|
|
14
14
|
isFeature,
|
|
15
15
|
Feature,
|
|
16
|
+
ReactRendering,
|
|
16
17
|
} from '@jbrowse/core/util'
|
|
17
18
|
import { Stats } from '@jbrowse/core/data_adapters/BaseAdapter'
|
|
18
19
|
import { BaseBlock } from '@jbrowse/core/util/blockTypes'
|
|
@@ -33,6 +34,7 @@ import { LinearGenomeViewModel, ExportSvgOptions } from '../../LinearGenomeView'
|
|
|
33
34
|
import { Tooltip } from '../components/BaseLinearDisplay'
|
|
34
35
|
import TooLargeMessage from '../components/TooLargeMessage'
|
|
35
36
|
import BlockState, { renderBlockData } from './serverSideRenderedBlock'
|
|
37
|
+
import { ThemeOptions } from '@mui/material'
|
|
36
38
|
|
|
37
39
|
type LGV = LinearGenomeViewModel
|
|
38
40
|
|
|
@@ -55,9 +57,9 @@ type LayoutRecord = [number, number, number, number]
|
|
|
55
57
|
function getDisplayStr(totalBytes: number) {
|
|
56
58
|
let displayBp
|
|
57
59
|
if (Math.floor(totalBytes / 1000000) > 0) {
|
|
58
|
-
displayBp = `${parseFloat((totalBytes / 1000000).toPrecision(3))} Mb`
|
|
60
|
+
displayBp = `${Number.parseFloat((totalBytes / 1000000).toPrecision(3))} Mb`
|
|
59
61
|
} else if (Math.floor(totalBytes / 1000) > 0) {
|
|
60
|
-
displayBp = `${parseFloat((totalBytes / 1000).toPrecision(3))} Kb`
|
|
62
|
+
displayBp = `${Number.parseFloat((totalBytes / 1000).toPrecision(3))} Kb`
|
|
61
63
|
} else {
|
|
62
64
|
displayBp = `${Math.floor(totalBytes)} bytes`
|
|
63
65
|
}
|
|
@@ -65,7 +67,6 @@ function getDisplayStr(totalBytes: number) {
|
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
const minDisplayHeight = 20
|
|
68
|
-
const defaultDisplayHeight = 100
|
|
69
70
|
|
|
70
71
|
/**
|
|
71
72
|
* #stateModel BaseLinearDisplay
|
|
@@ -80,13 +81,12 @@ function stateModelFactory() {
|
|
|
80
81
|
/**
|
|
81
82
|
* #property
|
|
82
83
|
*/
|
|
83
|
-
|
|
84
|
+
heightPreConfig: types.maybe(
|
|
84
85
|
types.refinement(
|
|
85
86
|
'displayHeight',
|
|
86
87
|
types.number,
|
|
87
88
|
n => n >= minDisplayHeight,
|
|
88
89
|
),
|
|
89
|
-
defaultDisplayHeight,
|
|
90
90
|
),
|
|
91
91
|
/**
|
|
92
92
|
* #property
|
|
@@ -113,6 +113,9 @@ function stateModelFactory() {
|
|
|
113
113
|
estimatedRegionStats: undefined as undefined | Stats,
|
|
114
114
|
}))
|
|
115
115
|
.views(self => ({
|
|
116
|
+
get height() {
|
|
117
|
+
return self.heightPreConfig ?? (getConf(self, 'height') as number)
|
|
118
|
+
},
|
|
116
119
|
/**
|
|
117
120
|
* #getter
|
|
118
121
|
*/
|
|
@@ -364,11 +367,8 @@ function stateModelFactory() {
|
|
|
364
367
|
* #action
|
|
365
368
|
*/
|
|
366
369
|
setHeight(displayHeight: number) {
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
} else {
|
|
370
|
-
self.height = minDisplayHeight
|
|
371
|
-
}
|
|
370
|
+
self.heightPreConfig =
|
|
371
|
+
displayHeight > minDisplayHeight ? displayHeight : minDisplayHeight
|
|
372
372
|
return self.height
|
|
373
373
|
},
|
|
374
374
|
/**
|
|
@@ -657,7 +657,7 @@ function stateModelFactory() {
|
|
|
657
657
|
renderProps() {
|
|
658
658
|
const view = getContainingView(self) as LGV
|
|
659
659
|
return {
|
|
660
|
-
...
|
|
660
|
+
...getParentRenderProps(self),
|
|
661
661
|
notReady:
|
|
662
662
|
self.currBpPerPx !== view.bpPerPx || !self.estimatedRegionStats,
|
|
663
663
|
rpcDriverName: self.rpcDriverName,
|
|
@@ -706,14 +706,19 @@ function stateModelFactory() {
|
|
|
706
706
|
/**
|
|
707
707
|
* #method
|
|
708
708
|
*/
|
|
709
|
-
async renderSvg(
|
|
709
|
+
async renderSvg(
|
|
710
|
+
opts: ExportSvgOptions & {
|
|
711
|
+
overrideHeight: number
|
|
712
|
+
theme: ThemeOptions
|
|
713
|
+
},
|
|
714
|
+
) {
|
|
710
715
|
const { height, id } = self
|
|
711
716
|
const { overrideHeight } = opts
|
|
712
717
|
const view = getContainingView(self) as LGV
|
|
713
718
|
const { offsetPx: viewOffsetPx, roundedDynamicBlocks, width } = view
|
|
714
719
|
|
|
715
720
|
const renderings = await Promise.all(
|
|
716
|
-
roundedDynamicBlocks.map(block => {
|
|
721
|
+
roundedDynamicBlocks.map(async block => {
|
|
717
722
|
const blockState = BlockState.create({
|
|
718
723
|
key: block.key,
|
|
719
724
|
region: block,
|
|
@@ -726,34 +731,41 @@ function stateModelFactory() {
|
|
|
726
731
|
self.regionCannotBeRendered(block)
|
|
727
732
|
|
|
728
733
|
if (cannotBeRenderedReason) {
|
|
729
|
-
return
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
{
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
734
|
+
return [
|
|
735
|
+
block,
|
|
736
|
+
{
|
|
737
|
+
reactElement: (
|
|
738
|
+
<>
|
|
739
|
+
<rect x={0} y={0} width={width} height={20} fill="#aaa" />
|
|
740
|
+
<text x={0} y={15}>
|
|
741
|
+
{cannotBeRenderedReason}
|
|
742
|
+
</text>
|
|
743
|
+
</>
|
|
744
|
+
),
|
|
745
|
+
},
|
|
746
|
+
] as const
|
|
739
747
|
}
|
|
740
748
|
|
|
741
749
|
const { rpcManager, renderArgs, renderProps, rendererType } =
|
|
742
750
|
renderBlockData(blockState, self)
|
|
743
751
|
|
|
744
|
-
return
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
752
|
+
return [
|
|
753
|
+
block,
|
|
754
|
+
await rendererType.renderInClient(rpcManager, {
|
|
755
|
+
...renderArgs,
|
|
756
|
+
...renderProps,
|
|
757
|
+
viewParams: getViewParams(self, true),
|
|
758
|
+
exportSVG: opts,
|
|
759
|
+
theme: opts.theme || renderProps.theme,
|
|
760
|
+
}),
|
|
761
|
+
] as const
|
|
750
762
|
}),
|
|
751
763
|
)
|
|
752
764
|
|
|
753
765
|
return (
|
|
754
766
|
<>
|
|
755
|
-
{renderings.map((rendering, index) => {
|
|
756
|
-
const { offsetPx } =
|
|
767
|
+
{renderings.map(([block, rendering], index) => {
|
|
768
|
+
const { offsetPx, widthPx } = block
|
|
757
769
|
const offset = offsetPx - viewOffsetPx
|
|
758
770
|
const clipid = getId(id, index)
|
|
759
771
|
|
|
@@ -764,21 +776,14 @@ function stateModelFactory() {
|
|
|
764
776
|
<rect
|
|
765
777
|
x={0}
|
|
766
778
|
y={0}
|
|
767
|
-
width={
|
|
779
|
+
width={widthPx}
|
|
768
780
|
height={overrideHeight || height}
|
|
769
781
|
/>
|
|
770
782
|
</clipPath>
|
|
771
783
|
</defs>
|
|
772
784
|
<g transform={`translate(${offset} 0)`}>
|
|
773
785
|
<g clipPath={`url(#${clipid})`}>
|
|
774
|
-
{
|
|
775
|
-
rendering.reactElement
|
|
776
|
-
) : (
|
|
777
|
-
<g
|
|
778
|
-
/* eslint-disable-next-line react/no-danger */
|
|
779
|
-
dangerouslySetInnerHTML={{ __html: rendering.html }}
|
|
780
|
-
/>
|
|
781
|
-
)}
|
|
786
|
+
<ReactRendering rendering={rendering} />
|
|
782
787
|
</g>
|
|
783
788
|
</g>
|
|
784
789
|
</React.Fragment>
|
|
@@ -788,6 +793,16 @@ function stateModelFactory() {
|
|
|
788
793
|
)
|
|
789
794
|
},
|
|
790
795
|
}))
|
|
796
|
+
.preProcessSnapshot(snap => {
|
|
797
|
+
if (!snap) {
|
|
798
|
+
return snap
|
|
799
|
+
}
|
|
800
|
+
// rewrite "height" from older snapshots to "heightPreConfig", this allows
|
|
801
|
+
// us to maintain a height "getter" going forward
|
|
802
|
+
// @ts-expect-error
|
|
803
|
+
const { height, ...rest } = snap
|
|
804
|
+
return { heightPreConfig: height, ...rest }
|
|
805
|
+
})
|
|
791
806
|
.postProcessSnapshot(self => {
|
|
792
807
|
// xref https://github.com/mobxjs/mobx-state-tree/issues/1524 for Omit
|
|
793
808
|
const r = self as Omit<typeof self, symbol>
|
|
@@ -29,6 +29,14 @@ const baseLinearDisplayConfigSchema = ConfigurationSchema(
|
|
|
29
29
|
description:
|
|
30
30
|
"maximum data to attempt to download for a given track, used if adapter doesn't specify one",
|
|
31
31
|
},
|
|
32
|
+
/**
|
|
33
|
+
* #slot
|
|
34
|
+
*/
|
|
35
|
+
height: {
|
|
36
|
+
type: 'number',
|
|
37
|
+
defaultValue: 100,
|
|
38
|
+
description: 'default height for the track',
|
|
39
|
+
},
|
|
32
40
|
},
|
|
33
41
|
{
|
|
34
42
|
/**
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
getRpcSessionId,
|
|
30
30
|
} from '@jbrowse/core/util/tracks'
|
|
31
31
|
|
|
32
|
+
// locals
|
|
32
33
|
import ServerSideRenderedBlockContent from '../components/ServerSideRenderedBlockContent'
|
|
33
34
|
|
|
34
35
|
// the MST state of a single server-side-rendered block in a display
|
|
@@ -65,7 +66,7 @@ const blockState = types
|
|
|
65
66
|
makeAbortableReaction(
|
|
66
67
|
self as any,
|
|
67
68
|
renderBlockData,
|
|
68
|
-
renderBlockEffect
|
|
69
|
+
renderBlockEffect, // reaction doesn't expect async here
|
|
69
70
|
{
|
|
70
71
|
name: `${display.id}/${assembleLocString(self.region)} rendering`,
|
|
71
72
|
delay: display.renderDelay,
|
|
@@ -80,10 +81,11 @@ const blockState = types
|
|
|
80
81
|
self.status = message
|
|
81
82
|
},
|
|
82
83
|
setLoading(abortController: AbortController) {
|
|
83
|
-
if (
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
if (
|
|
85
|
+
renderInProgress !== undefined &&
|
|
86
|
+
!renderInProgress.signal.aborted
|
|
87
|
+
) {
|
|
88
|
+
renderInProgress.abort()
|
|
87
89
|
}
|
|
88
90
|
self.filled = false
|
|
89
91
|
self.message = undefined
|
|
@@ -140,7 +142,7 @@ const blockState = types
|
|
|
140
142
|
self.renderProps = renderProps
|
|
141
143
|
renderInProgress = undefined
|
|
142
144
|
},
|
|
143
|
-
setError(error:
|
|
145
|
+
setError(error: unknown) {
|
|
144
146
|
console.error(error)
|
|
145
147
|
if (renderInProgress && !renderInProgress.signal.aborted) {
|
|
146
148
|
renderInProgress.abort()
|
|
@@ -214,7 +216,7 @@ export function renderBlockData(
|
|
|
214
216
|
const regionAsm = self.region.assemblyName
|
|
215
217
|
if (
|
|
216
218
|
!assemblyNames.includes(regionAsm) &&
|
|
217
|
-
!assemblyNames.
|
|
219
|
+
!assemblyNames.some(name => assemblyManager.get(name)?.hasName(regionAsm))
|
|
218
220
|
) {
|
|
219
221
|
throw new Error(
|
|
220
222
|
`region assembly (${regionAsm}) does not match track assemblies (${assemblyNames})`,
|
|
@@ -260,24 +262,14 @@ export function renderBlockData(
|
|
|
260
262
|
}
|
|
261
263
|
}
|
|
262
264
|
|
|
263
|
-
interface RenderProps {
|
|
264
|
-
displayError: Error
|
|
265
|
-
rendererType: any
|
|
266
|
-
renderProps: { [key: string]: any }
|
|
267
|
-
rpcManager: { call: Function }
|
|
268
|
-
cannotBeRenderedReason: string
|
|
269
|
-
renderArgs: { [key: string]: any }
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
interface ErrorProps {
|
|
273
|
-
displayError: string
|
|
274
|
-
}
|
|
275
|
-
|
|
276
265
|
async function renderBlockEffect(
|
|
277
|
-
props:
|
|
266
|
+
props: ReturnType<typeof renderBlockData> | undefined,
|
|
278
267
|
signal: AbortSignal,
|
|
279
268
|
self: BlockModel,
|
|
280
269
|
) {
|
|
270
|
+
if (!props) {
|
|
271
|
+
return
|
|
272
|
+
}
|
|
281
273
|
const {
|
|
282
274
|
rendererType,
|
|
283
275
|
renderProps,
|
|
@@ -285,7 +277,7 @@ async function renderBlockEffect(
|
|
|
285
277
|
renderArgs,
|
|
286
278
|
cannotBeRenderedReason,
|
|
287
279
|
displayError,
|
|
288
|
-
} = props
|
|
280
|
+
} = props
|
|
289
281
|
if (!isAlive(self)) {
|
|
290
282
|
return undefined
|
|
291
283
|
}
|
|
@@ -315,5 +307,6 @@ async function renderBlockEffect(
|
|
|
315
307
|
features,
|
|
316
308
|
layout,
|
|
317
309
|
maxHeightReached,
|
|
310
|
+
renderProps,
|
|
318
311
|
}
|
|
319
312
|
}
|
|
@@ -14,9 +14,9 @@ export interface ErrorProps {
|
|
|
14
14
|
export function getDisplayStr(totalBytes: number) {
|
|
15
15
|
let displayBp
|
|
16
16
|
if (Math.floor(totalBytes / 1000000) > 0) {
|
|
17
|
-
displayBp = `${parseFloat((totalBytes / 1000000).toPrecision(3))} Mb`
|
|
17
|
+
displayBp = `${Number.parseFloat((totalBytes / 1000000).toPrecision(3))} Mb`
|
|
18
18
|
} else if (Math.floor(totalBytes / 1000) > 0) {
|
|
19
|
-
displayBp = `${parseFloat((totalBytes / 1000).toPrecision(3))} Kb`
|
|
19
|
+
displayBp = `${Number.parseFloat((totalBytes / 1000).toPrecision(3))} Kb`
|
|
20
20
|
} else {
|
|
21
21
|
displayBp = `${Math.floor(totalBytes)} bytes`
|
|
22
22
|
}
|
|
@@ -5,13 +5,13 @@ import { LinearGenomeViewModel } from '..'
|
|
|
5
5
|
|
|
6
6
|
type LGV = LinearGenomeViewModel
|
|
7
7
|
|
|
8
|
-
const useStyles = makeStyles()(
|
|
8
|
+
const useStyles = makeStyles()(theme => ({
|
|
9
9
|
centerLineContainer: {
|
|
10
10
|
background: 'transparent',
|
|
11
11
|
height: '100%',
|
|
12
12
|
zIndex: 5, // above the track but under menu
|
|
13
13
|
position: 'absolute',
|
|
14
|
-
border:
|
|
14
|
+
border: `1px ${theme.palette.action.active} dashed`,
|
|
15
15
|
borderTop: 'none',
|
|
16
16
|
borderBottom: 'none',
|
|
17
17
|
pointerEvents: 'none',
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { observer } from 'mobx-react'
|
|
3
|
+
|
|
4
|
+
// core
|
|
5
|
+
import { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel'
|
|
6
|
+
import { ContentBlock } from '@jbrowse/core/util/blockTypes'
|
|
7
|
+
import { Assembly } from '@jbrowse/core/assemblyManager/assembly'
|
|
8
|
+
|
|
9
|
+
// locals
|
|
10
|
+
import { HEADER_OVERVIEW_HEIGHT } from '..'
|
|
11
|
+
import { getCytobands } from './util'
|
|
12
|
+
|
|
13
|
+
// rounded rect from https://stackoverflow.com/a/45889603/2129219
|
|
14
|
+
// prettier-ignore
|
|
15
|
+
function rightRoundedRect(x: number, y: number, width: number, height: number, radius: number) {
|
|
16
|
+
return "M" + x + "," + y
|
|
17
|
+
+ "h" + (width - radius)
|
|
18
|
+
+ "a" + radius + "," + radius + " 0 0 1 " + radius + "," + radius
|
|
19
|
+
+ "v" + (height - 2 * radius)
|
|
20
|
+
+ "a" + radius + "," + radius + " 0 0 1 " + -radius + "," + radius
|
|
21
|
+
+ "h" + (radius - width)
|
|
22
|
+
+ "z";
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// prettier-ignore
|
|
26
|
+
function leftRoundedRect(x: number, y: number, width: number, height: number, radius: number ) {
|
|
27
|
+
return "M" + (x + radius) + "," + y
|
|
28
|
+
+ "h" + (width - radius)
|
|
29
|
+
+ "v" + height
|
|
30
|
+
+ "h" + (radius - width)
|
|
31
|
+
+ "a" + radius + "," + radius + " 0 0 1 " + (-radius) + "," + (-radius)
|
|
32
|
+
+ "v" + (2 * radius - height)
|
|
33
|
+
+ "a" + radius + "," + radius + " 0 0 1 " + radius + "," + (-radius)
|
|
34
|
+
+ "z";
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const colorMap: { [key: string]: string | undefined } = {
|
|
38
|
+
gneg: 'rgb(227,227,227)',
|
|
39
|
+
gpos25: 'rgb(142,142,142)',
|
|
40
|
+
gpos50: 'rgb(85,85,85)',
|
|
41
|
+
gpos100: 'rgb(0,0,0)',
|
|
42
|
+
gpos75: 'rgb(57,57,57)',
|
|
43
|
+
gvar: 'rgb(0,0,0)',
|
|
44
|
+
stalk: 'rgb(127,127,127)',
|
|
45
|
+
acen: '#800',
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export default observer(function Cytobands({
|
|
49
|
+
overview,
|
|
50
|
+
block,
|
|
51
|
+
assembly,
|
|
52
|
+
}: {
|
|
53
|
+
overview: Base1DViewModel
|
|
54
|
+
assembly?: Assembly
|
|
55
|
+
block: ContentBlock
|
|
56
|
+
}) {
|
|
57
|
+
const { offsetPx, reversed } = block
|
|
58
|
+
const cytobands = getCytobands(assembly, block.refName)
|
|
59
|
+
const coords = cytobands.map(f => {
|
|
60
|
+
const { refName, start, end, type } = f
|
|
61
|
+
return [
|
|
62
|
+
overview.bpToPx({
|
|
63
|
+
refName,
|
|
64
|
+
coord: start,
|
|
65
|
+
}),
|
|
66
|
+
overview.bpToPx({
|
|
67
|
+
refName,
|
|
68
|
+
coord: end,
|
|
69
|
+
}),
|
|
70
|
+
type,
|
|
71
|
+
]
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
const arr = cytobands || []
|
|
75
|
+
const lcap = reversed ? arr.length - 1 : 0
|
|
76
|
+
const rcap = reversed ? 0 : arr.length - 1
|
|
77
|
+
|
|
78
|
+
let firstCent = true
|
|
79
|
+
return (
|
|
80
|
+
<g transform={`translate(-${offsetPx})`}>
|
|
81
|
+
{coords.map(([start, end, type], index) => {
|
|
82
|
+
const key = `${start}-${end}-${type}`
|
|
83
|
+
if (type === 'acen' && firstCent) {
|
|
84
|
+
firstCent = false
|
|
85
|
+
return (
|
|
86
|
+
<polygon
|
|
87
|
+
key={key}
|
|
88
|
+
points={[
|
|
89
|
+
[start, 0],
|
|
90
|
+
[end, HEADER_OVERVIEW_HEIGHT / 2],
|
|
91
|
+
[start, HEADER_OVERVIEW_HEIGHT],
|
|
92
|
+
].toString()}
|
|
93
|
+
fill={colorMap[type]}
|
|
94
|
+
/>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
if (type === 'acen' && !firstCent) {
|
|
98
|
+
return (
|
|
99
|
+
<polygon
|
|
100
|
+
key={key}
|
|
101
|
+
points={[
|
|
102
|
+
[start, HEADER_OVERVIEW_HEIGHT / 2],
|
|
103
|
+
[end, 0],
|
|
104
|
+
[end, HEADER_OVERVIEW_HEIGHT],
|
|
105
|
+
].toString()}
|
|
106
|
+
fill={colorMap[type]}
|
|
107
|
+
/>
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (lcap === index) {
|
|
112
|
+
return (
|
|
113
|
+
<path
|
|
114
|
+
key={key}
|
|
115
|
+
d={leftRoundedRect(
|
|
116
|
+
Math.min(start, end),
|
|
117
|
+
0,
|
|
118
|
+
Math.abs(end - start),
|
|
119
|
+
HEADER_OVERVIEW_HEIGHT,
|
|
120
|
+
8,
|
|
121
|
+
)}
|
|
122
|
+
fill={colorMap[type]}
|
|
123
|
+
/>
|
|
124
|
+
)
|
|
125
|
+
} else if (rcap === index) {
|
|
126
|
+
return (
|
|
127
|
+
<path
|
|
128
|
+
key={key}
|
|
129
|
+
d={rightRoundedRect(
|
|
130
|
+
Math.min(start, end),
|
|
131
|
+
0,
|
|
132
|
+
Math.abs(end - start) - 2,
|
|
133
|
+
HEADER_OVERVIEW_HEIGHT,
|
|
134
|
+
8,
|
|
135
|
+
)}
|
|
136
|
+
fill={colorMap[type]}
|
|
137
|
+
/>
|
|
138
|
+
)
|
|
139
|
+
} else {
|
|
140
|
+
return (
|
|
141
|
+
<rect
|
|
142
|
+
key={key}
|
|
143
|
+
x={Math.min(start, end)}
|
|
144
|
+
y={0}
|
|
145
|
+
width={Math.abs(end - start)}
|
|
146
|
+
height={HEADER_OVERVIEW_HEIGHT}
|
|
147
|
+
fill={colorMap[type]}
|
|
148
|
+
/>
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
})}
|
|
152
|
+
</g>
|
|
153
|
+
)
|
|
154
|
+
})
|