jbrowse-plugin-mafviewer 1.2.3 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/dist/BgzipTaffyAdapter/BgzipTaffyAdapter.d.ts +1 -1
  2. package/dist/BigMafAdapter/BigMafAdapter.d.ts +1 -1
  3. package/dist/BigMafAdapter/BigMafAdapter.js +50 -49
  4. package/dist/BigMafAdapter/BigMafAdapter.js.map +1 -1
  5. package/dist/LinearMafDisplay/components/Crosshairs.d.ts +10 -0
  6. package/dist/LinearMafDisplay/components/Crosshairs.js +18 -0
  7. package/dist/LinearMafDisplay/components/Crosshairs.js.map +1 -0
  8. package/dist/LinearMafDisplay/components/GetSequenceDialog/GetSequenceDialog.d.ts +11 -0
  9. package/dist/LinearMafDisplay/components/GetSequenceDialog/GetSequenceDialog.js +97 -0
  10. package/dist/LinearMafDisplay/components/GetSequenceDialog/GetSequenceDialog.js.map +1 -0
  11. package/dist/LinearMafDisplay/components/{ReactComponent.d.ts → LinearMafDisplayComponent.d.ts} +1 -1
  12. package/dist/LinearMafDisplay/components/LinearMafDisplayComponent.js +168 -0
  13. package/dist/LinearMafDisplay/components/LinearMafDisplayComponent.js.map +1 -0
  14. package/dist/LinearMafDisplay/components/MAFTooltip.d.ts +12 -0
  15. package/dist/LinearMafDisplay/components/MAFTooltip.js +29 -0
  16. package/dist/LinearMafDisplay/components/MAFTooltip.js.map +1 -0
  17. package/dist/LinearMafDisplay/components/SetRowHeightDialog/SetRowHeightDialog.js +38 -0
  18. package/dist/LinearMafDisplay/components/SetRowHeightDialog/SetRowHeightDialog.js.map +1 -0
  19. package/dist/LinearMafDisplay/components/Sidebar/ColorLegend.d.ts +6 -0
  20. package/dist/LinearMafDisplay/components/{ColorLegend.js → Sidebar/ColorLegend.js} +2 -3
  21. package/dist/LinearMafDisplay/components/Sidebar/ColorLegend.js.map +1 -0
  22. package/dist/LinearMafDisplay/components/Sidebar/RectBg.js.map +1 -0
  23. package/dist/LinearMafDisplay/components/{SvgWrapper.d.ts → Sidebar/SvgWrapper.d.ts} +1 -1
  24. package/dist/LinearMafDisplay/components/{SvgWrapper.js → Sidebar/SvgWrapper.js} +3 -1
  25. package/dist/LinearMafDisplay/components/Sidebar/SvgWrapper.js.map +1 -0
  26. package/dist/LinearMafDisplay/components/{Tree.d.ts → Sidebar/Tree.d.ts} +2 -1
  27. package/dist/LinearMafDisplay/components/{Tree.js → Sidebar/Tree.js} +2 -0
  28. package/dist/LinearMafDisplay/components/Sidebar/Tree.js.map +1 -0
  29. package/dist/LinearMafDisplay/components/{YScaleBars.d.ts → Sidebar/YScaleBars.d.ts} +1 -1
  30. package/dist/LinearMafDisplay/components/Sidebar/YScaleBars.js +11 -0
  31. package/dist/LinearMafDisplay/components/Sidebar/YScaleBars.js.map +1 -0
  32. package/dist/LinearMafDisplay/index.js +1 -1
  33. package/dist/LinearMafDisplay/index.js.map +1 -1
  34. package/dist/LinearMafDisplay/renderSvg.js +1 -1
  35. package/dist/LinearMafDisplay/renderSvg.js.map +1 -1
  36. package/dist/LinearMafDisplay/stateModel.d.ts +23 -20
  37. package/dist/LinearMafDisplay/stateModel.js +62 -8
  38. package/dist/LinearMafDisplay/stateModel.js.map +1 -1
  39. package/dist/LinearMafDisplay/types.d.ts +5 -3
  40. package/dist/LinearMafDisplay/types.js +1 -15
  41. package/dist/LinearMafDisplay/types.js.map +1 -1
  42. package/dist/LinearMafDisplay/util.d.ts +4 -0
  43. package/dist/LinearMafDisplay/util.js +16 -0
  44. package/dist/LinearMafDisplay/util.js.map +1 -0
  45. package/dist/LinearMafRenderer/LinearMafRenderer.d.ts +5 -4
  46. package/dist/LinearMafRenderer/LinearMafRenderer.js +8 -10
  47. package/dist/LinearMafRenderer/LinearMafRenderer.js.map +1 -1
  48. package/dist/LinearMafRenderer/makeImageData.d.ts +1 -0
  49. package/dist/LinearMafRenderer/makeImageData.js +25 -20
  50. package/dist/LinearMafRenderer/makeImageData.js.map +1 -1
  51. package/dist/MafAddTrackWorkflow/index.js +0 -1
  52. package/dist/MafAddTrackWorkflow/index.js.map +1 -1
  53. package/dist/{MafRPC/index.d.ts → MafGetSamples/MafGetSamples.d.ts} +1 -3
  54. package/dist/{MafRPC/index.js → MafGetSamples/MafGetSamples.js} +2 -7
  55. package/dist/MafGetSamples/MafGetSamples.js.map +1 -0
  56. package/dist/MafGetSamples/index.d.ts +2 -0
  57. package/dist/MafGetSamples/index.js +7 -0
  58. package/dist/MafGetSamples/index.js.map +1 -0
  59. package/dist/MafGetSequences/MafGetSequences.d.ts +16 -0
  60. package/dist/MafGetSequences/MafGetSequences.js +20 -0
  61. package/dist/MafGetSequences/MafGetSequences.js.map +1 -0
  62. package/dist/MafGetSequences/index.d.ts +2 -0
  63. package/dist/MafGetSequences/index.js +7 -0
  64. package/dist/MafGetSequences/index.js.map +1 -0
  65. package/dist/MafTabixAdapter/MafTabixAdapter.d.ts +1 -1
  66. package/dist/MafTabixAdapter/MafTabixAdapter.js +9 -11
  67. package/dist/MafTabixAdapter/MafTabixAdapter.js.map +1 -1
  68. package/dist/MafTabixAdapter/configSchema.js +29 -1
  69. package/dist/MafTabixAdapter/configSchema.js.map +1 -1
  70. package/dist/index.js +4 -2
  71. package/dist/index.js.map +1 -1
  72. package/dist/jbrowse-plugin-mafviewer.umd.production.min.js +9 -20
  73. package/dist/jbrowse-plugin-mafviewer.umd.production.min.js.map +4 -4
  74. package/dist/util/extractSubsequence.d.ts +12 -0
  75. package/dist/util/extractSubsequence.js +60 -0
  76. package/dist/util/extractSubsequence.js.map +1 -0
  77. package/dist/util/extractSubsequence.test.d.ts +1 -0
  78. package/dist/util/extractSubsequence.test.js +42 -0
  79. package/dist/util/extractSubsequence.test.js.map +1 -0
  80. package/dist/util/fastaUtils.d.ts +16 -0
  81. package/dist/util/fastaUtils.js +84 -0
  82. package/dist/util/fastaUtils.js.map +1 -0
  83. package/dist/util/fastaUtils.test.d.ts +1 -0
  84. package/dist/util/fastaUtils.test.js +95 -0
  85. package/dist/util/fastaUtils.test.js.map +1 -0
  86. package/dist/util/fetchSequences.d.ts +18 -0
  87. package/dist/util/fetchSequences.js +39 -0
  88. package/dist/util/fetchSequences.js.map +1 -0
  89. package/dist/util/useSequences.d.ts +21 -0
  90. package/dist/util/useSequences.js +64 -0
  91. package/dist/util/useSequences.js.map +1 -0
  92. package/dist/util.d.ts +2 -2
  93. package/dist/util.js +5 -1
  94. package/dist/util.js.map +1 -1
  95. package/package.json +13 -13
  96. package/src/BigMafAdapter/BigMafAdapter.ts +52 -49
  97. package/src/LinearMafDisplay/components/Crosshairs.tsx +50 -0
  98. package/src/LinearMafDisplay/components/GetSequenceDialog/GetSequenceDialog.tsx +175 -0
  99. package/src/LinearMafDisplay/components/LinearMafDisplayComponent.tsx +257 -0
  100. package/src/LinearMafDisplay/components/MAFTooltip.tsx +59 -0
  101. package/src/LinearMafDisplay/components/SetRowHeightDialog/SetRowHeightDialog.tsx +83 -0
  102. package/src/LinearMafDisplay/components/{ColorLegend.tsx → Sidebar/ColorLegend.tsx} +11 -7
  103. package/src/LinearMafDisplay/components/{SvgWrapper.tsx → Sidebar/SvgWrapper.tsx} +5 -3
  104. package/src/LinearMafDisplay/components/{Tree.tsx → Sidebar/Tree.tsx} +5 -1
  105. package/src/LinearMafDisplay/components/Sidebar/YScaleBars.tsx +23 -0
  106. package/src/LinearMafDisplay/index.ts +1 -1
  107. package/src/LinearMafDisplay/renderSvg.tsx +1 -1
  108. package/src/LinearMafDisplay/stateModel.ts +71 -18
  109. package/src/LinearMafDisplay/types.ts +4 -24
  110. package/src/LinearMafDisplay/util.ts +27 -0
  111. package/src/LinearMafRenderer/LinearMafRenderer.ts +10 -14
  112. package/src/LinearMafRenderer/makeImageData.ts +33 -22
  113. package/src/MafAddTrackWorkflow/index.ts +0 -1
  114. package/src/{MafRPC/index.ts → MafGetSamples/MafGetSamples.ts} +1 -8
  115. package/src/MafGetSamples/index.ts +9 -0
  116. package/src/MafGetSequences/MafGetSequences.ts +47 -0
  117. package/src/MafGetSequences/index.ts +9 -0
  118. package/src/MafTabixAdapter/MafTabixAdapter.ts +13 -12
  119. package/src/MafTabixAdapter/configSchema.ts +29 -1
  120. package/src/index.ts +4 -2
  121. package/src/util/__snapshots__/fastaUtils.test.ts.snap +22 -0
  122. package/src/util/extractSubsequence.test.ts +54 -0
  123. package/src/util/extractSubsequence.ts +74 -0
  124. package/src/util/fastaUtils.test.ts +99 -0
  125. package/src/util/fastaUtils.ts +102 -0
  126. package/src/util/fetchSequences.ts +57 -0
  127. package/src/util/useSequences.ts +90 -0
  128. package/src/util.ts +6 -2
  129. package/dist/LinearMafDisplay/components/ColorLegend.d.ts +0 -8
  130. package/dist/LinearMafDisplay/components/ColorLegend.js.map +0 -1
  131. package/dist/LinearMafDisplay/components/ReactComponent.js +0 -50
  132. package/dist/LinearMafDisplay/components/ReactComponent.js.map +0 -1
  133. package/dist/LinearMafDisplay/components/RectBg.js.map +0 -1
  134. package/dist/LinearMafDisplay/components/SetRowHeight.js +0 -36
  135. package/dist/LinearMafDisplay/components/SetRowHeight.js.map +0 -1
  136. package/dist/LinearMafDisplay/components/SvgWrapper.js.map +0 -1
  137. package/dist/LinearMafDisplay/components/Tree.js.map +0 -1
  138. package/dist/LinearMafDisplay/components/YScaleBars.js +0 -20
  139. package/dist/LinearMafDisplay/components/YScaleBars.js.map +0 -1
  140. package/dist/MafRPC/index.js.map +0 -1
  141. package/src/LinearMafDisplay/components/ReactComponent.tsx +0 -91
  142. package/src/LinearMafDisplay/components/SetRowHeight.tsx +0 -83
  143. package/src/LinearMafDisplay/components/YScaleBars.tsx +0 -41
  144. /package/dist/LinearMafDisplay/components/{SetRowHeight.d.ts → SetRowHeightDialog/SetRowHeightDialog.d.ts} +0 -0
  145. /package/dist/LinearMafDisplay/components/{RectBg.d.ts → Sidebar/RectBg.d.ts} +0 -0
  146. /package/dist/LinearMafDisplay/components/{RectBg.js → Sidebar/RectBg.js} +0 -0
  147. /package/src/LinearMafDisplay/components/{RectBg.tsx → Sidebar/RectBg.tsx} +0 -0
