@jbrowse/plugin-wiggle 2.3.3 → 2.4.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 (62) hide show
  1. package/dist/LinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +1 -1
  2. package/dist/LinearWiggleDisplay/components/WiggleDisplayComponent.js +1 -1
  3. package/dist/LinearWiggleDisplay/components/WiggleDisplayComponent.js.map +1 -1
  4. package/dist/LinearWiggleDisplay/models/model.d.ts +90 -26
  5. package/dist/LinearWiggleDisplay/models/model.js +2 -2
  6. package/dist/LinearWiggleDisplay/models/model.js.map +1 -1
  7. package/dist/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +3 -3
  8. package/dist/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.js +5 -6
  9. package/dist/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.js.map +1 -1
  10. package/dist/MultiLinearWiggleDisplay/models/configSchema.js +7 -0
  11. package/dist/MultiLinearWiggleDisplay/models/configSchema.js.map +1 -1
  12. package/dist/MultiLinearWiggleDisplay/models/model.d.ts +65 -7
  13. package/dist/MultiLinearWiggleDisplay/models/model.js +0 -1
  14. package/dist/MultiLinearWiggleDisplay/models/model.js.map +1 -1
  15. package/dist/WiggleBaseRenderer.js +2 -2
  16. package/dist/WiggleBaseRenderer.js.map +1 -1
  17. package/dist/index.d.ts +70 -8
  18. package/dist/shared/YScaleBar.d.ts +9 -0
  19. package/dist/{MultiLinearWiggleDisplay/components → shared}/YScaleBar.js +4 -3
  20. package/dist/shared/YScaleBar.js.map +1 -0
  21. package/dist/util.d.ts +1 -1
  22. package/esm/LinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +1 -1
  23. package/esm/LinearWiggleDisplay/components/WiggleDisplayComponent.js +1 -1
  24. package/esm/LinearWiggleDisplay/components/WiggleDisplayComponent.js.map +1 -1
  25. package/esm/LinearWiggleDisplay/models/model.d.ts +90 -26
  26. package/esm/LinearWiggleDisplay/models/model.js +1 -1
  27. package/esm/LinearWiggleDisplay/models/model.js.map +1 -1
  28. package/esm/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +3 -3
  29. package/esm/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.js +5 -6
  30. package/esm/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.js.map +1 -1
  31. package/esm/MultiLinearWiggleDisplay/models/configSchema.js +7 -0
  32. package/esm/MultiLinearWiggleDisplay/models/configSchema.js.map +1 -1
  33. package/esm/MultiLinearWiggleDisplay/models/model.d.ts +65 -7
  34. package/esm/MultiLinearWiggleDisplay/models/model.js +0 -1
  35. package/esm/MultiLinearWiggleDisplay/models/model.js.map +1 -1
  36. package/esm/WiggleBaseRenderer.js +2 -2
  37. package/esm/WiggleBaseRenderer.js.map +1 -1
  38. package/esm/index.d.ts +70 -8
  39. package/esm/shared/YScaleBar.d.ts +9 -0
  40. package/esm/{LinearWiggleDisplay/components → shared}/YScaleBar.js +4 -3
  41. package/esm/shared/YScaleBar.js.map +1 -0
  42. package/esm/util.d.ts +1 -1
  43. package/package.json +3 -3
  44. package/src/LinearWiggleDisplay/components/WiggleDisplayComponent.tsx +1 -1
  45. package/src/LinearWiggleDisplay/models/model.tsx +1 -1
  46. package/src/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.tsx +174 -181
  47. package/src/MultiLinearWiggleDisplay/models/configSchema.ts +8 -0
  48. package/src/MultiLinearWiggleDisplay/models/model.tsx +0 -1
  49. package/src/WiggleBaseRenderer.tsx +5 -3
  50. package/src/shared/YScaleBar.tsx +25 -0
  51. package/dist/LinearWiggleDisplay/components/YScaleBar.d.ts +0 -7
  52. package/dist/LinearWiggleDisplay/components/YScaleBar.js +0 -14
  53. package/dist/LinearWiggleDisplay/components/YScaleBar.js.map +0 -1
  54. package/dist/MultiLinearWiggleDisplay/components/YScaleBar.d.ts +0 -7
  55. package/dist/MultiLinearWiggleDisplay/components/YScaleBar.js.map +0 -1
  56. package/esm/LinearWiggleDisplay/components/YScaleBar.d.ts +0 -7
  57. package/esm/LinearWiggleDisplay/components/YScaleBar.js.map +0 -1
  58. package/esm/MultiLinearWiggleDisplay/components/YScaleBar.d.ts +0 -7
  59. package/esm/MultiLinearWiggleDisplay/components/YScaleBar.js +0 -9
  60. package/esm/MultiLinearWiggleDisplay/components/YScaleBar.js.map +0 -1
  61. package/src/LinearWiggleDisplay/components/YScaleBar.tsx +0 -26
  62. package/src/MultiLinearWiggleDisplay/components/YScaleBar.tsx +0 -25
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
+ import { useTheme } from '@mui/material';
2
3
  import { observer } from 'mobx-react';
