@jbrowse/plugin-wiggle 2.3.4 → 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.
- package/dist/LinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +1 -1
- package/dist/LinearWiggleDisplay/components/WiggleDisplayComponent.js +1 -1
- package/dist/LinearWiggleDisplay/components/WiggleDisplayComponent.js.map +1 -1
- package/dist/LinearWiggleDisplay/models/model.d.ts +90 -26
- package/dist/LinearWiggleDisplay/models/model.js +2 -2
- package/dist/LinearWiggleDisplay/models/model.js.map +1 -1
- package/dist/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +3 -3
- package/dist/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.js +5 -6
- package/dist/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.js.map +1 -1
- package/dist/MultiLinearWiggleDisplay/models/configSchema.js +7 -0
- package/dist/MultiLinearWiggleDisplay/models/configSchema.js.map +1 -1
- package/dist/MultiLinearWiggleDisplay/models/model.d.ts +65 -7
- package/dist/MultiLinearWiggleDisplay/models/model.js +0 -1
- package/dist/MultiLinearWiggleDisplay/models/model.js.map +1 -1
- package/dist/WiggleBaseRenderer.js +2 -2
- package/dist/WiggleBaseRenderer.js.map +1 -1
- package/dist/index.d.ts +70 -8
- package/dist/shared/YScaleBar.d.ts +9 -0
- package/dist/{MultiLinearWiggleDisplay/components → shared}/YScaleBar.js +4 -3
- package/dist/shared/YScaleBar.js.map +1 -0
- package/dist/util.d.ts +1 -1
- package/esm/LinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +1 -1
- package/esm/LinearWiggleDisplay/components/WiggleDisplayComponent.js +1 -1
- package/esm/LinearWiggleDisplay/components/WiggleDisplayComponent.js.map +1 -1
- package/esm/LinearWiggleDisplay/models/model.d.ts +90 -26
- package/esm/LinearWiggleDisplay/models/model.js +1 -1
- package/esm/LinearWiggleDisplay/models/model.js.map +1 -1
- package/esm/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +3 -3
- package/esm/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.js +5 -6
- package/esm/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.js.map +1 -1
- package/esm/MultiLinearWiggleDisplay/models/configSchema.js +7 -0
- package/esm/MultiLinearWiggleDisplay/models/configSchema.js.map +1 -1
- package/esm/MultiLinearWiggleDisplay/models/model.d.ts +65 -7
- package/esm/MultiLinearWiggleDisplay/models/model.js +0 -1
- package/esm/MultiLinearWiggleDisplay/models/model.js.map +1 -1
- package/esm/WiggleBaseRenderer.js +2 -2
- package/esm/WiggleBaseRenderer.js.map +1 -1
- package/esm/index.d.ts +70 -8
- package/esm/shared/YScaleBar.d.ts +9 -0
- package/esm/{LinearWiggleDisplay/components → shared}/YScaleBar.js +4 -3
- package/esm/shared/YScaleBar.js.map +1 -0
- package/esm/util.d.ts +1 -1
- package/package.json +3 -3
- package/src/LinearWiggleDisplay/components/WiggleDisplayComponent.tsx +1 -1
- package/src/LinearWiggleDisplay/models/model.tsx +1 -1
- package/src/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.tsx +174 -181
- package/src/MultiLinearWiggleDisplay/models/configSchema.ts +8 -0
- package/src/MultiLinearWiggleDisplay/models/model.tsx +0 -1
- package/src/WiggleBaseRenderer.tsx +5 -3
- package/src/shared/YScaleBar.tsx +25 -0
- package/dist/LinearWiggleDisplay/components/YScaleBar.d.ts +0 -7
- package/dist/LinearWiggleDisplay/components/YScaleBar.js +0 -14
- package/dist/LinearWiggleDisplay/components/YScaleBar.js.map +0 -1
- package/dist/MultiLinearWiggleDisplay/components/YScaleBar.d.ts +0 -7
- package/dist/MultiLinearWiggleDisplay/components/YScaleBar.js.map +0 -1
- package/esm/LinearWiggleDisplay/components/YScaleBar.d.ts +0 -7
- package/esm/LinearWiggleDisplay/components/YScaleBar.js.map +0 -1
- package/esm/MultiLinearWiggleDisplay/components/YScaleBar.d.ts +0 -7
- package/esm/MultiLinearWiggleDisplay/components/YScaleBar.js +0 -9
- package/esm/MultiLinearWiggleDisplay/components/YScaleBar.js.map +0 -1
- package/src/LinearWiggleDisplay/components/YScaleBar.tsx +0 -26
- 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
|
-
|
|
5
|
+
export default observer(function ({ model, orientation, }) {
|
|
5
6
|
const { ticks } = model;
|
|
6
|
-
|
|
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):
|
|
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
|
+
"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.
|
|
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": "
|
|
72
|
+
"gitHead": "78707a2bc3ba8489f26a590ef83f62ede945d048"
|
|
73
73
|
}
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
} from '../../util'
|
|
31
31
|
|
|
32
32
|
import Tooltip from '../components/Tooltip'
|
|
33
|
-
import
|
|
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 '
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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={
|
|
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
|
-
|
|
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:
|
|
77
|
-
? new Map
|
|
78
|
-
|
|
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,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 +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 +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,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
|