@@ -0,0 +1,90 @@
1
+ import { useEffect, useState } from 'react'
2
+
3
+ import { getContainingView, getSession } from '@jbrowse/core/util'
4
+ import { getRpcSessionId } from '@jbrowse/core/util/tracks'
5
+
6
+ import type { LinearMafDisplayModel } from '../LinearMafDisplay/stateModel'
7
+ import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
8
+
9
+ interface SelectionCoords {
10
+ dragStartX: number
11
+ dragEndX: number
12
+ }
13
+
14
+ interface UseSequencesOptions {
15
+ model: LinearMafDisplayModel
16
+ selectionCoords?: SelectionCoords
17
+ showAllLetters: boolean
18
+ }
19
+
20
+ /**
21
+ * React hook to fetch sequences for the given selection coordinates
22
+ * @param options - The options for fetching sequences
23
+ * @returns An object containing the sequence, loading state, and error
24
+ */
25
+ export function useSequences({
26
+ model,
27
+ selectionCoords,
28
+ showAllLetters,
29
+ }: UseSequencesOptions) {
30
+ const [sequence, setSequence] = useState<string>('')
31
+ const [loading, setLoading] = useState(true)
32
+ const [error, setError] = useState<unknown>()
33
+
34
+ useEffect(() => {
35
+ // If no selection coordinates, no need to fetch
36
+ if (!selectionCoords) {
37
+ return
38
+ }
39
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
40
+ ;(async () => {
41
+ try {
42
+ setLoading(true)
43
+ setError(undefined)
44
+
45
+ const { samples, adapterConfig } = model
46
+ const { rpcManager } = getSession(model)
47
+ const sessionId = getRpcSessionId(model)
48
+ const view = getContainingView(model) as LinearGenomeViewModel
49
+ const { refName, assemblyName } = view.displayedRegions[0]!
50
+ const { dragStartX, dragEndX } = selectionCoords
51
+ const [s, e] = [
52
+ Math.min(dragStartX, dragEndX),
53
+ Math.max(dragStartX, dragEndX),
54
+ ]
55
+
56
+ const fastaSequence = (await rpcManager.call(
57
+ sessionId,
58
+ 'MafGetSequences',
59
+ {
60
+ sessionId,
61
+ adapterConfig,
62
+ samples,
63
+ showAllLetters,
64
+ regions: [
65
+ {
66
+ refName,
67
+ start: view.pxToBp(s).coord - 1,
68
+ end: view.pxToBp(e).coord,
69
+ assemblyName,
70
+ },
71
+ ],
72
+ },
73
+ )) as string[]
74
+
75
+ const formattedSequence = fastaSequence
76
+ .map((r, idx) => `>${samples![idx]!.label}\n${r}`)
77
+ .join('\n')
78
+
79
+ setSequence(formattedSequence)
80
+ } catch (e) {
81
+ console.error(e)
82
+ setError(e)
83
+ } finally {
84
+ setLoading(false)
85
+ }
86
+ })()
87
+ }, [model, selectionCoords, showAllLetters])
88
+
89
+ return { sequence, loading, error }
90
+ }
package/src/util.ts CHANGED
@@ -3,9 +3,13 @@ function isStrs(array: unknown[]): array is string[] {
3
3
  }