3
4
  import { Axis, LEFT, RIGHT } from 'react-d3-axis-mod';
4
- const YScaleBar = observer(({ model, orientation, }) => {
5
+ export default observer(function ({ model, orientation, }) {
5
6
  const { ticks } = model;
6
- return ticks ? (React.createElement(Axis, { ...ticks, shadow: 2, format: (n) => n, style: { orient: orientation === 'left' ? LEFT : RIGHT } })) : null;
7
+ const theme = useTheme();
8
+ return ticks ? (React.createElement(Axis, { ...ticks, shadow: 2, format: (n) => n, style: { orient: orientation === 'left' ? LEFT : RIGHT }, bg: theme.palette.background.default, fg: theme.palette.text.primary })) : null;
7
9
  });
8
- export default YScaleBar;
9
10
  //# sourceMappingURL=YScaleBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YScaleBar.js","sourceRoot":"","sources":["../../src/shared/YScaleBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAA0B,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE7E,eAAe,QAAQ,CAAC,UAAU,EAChC,KAAK,EACL,WAAW,GAIZ;IACC,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAA;IACvB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,oBAAC,IAAI,OACC,KAAK,EACT,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,EACxB,KAAK,EAAE,EAAE,MAAM,EAAE,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,EACxD,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,EACpC,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,GAC9B,CACH,CAAC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC,CAAC,CAAA"}
package/esm/util.d.ts CHANGED
@@ -30,7 +30,7 @@ export declare function getScale({ domain, range, scaleType, pivotValue, inverte
30
30
  *
31
31
  * @param scaleType -
32
32
  */
33
- export declare function getOrigin(scaleType: string): 1 | 0;
33
+ export declare function getOrigin(scaleType: string): 0 | 1;
34
34
  /**
35
35
  * produces a "nice" domain that actually rounds down to 0 for the min
36
36
  * or 0 to the max depending on if all values are positive or negative
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-wiggle",
3
- "version": "2.3.3",
3
+ "version": "2.4.0",
4
4
  "description": "JBrowse 2 wiggle adapters, tracks, etc.",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -46,7 +46,7 @@
46
46
  "d3-scale": "^3.0.2",
47
47
  "fast-deep-equal": "^3.1.3",
48
48
  "is-object": "^1.0.1",
49
- "react-d3-axis-mod": "^0.1.8",
49
+ "react-d3-axis-mod": "^0.1.9",
50
50
  "react-draggable": "^4.4.5",
51
51
  "react-popper": "^2.0.0"
52
52
  },
@@ -69,5 +69,5 @@
69
69
  "distModule": "esm/index.js",
70
70
  "srcModule": "src/index.ts",
71
71
  "module": "esm/index.js",
72
- "gitHead": "283e0387ccd5acc9f092cf00804d1fcac212e68d"
72
+ "gitHead": "78707a2bc3ba8489f26a590ef83f62ede945d048"
73
73
  }
@@ -13,7 +13,7 @@ import {
13
13
 
14
14
  // locals
15
15
  import { WiggleDisplayModel } from '../models/model'
16
- import YScaleBar from './YScaleBar'
16
+ import YScaleBar from '../../shared/YScaleBar'
17
17
 
18
18
  type LGV = LinearGenomeViewModel
19
19
 
@@ -30,7 +30,7 @@ import {
30
30
  } from '../../util'
31
31
 
32
32
  import Tooltip from '../components/Tooltip'
33
- import { YScaleBar } from '../components/WiggleDisplayComponent'
33
+ import YScaleBar from '../../shared/YScaleBar'
34
34
 
35
35
  const SetMinMaxDlg = lazy(() => import('../../shared/SetMinMaxDialog'))
36
36
  const SetColorDlg = lazy(() => import('../components/SetColorDialog'))
@@ -13,7 +13,7 @@ import { observer } from 'mobx-react'
13
13
 
14
14
  // locals
15
15
  import { WiggleDisplayModel } from '../models/model'
16
- import YScaleBar from './YScaleBar'
16
+ import YScaleBar from '../../shared/YScaleBar'
17
17
 
18
18
  type LGV = LinearGenomeViewModel
19
19
 
@@ -29,37 +29,35 @@ function getOffset(model: WiggleDisplayModel) {
29
29
  : 10
30
30
  }
31
31
 
32
- const Wrapper = observer(
33
- ({
34
- children,
35
- model,
36
- exportSVG,
37
- }: {
38
- model: WiggleDisplayModel
39
- children: React.ReactNode
40
- exportSVG?: boolean
41
- }) => {
42
- if (exportSVG) {
43
- return <>{children}</>
44
- } else {
45
- const { height } = model
46
- return (
47
- <svg
48
- style={{
49
- position: 'absolute',
50
- top: 0,
51
- left: 0,
52
- pointerEvents: 'none',
53
- height,
54
- width: getContainingView(model).width,
55
- }}
56
- >
57
- {children}
58
- </svg>
59
- )
60
- }
61
- },
62
- )
32
+ const Wrapper = observer(function ({
33
+ children,
34
+ model,
35
+ exportSVG,
36
+ }: {
37
+ model: WiggleDisplayModel
38
+ children: React.ReactNode
39
+ exportSVG?: boolean
40
+ }) {
41
+ if (exportSVG) {
42
+ return <>{children}</>
43
+ } else {
44
+ const { height } = model
45
+ return (
46
+ <svg
47
+ style={{
48
+ position: 'absolute',
49
+ top: 0,
50
+ left: 0,
51
+ pointerEvents: 'none',
52
+ height,
53
+ width: getContainingView(model).width,
54
+ }}
55
+ >
56
+ {children}
57
+ </svg>
58
+ )
59
+ }
60
+ })
63
61
 
64
62
  const RectBg = (props: {
65
63
  x: number
@@ -91,161 +89,158 @@ const ScoreLegend = observer(({ model }: { model: WiggleDisplayModel }) => {
91
89
  )
92
90
  })
93
91
 
94
- const ColorLegend = observer(
95
- ({
96
- model,
97
- rowHeight,
98
- labelWidth,
99
- exportSVG,
100
- }: {
101
- model: WiggleDisplayModel
102
- rowHeight: number
103
- labelWidth: number
104
- exportSVG?: boolean
105
- }) => {
106
- const {
107
- needsCustomLegend,
108
- needsScalebar,
109
- needsFullHeightScalebar,
110
- rowHeightTooSmallForScalebar,
111
- renderColorBoxes,
112
- sources,
113
- } = model
114
- const svgFontSize = Math.min(rowHeight, 12)
115
- const canDisplayLabel = rowHeight > 11
116
- const colorBoxWidth = renderColorBoxes ? 15 : 0
117
- const legendWidth = labelWidth + colorBoxWidth + 5
118
- const svgOffset = exportSVG ? 10 : 0
119
- const extraOffset =
120
- svgOffset || (needsScalebar && !rowHeightTooSmallForScalebar ? 50 : 0)
121
- return sources ? (
122
- <>
123
- {
124
- /* 0.25 for hanging letters like g */
125
- needsFullHeightScalebar ? (
126
- <RectBg
127
- y={0}
128
- x={extraOffset}
129
- width={legendWidth}
130
- height={(sources.length + 0.25) * rowHeight}
131
- />
132
- ) : null
133
- }
134
- {sources.map((source, idx) => {
135
- const boxHeight = Math.min(20, rowHeight)
136
- return (
137
- <React.Fragment key={source.name + '-' + idx}>
138
- {!needsFullHeightScalebar ? (
139
- <RectBg
140
- y={idx * rowHeight + 1}
141
- x={extraOffset}
142
- width={legendWidth}
143
- height={boxHeight}
144
- />
145
- ) : null}
146
- {source.color ? (
147
- <RectBg
148
- y={idx * rowHeight + 1}
149
- x={extraOffset}
150
- width={colorBoxWidth}
151
- height={needsCustomLegend ? rowHeight : boxHeight}
152
- color={source.color}
153
- />
154
- ) : null}
155
- {canDisplayLabel ? (
156
- <text
157
- y={idx * rowHeight + 13}
158
- x={extraOffset + colorBoxWidth + 2}
159
- fontSize={svgFontSize}
160
- >
161
- {source.name}
162
- </text>
163
- ) : null}
164
- </React.Fragment>
165
- )
166
- })}
167
- </>
168
- ) : null
169
- },
170
- )
171
-
172
- export const StatBars = observer(
173
- (props: {
174
- model: WiggleDisplayModel
175
- orientation?: string
176
- exportSVG?: boolean
177
- }) => {
178
- const { model, orientation, exportSVG } = props
179
- const {
180
- stats,
181
- needsCustomLegend,
182
- needsFullHeightScalebar,
183
- rowHeightTooSmallForScalebar,
184
- rowHeight,
185
- sources,
186
- ticks,
187
- } = model
188
- const svgFontSize = Math.min(rowHeight, 12)
189
- const canDisplayLabel = rowHeight > 11
190
- const { width: viewWidth } = getContainingView(model) as LGV
191
- const minWidth = 20
192
-
193
- const ready = stats && sources
194
- if (!ready) {
195
- return null
196
- }
92
+ const ColorLegend = observer(function ({
93
+ model,
94
+ rowHeight,
95
+ labelWidth,
96
+ exportSVG,
97
+ }: {
98
+ model: WiggleDisplayModel
99
+ rowHeight: number
100
+ labelWidth: number
101
+ exportSVG?: boolean
102
+ }) {
103
+ const {
104
+ needsCustomLegend,
105
+ needsScalebar,
106
+ needsFullHeightScalebar,
107
+ rowHeightTooSmallForScalebar,
108
+ renderColorBoxes,
109
+ sources,
110
+ } = model
111
+ const svgFontSize = Math.min(rowHeight, 12)
112
+ const canDisplayLabel = rowHeight > 11
113
+ const colorBoxWidth = renderColorBoxes ? 15 : 0
114
+ const legendWidth = labelWidth + colorBoxWidth + 5
115
+ const svgOffset = exportSVG ? 10 : 0
116
+ const extraOffset =
117
+ svgOffset || (needsScalebar && !rowHeightTooSmallForScalebar ? 50 : 0)
118
+
119
+ return sources ? (
120
+ <>
121
+ {
122
+ /* 0.25 for hanging letters like g */
123
+ needsFullHeightScalebar ? (
124
+ <RectBg
125
+ y={0}
126
+ x={extraOffset}
127
+ width={legendWidth}
128
+ height={(sources.length + 0.25) * rowHeight}
129
+ />
130
+ ) : null
131
+ }
132
+ {sources.map((source, idx) => {
133
+ const boxHeight = Math.min(20, rowHeight)
134
+ return (
135
+ <React.Fragment key={source.name + '-' + idx}>
136
+ {!needsFullHeightScalebar ? (
137
+ <RectBg
138
+ y={idx * rowHeight + 1}
139
+ x={extraOffset}
140
+ width={legendWidth}
141
+ height={boxHeight}
142
+ />
143
+ ) : null}
144
+ {source.color ? (
145
+ <RectBg
146
+ y={idx * rowHeight + 1}
147
+ x={extraOffset}
148
+ width={colorBoxWidth}
149
+ height={needsCustomLegend ? rowHeight : boxHeight}
150
+ color={source.color}
151
+ />
152
+ ) : null}
153
+ {canDisplayLabel ? (
154
+ <text
155
+ y={idx * rowHeight + 13}
156
+ x={extraOffset + colorBoxWidth + 2}
157
+ fontSize={svgFontSize}
158
+ >
159
+ {source.name}
160
+ </text>
161
+ ) : null}
162
+ </React.Fragment>
163
+ )
164
+ })}
165
+ </>
166
+ ) : null
167
+ })
197
168
 
198
- const labelWidth = Math.max(
199
- ...(sources
200
- .map(s => measureText(s.name, svgFontSize))
201
- .map(width => (canDisplayLabel ? width : minWidth)) || [0]),
202
- )
169
+ export const StatBars = observer(function (props: {
170
+ model: WiggleDisplayModel
171
+ orientation?: string
172
+ exportSVG?: boolean
173
+ }) {
174
+ const { model, orientation, exportSVG } = props
175
+ const {
176
+ stats,
177
+ needsCustomLegend,
178
+ needsFullHeightScalebar,
179
+ rowHeightTooSmallForScalebar,
180
+ rowHeight,
181
+ sources,
182
+ ticks,
183
+ } = model
184
+ const svgFontSize = Math.min(rowHeight, 12)
185
+ const canDisplayLabel = rowHeight > 11
186
+ const { width: viewWidth } = getContainingView(model) as LGV
187
+ const minWidth = 20
188
+
189
+ const ready = stats && sources
190
+ if (!ready) {
191
+ return null
192
+ }
193
+
194
+ const labelWidth = Math.max(
195
+ ...(sources
196
+ .map(s => measureText(s.name, svgFontSize))
197
+ .map(width => (canDisplayLabel ? width : minWidth)) || [0]),
198
+ )
203
199
 
204
- return (
205
- <Wrapper {...props}>
206
- {needsFullHeightScalebar ? (
207
- <>
208
- <g transform={`translate(${!exportSVG ? getOffset(model) : 0},0)`}>
209
- <YScaleBar model={model} orientation={orientation} />
210
- </g>
211
- <g transform={`translate(${viewWidth - labelWidth - 100},0)`}>
212
- <ColorLegend
213
- exportSVG={exportSVG}
214
- model={model}
215
- rowHeight={12}
216
- labelWidth={labelWidth}
217
- />
218
- </g>
219
- </>
220
- ) : (
221
- <>
200
+ return (
201
+ <Wrapper {...props}>
202
+ {needsFullHeightScalebar ? (
203
+ <>
204
+ <g transform={`translate(${!exportSVG ? getOffset(model) : 0},0)`}>
205
+ <YScaleBar model={model} orientation={orientation} />
206
+ </g>
207
+ <g transform={`translate(${viewWidth - labelWidth - 100},0)`}>
222
208
  <ColorLegend
223
209
  exportSVG={exportSVG}
224
210
  model={model}
225
- rowHeight={model.rowHeight}
211
+ rowHeight={12}
226
212
  labelWidth={labelWidth}
227
213
  />
214
+ </g>
215
+ </>
216
+ ) : (
217
+ <>
218
+ <ColorLegend
219
+ exportSVG={exportSVG}
220
+ model={model}
221
+ rowHeight={model.rowHeight}
222
+ labelWidth={labelWidth}
223
+ />
224
+
225
+ {rowHeightTooSmallForScalebar || needsCustomLegend ? (
226
+ <ScoreLegend {...props} />
227
+ ) : (
228
+ sources.map((_source, idx) => (
229
+ <g
230
+ transform={`translate(0 ${rowHeight * idx})`}
231
+ key={JSON.stringify(ticks) + '-' + idx}
232
+ >
233
+ <YScaleBar model={model} orientation={orientation} />
234
+ </g>
235
+ ))
236
+ )}
237
+ </>
238
+ )}
239
+ </Wrapper>
240
+ )
241
+ })
228
242
 
229
- {rowHeightTooSmallForScalebar || needsCustomLegend ? (
230
- <ScoreLegend {...props} />
231
- ) : (
232
- sources.map((_source, idx) => (
233
- <g
234
- transform={`translate(0 ${rowHeight * idx})`}
235
- key={JSON.stringify(ticks) + '-' + idx}
236
- >
237
- <YScaleBar model={model} orientation={orientation} />
238
- </g>
239
- ))
240
- )}
241
- </>
242
- )}
243
- </Wrapper>
244
- )
245
- },
246
- )
247
-
248
- const LinearWiggleDisplay = observer((props: { model: WiggleDisplayModel }) => {
243
+ export default observer((props: { model: WiggleDisplayModel }) => {
249
244
  const { model } = props
250
245
 
251
246
  return (
@@ -256,6 +251,4 @@ const LinearWiggleDisplay = observer((props: { model: WiggleDisplayModel }) => {
256
251
  )
257
252
  })
258
253
 
259
- export default LinearWiggleDisplay
260
-
261
254
  export { YScaleBar }
@@ -122,6 +122,14 @@ export default function WiggleConfigFactory(pluginManager: PluginManager) {
122
122
  MultiLineRenderer: MultiLineRendererConfigSchema,
123
123
  MultiRowLineRenderer: MultiRowLineRendererConfigSchema,
124
124
  }),
125
+
126
+ /**
127
+ * #slot
128
+ */
129
+ height: {
130
+ type: 'number',
131
+ defaultValue: 200,
132
+ },
125
133
  },
126
134
  {
127
135
  /**
@@ -77,7 +77,6 @@ const stateModelFactory = (
77
77
  resolution: types.optional(types.number, 1),
78
78
  fill: types.maybe(types.boolean),
79
79
  minSize: types.maybe(types.number),
80
- height: 200,
81
80
  color: types.maybe(types.string),
82
81
  posColor: types.maybe(types.string),
83
82
  negColor: types.maybe(types.string),
@@ -73,9 +73,11 @@ export default abstract class WiggleBaseRenderer extends FeatureRendererType {
73
73
  return {
74
74
  ...results,
75
75
  ...rest,
76
- features: (reducedFeatures
77
- ? new Map(reducedFeatures.map((r: Feature) => [r.id(), r]))
78
- : results.features) as Map<string, Feature>,
76
+ features: reducedFeatures
77
+ ? new Map<string, Feature>(
78
+ reducedFeatures.map((r: Feature) => [r.id(), r]),
79
+ )
80
+ : results.features,
79
81
  height,
80
82
  width,
81
83
  containsNoTransferables: true,
@@ -0,0 +1,25 @@
1
+ import React from 'react'
2
+ import { useTheme } from '@mui/material'
3
+ import { observer } from 'mobx-react'
4
+ import { axisPropsFromTickScale, Axis, LEFT, RIGHT } from 'react-d3-axis-mod'
5
+
6
+ export default observer(function ({
7
+ model,
8
+ orientation,
9
+ }: {
10
+ model: { ticks?: ReturnType<typeof axisPropsFromTickScale> }
11
+ orientation?: string
12
+ }) {
13
+ const { ticks } = model
14
+ const theme = useTheme()
15
+ return ticks ? (
16
+ <Axis
17
+ {...ticks}
18
+ shadow={2}
19
+ format={(n: number) => n}
20
+ style={{ orient: orientation === 'left' ? LEFT : RIGHT }}
21
+ bg={theme.palette.background.default}
22
+ fg={theme.palette.text.primary}
23
+ />
24
+ ) : null
25
+ })
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- import { WiggleDisplayModel } from '../models/model';
3
- declare const YScaleBar: ({ model, orientation, }: {
4
- model: WiggleDisplayModel;
5
- orientation?: string | undefined;
6
- }) => JSX.Element | null;
7
- export default YScaleBar;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const react_1 = __importDefault(require("react"));
7
- const mobx_react_1 = require("mobx-react");
8
- const react_d3_axis_mod_1 = require("react-d3-axis-mod");
9
- const YScaleBar = (0, mobx_react_1.observer)(({ model, orientation, }) => {
10
- const { ticks } = model;
11
- return ticks ? (react_1.default.createElement(react_d3_axis_mod_1.Axis, { ...ticks, shadow: 2, format: (n) => n, style: { orient: orientation === 'left' ? react_d3_axis_mod_1.LEFT : react_d3_axis_mod_1.RIGHT } })) : null;
12
- });
13
- exports.default = YScaleBar;
14
- //# sourceMappingURL=YScaleBar.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"YScaleBar.js","sourceRoot":"","sources":["../../../src/LinearWiggleDisplay/components/YScaleBar.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,2CAAqC;AACrC,yDAAqD;AAGrD,MAAM,SAAS,GAAG,IAAA,qBAAQ,EACxB,CAAC,EACC,KAAK,EACL,WAAW,GAIZ,EAAE,EAAE;IACH,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAA;IAEvB,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,8BAAC,wBAAI,OACC,KAAK,EACT,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,EACxB,KAAK,EAAE,EAAE,MAAM,EAAE,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,wBAAI,CAAC,CAAC,CAAC,yBAAK,EAAE,GACxD,CACH,CAAC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC,CACF,CAAA;AACD,kBAAe,SAAS,CAAA"}
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- import { WiggleDisplayModel } from '../models/model';
3
- declare const YScaleBar: ({ model, orientation, }: {
4
- model: WiggleDisplayModel;
5
- orientation?: string | undefined;
6
- }) => JSX.Element | null;
7
- export default YScaleBar;
@@ -1 +0,0 @@
1
- {"version":3,"file":"YScaleBar.js","sourceRoot":"","sources":["../../../src/MultiLinearWiggleDisplay/components/YScaleBar.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,2CAAqC;AACrC,yDAAqD;AAGrD,MAAM,SAAS,GAAG,IAAA,qBAAQ,EACxB,CAAC,EACC,KAAK,EACL,WAAW,GAIZ,EAAE,EAAE;IACH,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAA;IACvB,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,8BAAC,wBAAI,OACC,KAAK,EACT,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,EACxB,KAAK,EAAE,EAAE,MAAM,EAAE,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,wBAAI,CAAC,CAAC,CAAC,yBAAK,EAAE,GACxD,CACH,CAAC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC,CACF,CAAA;AACD,kBAAe,SAAS,CAAA"}
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- import { WiggleDisplayModel } from '../models/model';
3
- declare const YScaleBar: ({ model, orientation, }: {
4
- model: WiggleDisplayModel;
5
- orientation?: string | undefined;
6
- }) => JSX.Element | null;
7
- export default YScaleBar;
@@ -1 +0,0 @@
1
- {"version":3,"file":"YScaleBar.js","sourceRoot":"","sources":["../../../src/LinearWiggleDisplay/components/YScaleBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAGrD,MAAM,SAAS,GAAG,QAAQ,CACxB,CAAC,EACC,KAAK,EACL,WAAW,GAIZ,EAAE,EAAE;IACH,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAA;IAEvB,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,oBAAC,IAAI,OACC,KAAK,EACT,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,EACxB,KAAK,EAAE,EAAE,MAAM,EAAE,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,GACxD,CACH,CAAC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC,CACF,CAAA;AACD,eAAe,SAAS,CAAA"}
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- import { WiggleDisplayModel } from '../models/model';
3
- declare const YScaleBar: ({ model, orientation, }: {
4
- model: WiggleDisplayModel;
5
- orientation?: string | undefined;
6
- }) => JSX.Element | null;
7
- export default YScaleBar;
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { observer } from 'mobx-react';
3
- import { Axis, LEFT, RIGHT } from 'react-d3-axis-mod';
4
- const YScaleBar = observer(({ model, orientation, }) => {
5
- const { ticks } = model;
6
- return ticks ? (React.createElement(Axis, { ...ticks, shadow: 2, format: (n) => n, style: { orient: orientation === 'left' ? LEFT : RIGHT } })) : null;
7
- });
8
- export default YScaleBar;
9
- //# sourceMappingURL=YScaleBar.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"YScaleBar.js","sourceRoot":"","sources":["../../../src/MultiLinearWiggleDisplay/components/YScaleBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAGrD,MAAM,SAAS,GAAG,QAAQ,CACxB,CAAC,EACC,KAAK,EACL,WAAW,GAIZ,EAAE,EAAE;IACH,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAA;IACvB,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,oBAAC,IAAI,OACC,KAAK,EACT,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,EACxB,KAAK,EAAE,EAAE,MAAM,EAAE,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,GACxD,CACH,CAAC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC,CACF,CAAA;AACD,eAAe,SAAS,CAAA"}
@@ -1,26 +0,0 @@
1
- import React from 'react'
2
- import { observer } from 'mobx-react'
3
- import { Axis, LEFT, RIGHT } from 'react-d3-axis-mod'
4
- import { WiggleDisplayModel } from '../models/model'
5
-
6
- const YScaleBar = observer(
7
- ({
8
- model,
9
- orientation,
10
- }: {
11
- model: WiggleDisplayModel
12
- orientation?: string
13
- }) => {
14
- const { ticks } = model
15
-
16
- return ticks ? (
17
- <Axis
18
- {...ticks}
19
- shadow={2}
20
- format={(n: number) => n}
21
- style={{ orient: orientation === 'left' ? LEFT : RIGHT }}
22
- />
23
- ) : null
24
- },
25
- )
26
- export default YScaleBar
@@ -1,25 +0,0 @@
1
- import React from 'react'
2
- import { observer } from 'mobx-react'
3
- import { Axis, LEFT, RIGHT } from 'react-d3-axis-mod'
4
- import { WiggleDisplayModel } from '../models/model'
5
-
6
- const YScaleBar = observer(
7
- ({
8
- model,
9
- orientation,
10
- }: {
11
- model: WiggleDisplayModel
12
- orientation?: string
13
- }) => {
14
- const { ticks } = model
15
- return ticks ? (
16
- <Axis
17
- {...ticks}
18
- shadow={2}
19
- format={(n: number) => n}
20
- style={{ orient: orientation === 'left' ? LEFT : RIGHT }}
21
- />
22
- ) : null
23
- },
24
- )
25
- export default YScaleBar