4
4
 
5
5
  export function normalize(
6
- r: string[] | { id: string; label: string; color?: string }[],
6
+ r: string[] | { id: string; label?: string; color?: string }[],
7
7
  ) {
8
8
  return isStrs(r)
9
- ? r.map(elt => ({ id: elt, label: elt, color: undefined }))
9
+ ? r.map(elt => ({
10
+ id: elt,
11
+ label: elt,
12
+ color: undefined,
13
+ }))
10
14
  : r
11
15
  }
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { LinearMafDisplayModel } from '../stateModel';
3
- declare const ColorLegend: ({ model, labelWidth, svgFontSize, }: {
4
- model: LinearMafDisplayModel;
5
- svgFontSize: number;
6
- labelWidth: number;
7
- }) => React.JSX.Element;
8
- export default ColorLegend;
@@ -1 +0,0 @@
1
- {"version":3,"file":"ColorLegend.js","sourceRoot":"","sources":["../../../src/LinearMafDisplay/components/ColorLegend.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGrC,OAAO,MAAM,MAAM,UAAU,CAAA;AAC7B,OAAO,IAAI,MAAM,QAAQ,CAAA;AAEzB,MAAM,WAAW,GAAG,QAAQ,CAAC,UAAU,EACrC,KAAK,EACL,UAAU,EACV,WAAW,GAKZ;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AAe,WAAW,CAAA"}
@@ -1,50 +0,0 @@
1
- import React, { useRef, useState } from 'react';
2
- import BaseTooltip from '@jbrowse/core/ui/BaseTooltip';
3
- import SanitizedHTML from '@jbrowse/core/ui/SanitizedHTML';
4
- import { getContainingView, getEnv } from '@jbrowse/core/util';
5
- import { observer } from 'mobx-react';
6
- import { makeStyles } from 'tss-react/mui';
7
- import YScaleBars from './YScaleBars';
8
- const useStyles = makeStyles()({
9
- cursor: {
10
- pointerEvents: 'none',
11
- },
12
- });
13
- const LinearMafDisplay = observer(function (props) {
14
- const { model } = props;
15
- const { classes } = useStyles();
16
- const { pluginManager } = getEnv(model);
17
- const { rowHeight, height, scrollTop, samples: sources } = model;
18
- const ref = useRef(null);
19
- const LinearGenomePlugin = pluginManager.getPlugin('LinearGenomeViewPlugin');
20
- const { BaseLinearDisplayComponent } = LinearGenomePlugin.exports;
21
- const [mouseY, setMouseY] = useState();
22
- const [mouseX, setMouseX] = useState();
23
- const { width } = getContainingView(model);
24
- return (React.createElement("div", { ref: ref, onMouseMove: event => {
25
- const rect = ref.current?.getBoundingClientRect();
26
- const top = rect?.top || 0;
27
- const left = rect?.left || 0;
28
- setMouseY(event.clientY - top);
29
- setMouseX(event.clientX - left);
30
- }, onMouseLeave: () => {
31
- setMouseY(undefined);
32
- setMouseX(undefined);
33
- } },
34
- React.createElement(BaseLinearDisplayComponent, { ...props }),
35
- React.createElement(YScaleBars, { model: model }),
36
- mouseY && sources ? (React.createElement("div", { style: { position: 'relative' } },
37
- React.createElement("svg", { className: classes.cursor, width: width, height: height, style: {
38
- position: 'absolute',
39
- top: scrollTop,
40
- } },
41
- React.createElement("line", { x1: 0, x2: width, y1: mouseY - scrollTop, y2: mouseY - scrollTop, stroke: "black" }),
42
- React.createElement("line", { x1: mouseX, x2: mouseX, y1: 0, y2: height, stroke: "black" })),
43
- React.createElement(BaseTooltip, null,
44
- React.createElement(SanitizedHTML, { html: Object.entries(sources[Math.floor(mouseY / rowHeight)] || {})
45
- .filter(([key]) => key !== 'color' && key !== 'id')
46
- .map(([key, value]) => `${key}:${value}`)
47
- .join('\n') })))) : null));
48
- });
49
- export default LinearMafDisplay;
50
- //# sourceMappingURL=ReactComponent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReactComponent.js","sourceRoot":"","sources":["../../../src/LinearMafDisplay/components/ReactComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE/C,OAAO,WAAW,MAAM,8BAA8B,CAAA;AACtD,OAAO,aAAa,MAAM,gCAAgC,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,UAAU,MAAM,cAAc,CAAA;AAKrC,MAAM,SAAS,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,EAAE;QACN,aAAa,EAAE,MAAM;KACtB;CACF,CAAC,CAAA;AAEF,MAAM,gBAAgB,GAAG,QAAQ,CAAC,UAAU,KAE3C;IACC,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAA;IACvB,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,CAAA;IAC/B,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;IACvC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CAAA;IAChE,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IAExC,MAAM,kBAAkB,GAAG,aAAa,CAAC,SAAS,CAChD,wBAAwB,CAC+B,CAAA;IACzD,MAAM,EAAE,0BAA0B,EAAE,GAAG,kBAAkB,CAAC,OAAO,CAAA;IAEjE,MAAM,CAAC,M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MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAC,OAAO,GAAG,CAC9D;YACN,oBAAC,WAAW;gBACV,oBAAC,aAAa,IACZ,IAAI,EAAE,MAAM,CAAC,OAAO,CAClB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,IAAI,EAAE,CAC9C;yBACE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,IAAI,CAAC;yBAClD,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;yBACxC,IAAI,CAAC,IAAI,CAAC,GACb,CACU,CACV,CACP,CAAC,CAAC,CAAC,IAAI,CACJ,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,gBAAgB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"RectBg.js","sourceRoot":"","sources":["../../../src/LinearMafDisplay/components/RectBg.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,MAAM,GAAG,CAAC,KAMf,EAAE,EAAE;IACH,MAAM,EAAE,KAAK,GAAG,sBAAsB,EAAE,GAAG,KAAK,CAAA;IAChD,OAAO,iCAAU,KAAK,EAAE,IAAI,EAAE,KAAK,GAAI,CAAA;AACzC,CAAC,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -1,36 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { Dialog } from '@jbrowse/core/ui';
3
- import { Button, DialogActions, DialogContent, TextField, Typography, } from '@mui/material';
4
- import { observer } from 'mobx-react';
5
- import { makeStyles } from 'tss-react/mui';
6
- const useStyles = makeStyles()({
7
- root: {
8
- width: 500,
9
- },
10
- });
11
- const SetRowHeightDialog = observer(function (props) {
12
- const { model, handleClose } = props;
13
- const { classes } = useStyles();
14
- const [rowHeight, setRowHeight] = useState(`${model.rowHeight}`);
15
- const [rowProportion, setRowProportion] = useState(`${model.rowProportion}`);
16
- return (React.createElement(Dialog, { open: true, onClose: handleClose, title: "Set row height" },
17
- React.createElement(DialogContent, { className: classes.root },
18
- React.createElement(Typography, null, "Set row height and the proportion of the row height to use for drawing each row"),
19
- React.createElement(TextField, { value: rowHeight, helperText: "Enter row height", onChange: event => {
20
- setRowHeight(event.target.value);
21
- } }),
22
- React.createElement(TextField, { value: rowProportion, helperText: "Enter row proportion", onChange: event => {
23
- setRowProportion(event.target.value);
24
- } }),
25
- React.createElement(DialogActions, null,
26
- React.createElement(Button, { variant: "contained", color: "primary", type: "submit", autoFocus: true, onClick: () => {
27
- model.setRowProportion(+rowProportion);
28
- model.setRowHeight(+rowHeight);
29
- handleClose();
30
- } }, "Submit"),
31
- React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => {
32
- handleClose();
33
- } }, "Cancel")))));
34
- });
35
- export default SetRowHeightDialog;
36
- //# sourceMappingURL=SetRowHeight.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SetRowHeight.js","sourceRoot":"","sources":["../../../src/LinearMafDisplay/components/SetRowHeight.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EACL,MAAM,EACN,aAAa,EACb,aAAa,EACb,SAAS,EACT,UAAU,GACX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,MAAM,SAAS,GAAG,UAAU,EAAE,CAAC;IAC7B,IAAI,EAAE;QACJ,KAAK,EAAE,GAAG;KACX;CACF,CAAC,CAAA;AAEF,MAAM,kBAAkB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IACL,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,WAAW,EACjB,OAAO,EAAE,GAAG,EAAE;wBACZ,WAAW,EAAE,CAAA;oBACf,CAAC,aAGM,CACK,CACF,CACT,CACV,CAAA;AACH,CAAC,CAAC,CAAA;AACF,eAAe,kBAAkB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SvgWrapper.js","sourceRoot":"","sources":["../../../src/LinearMafDisplay/components/SvgWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAKrC,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAU,EACpC,QAAQ,EACR,KAAK,EACL,SAAS,GAKV;IACC,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,0CAAG,QAAQ,CAAI,CAAA;IACxB,CAAC;SAAM,CAAC;QACN,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAA;QAC7B,OAAO,CACL,6BACE,KAAK,EAAE;gBACL,QAAQ,EAAE,UAAU;gBACpB,GAAG,EAAE,CAAC;gBACN,IAAI,EAAE,CAAC;gBACP,aAAa,EAAE,MAAM;gBACrB,MAAM,EAAE,WAAW;gBACnB,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC,KAAK;aACtC,IAEA,QAAQ,CACL,CACP,CAAA;IACH,CAAC;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,UAAU,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tree.js","sourceRoot":"","sources":["../../../src/LinearMafDisplay/components/Tree.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,MAAM,IAAI,GAAG,QAAQ,CAAC,UAAU,EAAE,KAAK,EAAkB;IAC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React from 'react';
2
- import { measureText } from '@jbrowse/core/util';
3
- import { observer } from 'mobx-react';
4
- import ColorLegend from './ColorLegend';
5
- import SvgWrapper from './SvgWrapper';
6
- import { max } from './util';
7
- export const YScaleBars = observer(function (props) {
8
- const { model } = props;
9
- const { rowHeight, samples } = model;
10
- const svgFontSize = Math.min(Math.max(rowHeight, 8), 14);
11
- const canDisplayLabel = rowHeight >= 8;
12
- const minWidth = 20;
13
- const labelWidth = max(samples
14
- ?.map(s => measureText(s.label, svgFontSize))
15
- .map(width => (canDisplayLabel ? width : minWidth)) || [], 0);
16
- return (React.createElement(SvgWrapper, { ...props },
17
- React.createElement(ColorLegend, { model: model, labelWidth: labelWidth, svgFontSize: svgFontSize })));
18
- });
19
- export default YScaleBars;
20
- //# sourceMappingURL=YScaleBars.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"YScaleBars.js","sourceRoot":"","sources":["../../../src/LinearMafDisplay/components/YScaleBars.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAIrC,OAAO,WAAW,MAAM,eAAe,CAAA;AACvC,OAAO,UAAU,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAE5B,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAU,KAI5C;IACC,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAA;IACvB,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,CAAA;IACpC,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IACxD,MAAM,eAAe,GAAG,SAAS,IAAI,CAAC,CAAA;IACtC,MAAM,QAAQ,GAAG,E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,CAAC,OAAO,UAAU,OAAO,CAAC,aAA4B;IAC1D,aAAa,CAAC,YAAY,CAAC,GAAG,EAAE;QAC9B,OAAO,IAAI,aAAa,CAAC,aAAa,CAAC,CAAA;IACzC,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -1,91 +0,0 @@
1
- import React, { useRef, useState } from 'react'
2
-
3
- import BaseTooltip from '@jbrowse/core/ui/BaseTooltip'
4
- import SanitizedHTML from '@jbrowse/core/ui/SanitizedHTML'
5
- import { getContainingView, getEnv } from '@jbrowse/core/util'
6
- import { observer } from 'mobx-react'
7
- import { makeStyles } from 'tss-react/mui'
8
-
9
- import YScaleBars from './YScaleBars'
10
- import { LinearMafDisplayModel } from '../stateModel'
11
-
12
- import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
13
-
14
- const useStyles = makeStyles()({
15
- cursor: {
16
- pointerEvents: 'none',
17
- },
18
- })
19
-
20
- const LinearMafDisplay = observer(function (props: {
21
- model: LinearMafDisplayModel
22
- }) {
23
- const { model } = props
24
- const { classes } = useStyles()
25
- const { pluginManager } = getEnv(model)
26
- const { rowHeight, height, scrollTop, samples: sources } = model
27
- const ref = useRef<HTMLDivElement>(null)
28
-
29
- const LinearGenomePlugin = pluginManager.getPlugin(
30
- 'LinearGenomeViewPlugin',
31
- ) as import('@jbrowse/plugin-linear-genome-view').default
32
- const { BaseLinearDisplayComponent } = LinearGenomePlugin.exports
33
-
34
- const [mouseY, setMouseY] = useState<number>()
35
- const [mouseX, setMouseX] = useState<number>()
36
- const { width } = getContainingView(model) as LinearGenomeViewModel
37
-
38
- return (
39
- <div
40
- ref={ref}
41
- onMouseMove={event => {
42
- const rect = ref.current?.getBoundingClientRect()
43
- const top = rect?.top || 0
44
- const left = rect?.left || 0
45
- setMouseY(event.clientY - top)
46
- setMouseX(event.clientX - left)
47
- }}
48
- onMouseLeave={() => {
49
- setMouseY(undefined)
50
- setMouseX(undefined)
51
- }}
52
- >
53
- <BaseLinearDisplayComponent {...props} />
54
- <YScaleBars model={model} />
55
- {mouseY && sources ? (
56
- <div style={{ position: 'relative' }}>
57
- <svg
58
- className={classes.cursor}
59
- width={width}
60
- height={height}
61
- style={{
62
- position: 'absolute',
63
- top: scrollTop,
64
- }}
65
- >
66
- <line
67
- x1={0}
68
- x2={width}
69
- y1={mouseY - scrollTop}
70
- y2={mouseY - scrollTop}
71
- stroke="black"
72
- />
73
- <line x1={mouseX} x2={mouseX} y1={0} y2={height} stroke="black" />
74
- </svg>
75
- <BaseTooltip>
76
- <SanitizedHTML
77
- html={Object.entries(
78
- sources[Math.floor(mouseY / rowHeight)] || {},
79
- )
80
- .filter(([key]) => key !== 'color' && key !== 'id')
81
- .map(([key, value]) => `${key}:${value}`)
82
- .join('\n')}
83
- />
84
- </BaseTooltip>
85
- </div>
86
- ) : null}
87
- </div>
88
- )
89
- })
90
-
91
- export default LinearMafDisplay
@@ -1,83 +0,0 @@
1
- import React, { useState } from 'react'
2
-
3
- import { Dialog } from '@jbrowse/core/ui'
4
- import {
5
- Button,
6
- DialogActions,
7
- DialogContent,
8
- TextField,
9
- Typography,
10
- } from '@mui/material'
11
- import { observer } from 'mobx-react'
12
- import { makeStyles } from 'tss-react/mui'
13
-
14
- const useStyles = makeStyles()({
15
- root: {
16
- width: 500,
17
- },
18
- })
19
-
20
- const SetRowHeightDialog = observer(function (props: {
21
- model: {
22
- rowHeight?: number
23
- rowProportion?: number
24
- setRowHeight: (arg: number) => void
25
- setRowProportion: (arg: number) => void
26
- }
27
- handleClose: () => void
28
- }) {
29
- const { model, handleClose } = props
30
- const { classes } = useStyles()
31
- const [rowHeight, setRowHeight] = useState(`${model.rowHeight}`)
32
- const [rowProportion, setRowProportion] = useState(`${model.rowProportion}`)
33
-
34
- return (
35
- <Dialog open onClose={handleClose} title="Set row height">
36
- <DialogContent className={classes.root}>
37
- <Typography>
38
- Set row height and the proportion of the row height to use for drawing
39
- each row
40
- </Typography>
41
- <TextField
42
- value={rowHeight}
43
- helperText="Enter row height"
44
- onChange={event => {
45
- setRowHeight(event.target.value)
46
- }}
47
- />
48
- <TextField
49
- value={rowProportion}
50
- helperText="Enter row proportion"
51
- onChange={event => {
52
- setRowProportion(event.target.value)
53
- }}
54
- />
55
- <DialogActions>
56
- <Button
57
- variant="contained"
58
- color="primary"
59
- type="submit"
60
- autoFocus
61
- onClick={() => {
62
- model.setRowProportion(+rowProportion)
63
- model.setRowHeight(+rowHeight)
64
- handleClose()
65
- }}
66
- >
67
- Submit
68
- </Button>
69
- <Button
70
- variant="contained"
71
- color="secondary"
72
- onClick={() => {
73
- handleClose()
74
- }}
75
- >
76
- Cancel
77
- </Button>
78
- </DialogActions>
79
- </DialogContent>
80
- </Dialog>
81
- )
82
- })
83
- export default SetRowHeightDialog
@@ -1,41 +0,0 @@
1
- import React from 'react'
2
-
3
- import { measureText } from '@jbrowse/core/util'
4
- import { observer } from 'mobx-react'
5
-
6
- // locals
7
- import { LinearMafDisplayModel } from '../stateModel'
8
- import ColorLegend from './ColorLegend'
9
- import SvgWrapper from './SvgWrapper'
10
- import { max } from './util'
11
-
12
- export const YScaleBars = observer(function (props: {
13
- model: LinearMafDisplayModel
14
- orientation?: string
15
- exportSVG?: boolean
16
- }) {
17
- const { model } = props
18
- const { rowHeight, samples } = model
19
- const svgFontSize = Math.min(Math.max(rowHeight, 8), 14)
20
- const canDisplayLabel = rowHeight >= 8
21
- const minWidth = 20
22
-
23
- const labelWidth = max(
24
- samples
25
- ?.map(s => measureText(s.label, svgFontSize))
26
- .map(width => (canDisplayLabel ? width : minWidth)) || [],
27
- 0,
28
- )
29
-
30
- return (
31
- <SvgWrapper {...props}>
32
- <ColorLegend
33
- model={model}
34
- labelWidth={labelWidth}
35
- svgFontSize={svgFontSize}
36
- />
37
- </SvgWrapper>
38
- )
39
- })
40
-
41
- export default YScaleBars