@jbrowse/plugin-lollipop 2.6.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/LICENSE +201 -0
- package/dist/LinearLollipopDisplay/configSchema.d.ts +26 -0
- package/dist/LinearLollipopDisplay/configSchema.js +13 -0
- package/dist/LinearLollipopDisplay/configSchema.js.map +1 -0
- package/dist/LinearLollipopDisplay/index.d.ts +2 -0
- package/dist/LinearLollipopDisplay/index.js +8 -0
- package/dist/LinearLollipopDisplay/index.js.map +1 -0
- package/dist/LinearLollipopDisplay/model.d.ts +303 -0
- package/dist/LinearLollipopDisplay/model.js +36 -0
- package/dist/LinearLollipopDisplay/model.js.map +1 -0
- package/dist/LollipopRenderer/Layout.d.ts +55 -0
- package/dist/LollipopRenderer/Layout.js +116 -0
- package/dist/LollipopRenderer/Layout.js.map +1 -0
- package/dist/LollipopRenderer/LollipopRenderer.d.ts +13 -0
- package/dist/LollipopRenderer/LollipopRenderer.js +52 -0
- package/dist/LollipopRenderer/LollipopRenderer.js.map +1 -0
- package/dist/LollipopRenderer/components/Lollipop.d.ts +3 -0
- package/dist/LollipopRenderer/components/Lollipop.js +63 -0
- package/dist/LollipopRenderer/components/Lollipop.js.map +1 -0
- package/dist/LollipopRenderer/components/LollipopRendering.d.ts +3 -0
- package/dist/LollipopRenderer/components/LollipopRendering.js +80 -0
- package/dist/LollipopRenderer/components/LollipopRendering.js.map +1 -0
- package/dist/LollipopRenderer/components/ScoreText.d.ts +15 -0
- package/dist/LollipopRenderer/components/ScoreText.js +20 -0
- package/dist/LollipopRenderer/components/ScoreText.js.map +1 -0
- package/dist/LollipopRenderer/components/Stick.d.ts +15 -0
- package/dist/LollipopRenderer/components/Stick.js +12 -0
- package/dist/LollipopRenderer/components/Stick.js.map +1 -0
- package/dist/LollipopRenderer/configSchema.d.ts +56 -0
- package/dist/LollipopRenderer/configSchema.js +59 -0
- package/dist/LollipopRenderer/configSchema.js.map +1 -0
- package/dist/LollipopRenderer/index.d.ts +3 -0
- package/dist/LollipopRenderer/index.js +13 -0
- package/dist/LollipopRenderer/index.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +60 -0
- package/dist/index.js.map +1 -0
- package/esm/LinearLollipopDisplay/configSchema.d.ts +26 -0
- package/esm/LinearLollipopDisplay/configSchema.js +9 -0
- package/esm/LinearLollipopDisplay/configSchema.js.map +1 -0
- package/esm/LinearLollipopDisplay/index.d.ts +2 -0
- package/esm/LinearLollipopDisplay/index.js +3 -0
- package/esm/LinearLollipopDisplay/index.js.map +1 -0
- package/esm/LinearLollipopDisplay/model.d.ts +303 -0
- package/esm/LinearLollipopDisplay/model.js +32 -0
- package/esm/LinearLollipopDisplay/model.js.map +1 -0
- package/esm/LollipopRenderer/Layout.d.ts +55 -0
- package/esm/LollipopRenderer/Layout.js +111 -0
- package/esm/LollipopRenderer/Layout.js.map +1 -0
- package/esm/LollipopRenderer/LollipopRenderer.d.ts +13 -0
- package/esm/LollipopRenderer/LollipopRenderer.js +23 -0
- package/esm/LollipopRenderer/LollipopRenderer.js.map +1 -0
- package/esm/LollipopRenderer/components/Lollipop.d.ts +3 -0
- package/esm/LollipopRenderer/components/Lollipop.js +58 -0
- package/esm/LollipopRenderer/components/Lollipop.js.map +1 -0
- package/esm/LollipopRenderer/components/LollipopRendering.d.ts +3 -0
- package/esm/LollipopRenderer/components/LollipopRendering.js +75 -0
- package/esm/LollipopRenderer/components/LollipopRendering.js.map +1 -0
- package/esm/LollipopRenderer/components/ScoreText.d.ts +15 -0
- package/esm/LollipopRenderer/components/ScoreText.js +14 -0
- package/esm/LollipopRenderer/components/ScoreText.js.map +1 -0
- package/esm/LollipopRenderer/components/Stick.d.ts +15 -0
- package/esm/LollipopRenderer/components/Stick.js +7 -0
- package/esm/LollipopRenderer/components/Stick.js.map +1 -0
- package/esm/LollipopRenderer/configSchema.d.ts +56 -0
- package/esm/LollipopRenderer/configSchema.js +57 -0
- package/esm/LollipopRenderer/configSchema.js.map +1 -0
- package/esm/LollipopRenderer/index.d.ts +3 -0
- package/esm/LollipopRenderer/index.js +4 -0
- package/esm/LollipopRenderer/index.js.map +1 -0
- package/esm/index.d.ts +6 -0
- package/esm/index.js +31 -0
- package/esm/index.js.map +1 -0
- package/package.json +56 -0
- package/src/LinearLollipopDisplay/configSchema.ts +14 -0
- package/src/LinearLollipopDisplay/index.ts +2 -0
- package/src/LinearLollipopDisplay/model.ts +40 -0
- package/src/LollipopRenderer/Layout.ts +172 -0
- package/src/LollipopRenderer/LollipopRenderer.js +29 -0
- package/src/LollipopRenderer/components/Lollipop.tsx +113 -0
- package/src/LollipopRenderer/components/LollipopRendering.test.js +45 -0
- package/src/LollipopRenderer/components/LollipopRendering.tsx +140 -0
- package/src/LollipopRenderer/components/ScoreText.tsx +43 -0
- package/src/LollipopRenderer/components/Stick.tsx +36 -0
- package/src/LollipopRenderer/components/__snapshots__/LollipopRendering.test.js.snap +37 -0
- package/src/LollipopRenderer/configSchema.ts +63 -0
- package/src/LollipopRenderer/index.ts +3 -0
- package/src/index.ts +41 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import BoxRendererType, { LayoutSession, } from '@jbrowse/core/pluggableElementTypes/renderers/BoxRendererType';
|
|
2
|
+
import MultiLayout from '@jbrowse/core/util/layouts/MultiLayout';
|
|
3
|
+
import { FloatingLayout, PrecomputedFloatingLayout } from './Layout';
|
|
4
|
+
class FloatingLayoutSession extends LayoutSession {
|
|
5
|
+
makeLayout() {
|
|
6
|
+
'sequenceAdapter';
|
|
7
|
+
const { end, start } = this.regions[0];
|
|
8
|
+
const widthPx = (end - start) / this.bpPerPx;
|
|
9
|
+
return new MultiLayout(FloatingLayout, { width: widthPx });
|
|
10
|
+
}
|
|
11
|
+
layoutIsValid( /* layout */) {
|
|
12
|
+
return false; // layout.left layout.width === this.width
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export default class extends BoxRendererType {
|
|
16
|
+
createSession(args) {
|
|
17
|
+
return new FloatingLayoutSession(args);
|
|
18
|
+
}
|
|
19
|
+
deserializeLayoutInClient(json) {
|
|
20
|
+
return new PrecomputedFloatingLayout(json);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=LollipopRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LollipopRenderer.js","sourceRoot":"","sources":["../../src/LollipopRenderer/LollipopRenderer.js"],"names":[],"mappings":"AAAA,OAAO,eAAe,EAAE,EACtB,aAAa,GACd,MAAM,+DAA+D,CAAA;AACtE,OAAO,WAAW,MAAM,wCAAwC,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAA;AAEpE,MAAM,qBAAsB,SAAQ,aAAa;IAC/C,UAAU;QACR,iBAAiB,CAAA;QAEjB,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;QACtC,MAAM,OAAO,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,CAAA;QAC5C,OAAO,IAAI,WAAW,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAA;IAC5D,CAAC;IAED,aAAa,EAAC,YAAY;QACxB,OAAO,KAAK,CAAA,CAAC,0CAA0C;IACzD,CAAC;CACF;AAED,MAAM,CAAC,OAAO,MAAO,SAAQ,eAAe;IAC1C,aAAa,CAAC,IAAI;QAChB,OAAO,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAA;IACxC,CAAC;IAED,yBAAyB,CAAC,IAAI;QAC5B,OAAO,IAAI,yBAAyB,CAAC,IAAI,CAAC,CAAA;IAC5C,CAAC;CACF"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { readConfObject } from '@jbrowse/core/configuration';
|
|
3
|
+
import { observer } from 'mobx-react';
|
|
4
|
+
import ScoreText from './ScoreText';
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
|
+
export default observer(function Lollipop(props) {
|
|
7
|
+
const { feature, config, layoutRecord, selectedFeatureId } = props;
|
|
8
|
+
const { anchorLocation, y, data: { radiusPx }, } = layoutRecord;
|
|
9
|
+
const onFeatureMouseDown = (event) => {
|
|
10
|
+
const { onFeatureMouseDown: handler, feature } = props;
|
|
11
|
+
return handler === null || handler === void 0 ? void 0 : handler(event, feature.id());
|
|
12
|
+
};
|
|
13
|
+
const onFeatureMouseEnter = (event) => {
|
|
14
|
+
const { onFeatureMouseEnter: handler, feature } = props;
|
|
15
|
+
return handler === null || handler === void 0 ? void 0 : handler(event, feature.id());
|
|
16
|
+
};
|
|
17
|
+
const onFeatureMouseOut = (event) => {
|
|
18
|
+
const { onFeatureMouseOut: handler, feature } = props;
|
|
19
|
+
return handler === null || handler === void 0 ? void 0 : handler(event, feature.id());
|
|
20
|
+
};
|
|
21
|
+
const onFeatureMouseOver = (event) => {
|
|
22
|
+
const { onFeatureMouseOver: handler, feature } = props;
|
|
23
|
+
return handler === null || handler === void 0 ? void 0 : handler(event, feature.id());
|
|
24
|
+
};
|
|
25
|
+
const onFeatureMouseUp = (event) => {
|
|
26
|
+
const { onFeatureMouseUp: handler, feature } = props;
|
|
27
|
+
return handler === null || handler === void 0 ? void 0 : handler(event, feature.id());
|
|
28
|
+
};
|
|
29
|
+
const onFeatureMouseLeave = (event) => {
|
|
30
|
+
const { onFeatureMouseLeave: handler, feature } = props;
|
|
31
|
+
return handler === null || handler === void 0 ? void 0 : handler(event, feature.id());
|
|
32
|
+
};
|
|
33
|
+
const onFeatureMouseMove = (event) => {
|
|
34
|
+
const { onFeatureMouseMove: handler, feature } = props;
|
|
35
|
+
return handler === null || handler === void 0 ? void 0 : handler(event, feature.id());
|
|
36
|
+
};
|
|
37
|
+
const onFeatureClick = (event) => {
|
|
38
|
+
const { onFeatureClick: handler, feature } = props;
|
|
39
|
+
event.stopPropagation();
|
|
40
|
+
return handler === null || handler === void 0 ? void 0 : handler(event, feature.id());
|
|
41
|
+
};
|
|
42
|
+
const styleOuter = {
|
|
43
|
+
fill: readConfObject(config, 'strokeColor', { feature }),
|
|
44
|
+
};
|
|
45
|
+
if (String(selectedFeatureId) === String(feature.id())) {
|
|
46
|
+
styleOuter.fill = 'red';
|
|
47
|
+
}
|
|
48
|
+
const styleInner = {
|
|
49
|
+
fill: readConfObject(config, 'innerColor', { feature }),
|
|
50
|
+
};
|
|
51
|
+
const strokeWidth = readConfObject(config, 'strokeWidth', { feature });
|
|
52
|
+
return (React.createElement("g", { "data-testid": feature.id() },
|
|
53
|
+
React.createElement("title", null, readConfObject(config, 'caption', { feature })),
|
|
54
|
+
React.createElement("circle", { cx: anchorLocation, cy: y + radiusPx, r: radiusPx, style: styleOuter, onMouseDown: onFeatureMouseDown, onMouseEnter: onFeatureMouseEnter, onMouseOut: onFeatureMouseOut, onMouseOver: onFeatureMouseOver, onMouseUp: onFeatureMouseUp, onMouseLeave: onFeatureMouseLeave, onMouseMove: onFeatureMouseMove, onClick: onFeatureClick, onFocus: onFeatureMouseOver, onBlur: onFeatureMouseOut }),
|
|
55
|
+
radiusPx - strokeWidth <= 2 ? null : (React.createElement("circle", { cx: anchorLocation, cy: y + radiusPx, r: radiusPx - strokeWidth, style: styleInner, onMouseDown: onFeatureMouseDown, onMouseEnter: onFeatureMouseEnter, onMouseOut: onFeatureMouseOut, onMouseOver: onFeatureMouseOver, onMouseUp: onFeatureMouseUp, onMouseLeave: onFeatureMouseLeave, onMouseMove: onFeatureMouseMove, onClick: onFeatureClick, onFocus: onFeatureMouseOver, onBlur: onFeatureMouseOut })),
|
|
56
|
+
React.createElement(ScoreText, { feature: feature, config: config, layoutRecord: layoutRecord })));
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=Lollipop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Lollipop.js","sourceRoot":"","sources":["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AC7B,WAAW,EAAE,kBAAkB,EAC/B,SAAS,EAAE,gBAAgB,EAC3B,YAAY,EAAE,mBAAmB,EACjC,WAAW,EAAE,kBAAkB,EAC/B,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,kBAAkB,EAC3B,MAAM,EAAE,iBAAiB,GACzB,CACH;QACD,oBAAC,SAAS,IACR,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,GAC1B,CACA,CACL,CAAA;AACH,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { readConfObject, } from '@jbrowse/core/configuration';
|
|
3
|
+
import { bpToPx } from '@jbrowse/core/util';
|
|
4
|
+
import { observer } from 'mobx-react';
|
|
5
|
+
// locals
|
|
6
|
+
import Lollipop from './Lollipop';
|
|
7
|
+
import Stick from './Stick';
|
|
8
|
+
function layoutFeat(args) {
|
|
9
|
+
const { feature, bpPerPx, config, region, layout } = args;
|
|
10
|
+
const centerBp = Math.abs(feature.get('end') + feature.get('start')) / 2;
|
|
11
|
+
const centerPx = bpToPx(centerBp, region, bpPerPx);
|
|
12
|
+
const radiusPx = readConfObject(config, 'radius', { feature });
|
|
13
|
+
if (!radiusPx) {
|
|
14
|
+
console.error(new Error(`lollipop radius ${radiusPx} configured for feature ${feature.id()}`));
|
|
15
|
+
}
|
|
16
|
+
layout.add(feature.id(), centerPx, radiusPx * 2, radiusPx * 2, {
|
|
17
|
+
featureId: feature.id(),
|
|
18
|
+
anchorX: centerPx,
|
|
19
|
+
radiusPx,
|
|
20
|
+
score: readConfObject(args.config, 'score', { feature }),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
|
+
export default observer(function LollipopRendering(props) {
|
|
25
|
+
const onMouseDown = (event) => {
|
|
26
|
+
const { onMouseDown: handler } = props;
|
|
27
|
+
return handler === null || handler === void 0 ? void 0 : handler(event);
|
|
28
|
+
};
|
|
29
|
+
const onMouseUp = (event) => {
|
|
30
|
+
const { onMouseUp: handler } = props;
|
|
31
|
+
return handler === null || handler === void 0 ? void 0 : handler(event);
|
|
32
|
+
};
|
|
33
|
+
const onMouseEnter = (event) => {
|
|
34
|
+
const { onMouseEnter: handler } = props;
|
|
35
|
+
return handler === null || handler === void 0 ? void 0 : handler(event);
|
|
36
|
+
};
|
|
37
|
+
const onMouseLeave = (event) => {
|
|
38
|
+
const { onMouseLeave: handler } = props;
|
|
39
|
+
return handler === null || handler === void 0 ? void 0 : handler(event);
|
|
40
|
+
};
|
|
41
|
+
const onMouseOver = (event) => {
|
|
42
|
+
const { onMouseOver: handler } = props;
|
|
43
|
+
return handler === null || handler === void 0 ? void 0 : handler(event);
|
|
44
|
+
};
|
|
45
|
+
const onMouseOut = (event) => {
|
|
46
|
+
const { onMouseOut: handler } = props;
|
|
47
|
+
return handler === null || handler === void 0 ? void 0 : handler(event);
|
|
48
|
+
};
|
|
49
|
+
const onClick = (event) => {
|
|
50
|
+
const { onClick: handler } = props;
|
|
51
|
+
return handler === null || handler === void 0 ? void 0 : handler(event);
|
|
52
|
+
};
|
|
53
|
+
const { regions, bpPerPx, layout, config, features = new Map(), displayModel = {}, } = props;
|
|
54
|
+
const { selectedFeatureId } = displayModel;
|
|
55
|
+
const [region] = regions;
|
|
56
|
+
for (const feature of features.values()) {
|
|
57
|
+
layoutFeat({
|
|
58
|
+
feature,
|
|
59
|
+
bpPerPx,
|
|
60
|
+
region,
|
|
61
|
+
config,
|
|
62
|
+
layout,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
const width = (region.end - region.start) / bpPerPx;
|
|
66
|
+
const records = [...layout.getLayout(config).values()];
|
|
67
|
+
const height = layout.getTotalHeight();
|
|
68
|
+
return (React.createElement("svg", { width: width, height: height, style: { position: 'relative' }, onMouseDown: onMouseDown, onMouseUp: onMouseUp, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onMouseOver: onMouseOver, onMouseOut: onMouseOut, onFocus: onMouseEnter, onBlur: onMouseLeave, onClick: onClick }, records.map(layoutRecord => {
|
|
69
|
+
const feature = features.get(layoutRecord.data.featureId);
|
|
70
|
+
return (React.createElement(React.Fragment, { key: feature.id() },
|
|
71
|
+
React.createElement(Stick, { ...props, config: config, layoutRecord: layoutRecord, feature: feature, key: `stick-${feature.id()}` }),
|
|
72
|
+
React.createElement(Lollipop, { ...props, layoutRecord: layoutRecord, feature: feature, key: `body-${feature.id()}`, selectedFeatureId: selectedFeatureId })));
|
|
73
|
+
})));
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=LollipopRendering.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LollipopRendering.js","sourceRoot":"","sources":["../../../src/LollipopRenderer/components/LollipopRendering.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAEL,cAAc,GACf,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAmB,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,SAAS;AACT,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,KAAK,MAAM,SAAS,CAAA;AAE3B,SAAS,UAAU,CAAC,IAMnB;IACC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IAEzD,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAA;IACxE,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;IAClD,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,EAAE,QAA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C,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC,CAAA;IACtD,MAAM,MAAM,GAAG,MAAM,CAAC,cAAc,EAAE,CAAA;IAEtC,OAAO,CACL,6BACE,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,EAC/B,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,IAEf,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;QAC1B,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QACzD,OAAO,CACL,oBAAC,KAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE;YAC/B,oBAAC,KAAK,OACA,KAAK,EACT,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,SAAS,OAAO,CAAC,EAAE,EAAE,EAAE,GAC5B;YACF,oBAAC,QAAQ,OACH,KAAK,EACT,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,QAAQ,OAAO,CAAC,EAAE,EAAE,EAAE,EAC3B,iBAAiB,EAAE,iBAAiB,GACpC,CACa,CAClB,CAAA;IACH,CAAC,CAAC,CACE,CACP,CAAA;AACH,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
+
import { Feature } from '@jbrowse/core/util';
|
|
4
|
+
export default function ScoreText({ feature, config, layoutRecord: { y, data: { anchorX, radiusPx, score }, }, }: {
|
|
5
|
+
feature: Feature;
|
|
6
|
+
config: AnyConfigurationModel;
|
|
7
|
+
layoutRecord: {
|
|
8
|
+
y: number;
|
|
9
|
+
data: {
|
|
10
|
+
anchorX: number;
|
|
11
|
+
radiusPx: number;
|
|
12
|
+
score: number;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
}): React.JSX.Element | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { readConfObject, } from '@jbrowse/core/configuration';
|
|
3
|
+
import { contrastingTextColor } from '@jbrowse/core/util/color';
|
|
4
|
+
export default function ScoreText({ feature, config, layoutRecord: { y, data: { anchorX, radiusPx, score }, }, }) {
|
|
5
|
+
const innerColor = readConfObject(config, 'innerColor', { feature });
|
|
6
|
+
const scoreString = String(score);
|
|
7
|
+
const fontWidth = (radiusPx * 2) / scoreString.length;
|
|
8
|
+
const fontHeight = fontWidth * 1.1;
|
|
9
|
+
if (fontHeight < 12) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
return (React.createElement("text", { style: { fontSize: fontHeight, fill: contrastingTextColor(innerColor) }, x: anchorX, y: y + radiusPx - fontHeight / 2.4, textAnchor: "middle", dominantBaseline: "hanging" }, scoreString));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=ScoreText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScoreText.js","sourceRoot":"","sources":["../../../src/LollipopRenderer/components/ScoreText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAEL,cAAc,GACf,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAG/D,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,OAAO,EACP,MAAM,EACN,YAAY,EAAE,EACZ,CAAC,EACD,IAAI,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,GACnC,GAQF;IACC,MAAM,UAAU,GAAG,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,CAAC,CAAA;IAEpE,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;IACjC,MAAM,SAAS,GAAG,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,WAAW,CAAC,MAAM,CAAA;IACrD,MAAM,UAAU,GAAG,SAAS,GAAG,GAAG,CAAA;IAClC,IAAI,UAAU,GAAG,EAAE,EAAE;QACnB,OAAO,IAAI,CAAA;KACZ;IACD,OAAO,CACL,8BACE,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,oBAAoB,CAAC,UAAU,CAAC,EAAE,EACvE,CAAC,EAAE,OAAO,EACV,CAAC,EAAE,CAAC,GAAG,QAAQ,GAAG,UAAU,GAAG,GAAG,EAClC,UAAU,EAAC,QAAQ,EACnB,gBAAgB,EAAC,SAAS,IAEzB,WAAW,CACP,CACR,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
+
import { Feature } from '@jbrowse/core/util';
|
|
4
|
+
declare const _default: ({ feature, config, layoutRecord: { anchorLocation, y, data: { radiusPx }, }, }: {
|
|
5
|
+
feature: Feature;
|
|
6
|
+
config: AnyConfigurationModel;
|
|
7
|
+
layoutRecord: {
|
|
8
|
+
anchorLocation: number;
|
|
9
|
+
y: number;
|
|
10
|
+
data: {
|
|
11
|
+
radiusPx: number;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
}) => React.JSX.Element;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { readConfObject, } from '@jbrowse/core/configuration';
|
|
3
|
+
import { observer } from 'mobx-react';
|
|
4
|
+
export default observer(function Stick({ feature, config, layoutRecord: { anchorLocation, y, data: { radiusPx }, }, }) {
|
|
5
|
+
return (React.createElement("line", { x1: anchorLocation, y1: 0, x2: anchorLocation, y2: y + 2 * radiusPx, stroke: readConfObject(config, 'stickColor', { feature }), strokeWidth: readConfObject(config, 'stickWidth', { feature }) }));
|
|
6
|
+
});
|
|
7
|
+
//# sourceMappingURL=Stick.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stick.js","sourceRoot":"","sources":["../../../src/LollipopRenderer/components/Stick.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAEL,cAAc,GACf,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGrC,eAAe,QAAQ,CAAC,SAAS,KAAK,CAAC,EACrC,OAAO,EACP,MAAM,EACN,YAAY,EAAE,EACZ,cAAc,EACd,CAAC,EACD,IAAI,EAAE,EAAE,QAAQ,EAAE,GACnB,GASF;IACC,OAAO,CACL,8BACE,EAAE,EAAE,cAAc,EAClB,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,cAAc,EAClB,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,QAAQ,EACpB,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,CAAC,EACzD,WAAW,EAAE,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,CAAC,GAC9D,CACH,CAAA;AACH,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
declare const _default: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
+
strokeColor: {
|
|
3
|
+
type: string;
|
|
4
|
+
description: string;
|
|
5
|
+
defaultValue: string;
|
|
6
|
+
contextVariable: string[];
|
|
7
|
+
};
|
|
8
|
+
innerColor: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
defaultValue: string;
|
|
12
|
+
contextVariable: string[];
|
|
13
|
+
};
|
|
14
|
+
strokeWidth: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
defaultValue: number;
|
|
18
|
+
contextVariable: string[];
|
|
19
|
+
};
|
|
20
|
+
radius: {
|
|
21
|
+
type: string;
|
|
22
|
+
description: string;
|
|
23
|
+
defaultValue: string;
|
|
24
|
+
contextVariable: string[];
|
|
25
|
+
};
|
|
26
|
+
caption: {
|
|
27
|
+
type: string;
|
|
28
|
+
description: string;
|
|
29
|
+
defaultValue: string;
|
|
30
|
+
contextVariable: string[];
|
|
31
|
+
};
|
|
32
|
+
minStickLength: {
|
|
33
|
+
type: string;
|
|
34
|
+
description: string;
|
|
35
|
+
defaultValue: number;
|
|
36
|
+
};
|
|
37
|
+
stickColor: {
|
|
38
|
+
type: string;
|
|
39
|
+
description: string;
|
|
40
|
+
defaultValue: string;
|
|
41
|
+
contextVariable: string[];
|
|
42
|
+
};
|
|
43
|
+
stickWidth: {
|
|
44
|
+
type: string;
|
|
45
|
+
description: string;
|
|
46
|
+
defaultValue: number;
|
|
47
|
+
contextVariable: string[];
|
|
48
|
+
};
|
|
49
|
+
score: {
|
|
50
|
+
type: string;
|
|
51
|
+
description: string;
|
|
52
|
+
defaultValue: string;
|
|
53
|
+
contextVariable: string[];
|
|
54
|
+
};
|
|
55
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
56
|
+
export default _default;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
+
export default ConfigurationSchema('LollipopRenderer', {
|
|
3
|
+
strokeColor: {
|
|
4
|
+
type: 'color',
|
|
5
|
+
description: 'the outer color of each lollipop',
|
|
6
|
+
defaultValue: 'green',
|
|
7
|
+
contextVariable: ['feature'],
|
|
8
|
+
},
|
|
9
|
+
innerColor: {
|
|
10
|
+
type: 'color',
|
|
11
|
+
description: 'the inner color of each lollipop',
|
|
12
|
+
defaultValue: '#7fc75f',
|
|
13
|
+
contextVariable: ['feature'],
|
|
14
|
+
},
|
|
15
|
+
strokeWidth: {
|
|
16
|
+
type: 'number',
|
|
17
|
+
description: 'width of the stroked border',
|
|
18
|
+
defaultValue: 4,
|
|
19
|
+
contextVariable: ['feature'],
|
|
20
|
+
},
|
|
21
|
+
radius: {
|
|
22
|
+
type: 'number',
|
|
23
|
+
description: 'radius in pixels of each lollipop body',
|
|
24
|
+
defaultValue: `jexl:sqrt(max(3, (get(feature,'score')*10)/3.14))`,
|
|
25
|
+
contextVariable: ['feature'],
|
|
26
|
+
},
|
|
27
|
+
caption: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
description: 'the tooltip caption displayed when the mouse hovers over a lollipop',
|
|
30
|
+
defaultValue: `jexl:get(feature,'name')`,
|
|
31
|
+
contextVariable: ['feature'],
|
|
32
|
+
},
|
|
33
|
+
minStickLength: {
|
|
34
|
+
type: 'number',
|
|
35
|
+
description: 'minimum lollipop "stick" length, in pixels',
|
|
36
|
+
defaultValue: 5,
|
|
37
|
+
},
|
|
38
|
+
stickColor: {
|
|
39
|
+
type: 'color',
|
|
40
|
+
description: 'color of the lollipop stick',
|
|
41
|
+
defaultValue: 'black',
|
|
42
|
+
contextVariable: ['feature'],
|
|
43
|
+
},
|
|
44
|
+
stickWidth: {
|
|
45
|
+
type: 'number',
|
|
46
|
+
description: 'width in pixels of the lollipop stick',
|
|
47
|
+
defaultValue: 2,
|
|
48
|
+
contextVariable: ['feature'],
|
|
49
|
+
},
|
|
50
|
+
score: {
|
|
51
|
+
type: 'number',
|
|
52
|
+
description: 'the "score" of each lollipop, displayed as a number in the center of the circle',
|
|
53
|
+
defaultValue: `jexl:get(feature,'score')`,
|
|
54
|
+
contextVariable: ['feature'],
|
|
55
|
+
},
|
|
56
|
+
}, { explicitlyTyped: true });
|
|
57
|
+
//# sourceMappingURL=configSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/LollipopRenderer/configSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE,eAAe,mBAAmB,CAChC,kBAAkB,EAClB;IACE,WAAW,EAAE;QACX,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,kCAAkC;QAC/C,YAAY,EAAE,OAAO;QACrB,eAAe,EAAE,CAAC,SAAS,CAAC;KAC7B;IACD,UAAU,EAAE;QACV,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,kCAAkC;QAC/C,YAAY,EAAE,SAAS;QACvB,eAAe,EAAE,CAAC,SAAS,CAAC;KAC7B;IACD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,6BAA6B;QAC1C,YAAY,EAAE,CAAC;QACf,eAAe,EAAE,CAAC,SAAS,CAAC;KAC7B;IACD,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,wCAAwC;QACrD,YAAY,EAAE,mDAAmD;QACjE,eAAe,EAAE,CAAC,SAAS,CAAC;KAC7B;IACD,OAAO,EAAE;QACP,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,qEAAqE;QACvE,YAAY,EAAE,0BAA0B;QACxC,eAAe,EAAE,CAAC,SAAS,CAAC;KAC7B;IACD,cAAc,EAAE;QACd,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,4CAA4C;QACzD,YAAY,EAAE,CAAC;KAChB;IACD,UAAU,EAAE;QACV,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,6BAA6B;QAC1C,YAAY,EAAE,OAAO;QACrB,eAAe,EAAE,CAAC,SAAS,CAAC;KAC7B;IACD,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,uCAAuC;QACpD,YAAY,EAAE,CAAC;QACf,eAAe,EAAE,CAAC,SAAS,CAAC;KAC7B;IACD,KAAK,EAAE;QACL,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,iFAAiF;QACnF,YAAY,EAAE,2BAA2B;QACzC,eAAe,EAAE,CAAC,SAAS,CAAC;KAC7B;CACF,EACD,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/LollipopRenderer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAC1E,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA"}
|
package/esm/index.d.ts
ADDED
package/esm/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType';
|
|
2
|
+
import Plugin from '@jbrowse/core/Plugin';
|
|
3
|
+
import { BaseLinearDisplayComponent } from '@jbrowse/plugin-linear-genome-view';
|
|
4
|
+
import { configSchemaFactory as linearLollipopDisplayConfigSchemaFactory, stateModelFactory as LinearLollipopDisplayStateModelFactory, } from './LinearLollipopDisplay';
|
|
5
|
+
import LollipopRenderer, { configSchema as lollipopRendererConfigSchema, ReactComponent as LollipopRendererReactComponent, } from './LollipopRenderer';
|
|
6
|
+
export default class extends Plugin {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.name = 'LollipopPlugin';
|
|
10
|
+
}
|
|
11
|
+
install(pluginManager) {
|
|
12
|
+
pluginManager.addRendererType(() => new LollipopRenderer({
|
|
13
|
+
name: 'LollipopRenderer',
|
|
14
|
+
ReactComponent: LollipopRendererReactComponent,
|
|
15
|
+
configSchema: lollipopRendererConfigSchema,
|
|
16
|
+
pluginManager,
|
|
17
|
+
}));
|
|
18
|
+
pluginManager.addDisplayType(() => {
|
|
19
|
+
const configSchema = linearLollipopDisplayConfigSchemaFactory(pluginManager);
|
|
20
|
+
return new DisplayType({
|
|
21
|
+
name: 'LinearLollipopDisplay',
|
|
22
|
+
configSchema,
|
|
23
|
+
stateModel: LinearLollipopDisplayStateModelFactory(configSchema),
|
|
24
|
+
trackType: 'LollipopTrack',
|
|
25
|
+
viewType: 'LinearGenomeView',
|
|
26
|
+
ReactComponent: BaseLinearDisplayComponent,
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,iDAAiD,CAAA;AACzE,OAAO,MAAM,MAAM,sBAAsB,CAAA;AAEzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAA;AAC/E,OAAO,EACL,mBAAmB,IAAI,wCAAwC,EAC/D,iBAAiB,IAAI,sCAAsC,GAC5D,MAAM,yBAAyB,CAAA;AAChC,OAAO,gBAAgB,EAAE,EACvB,YAAY,IAAI,4BAA4B,EAC5C,cAAc,IAAI,8BAA8B,GACjD,MAAM,oBAAoB,CAAA;AAE3B,MAAM,CAAC,OAAO,MAAO,SAAQ,MAAM;IAAnC;;QACE,SAAI,GAAG,gBAAgB,CAAA;IA0BzB,CAAC;IAxBC,OAAO,CAAC,aAA4B;QAClC,aAAa,CAAC,eAAe,CAC3B,GAAG,EAAE,CACH,IAAI,gBAAgB,CAAC;YACnB,IAAI,EAAE,kBAAkB;YACxB,cAAc,EAAE,8BAA8B;YAC9C,YAAY,EAAE,4BAA4B;YAC1C,aAAa;SACd,CAAC,CACL,CAAA;QAED,aAAa,CAAC,cAAc,CAAC,GAAG,EAAE;YAChC,MAAM,YAAY,GAChB,wCAAwC,CAAC,aAAa,CAAC,CAAA;YACzD,OAAO,IAAI,WAAW,CAAC;gBACrB,IAAI,EAAE,uBAAuB;gBAC7B,YAAY;gBACZ,UAAU,EAAE,sCAAsC,CAAC,YAAY,CAAC;gBAChE,SAAS,EAAE,eAAe;gBAC1B,QAAQ,EAAE,kBAAkB;gBAC5B,cAAc,EAAE,0BAA0B;aAC3C,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;CACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jbrowse/plugin-lollipop",
|
|
3
|
+
"version": "2.6.1",
|
|
4
|
+
"description": "JBrowse 2 plugin for lollipops",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"jbrowse",
|
|
7
|
+
"jbrowse2"
|
|
8
|
+
],
|
|
9
|
+
"license": "Apache-2.0",
|
|
10
|
+
"homepage": "https://jbrowse.org",
|
|
11
|
+
"bugs": "https://github.com/GMOD/jbrowse-components/issues",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/GMOD/jbrowse-components.git",
|
|
15
|
+
"directory": "plugins/lollipop"
|
|
16
|
+
},
|
|
17
|
+
"author": "JBrowse Team",
|
|
18
|
+
"distMain": "dist/index.js",
|
|
19
|
+
"srcMain": "src/index.ts",
|
|
20
|
+
"main": "dist/index.js",
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"src",
|
|
24
|
+
"esm"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "npm-run-all build:*",
|
|
28
|
+
"test": "cd ../..; jest plugins/lollipop",
|
|
29
|
+
"prepublishOnly": "yarn test",
|
|
30
|
+
"prepack": "yarn build && yarn useDist",
|
|
31
|
+
"postpack": "yarn useSrc",
|
|
32
|
+
"useDist": "node ../../scripts/useDist.js",
|
|
33
|
+
"useSrc": "node ../../scripts/useSrc.js",
|
|
34
|
+
"prebuild": "npm run clean",
|
|
35
|
+
"build:esm": "tsc --build tsconfig.build.esm.json",
|
|
36
|
+
"build:es5": "tsc --build tsconfig.build.es5.json",
|
|
37
|
+
"clean": "rimraf dist esm *.tsbuildinfo"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@jbrowse/core": "^2.0.0",
|
|
41
|
+
"@jbrowse/plugin-linear-genome-view": "^2.0.0",
|
|
42
|
+
"@mui/material": "^5.0.0",
|
|
43
|
+
"mobx": "^6.0.0",
|
|
44
|
+
"mobx-react": "^7.0.0",
|
|
45
|
+
"mobx-state-tree": "^5.0.0",
|
|
46
|
+
"prop-types": "^15.0.0",
|
|
47
|
+
"react": ">=16.8.0"
|
|
48
|
+
},
|
|
49
|
+
"distModule": "esm/index.js",
|
|
50
|
+
"srcModule": "src/index.ts",
|
|
51
|
+
"module": "esm/index.js",
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public"
|
|
54
|
+
},
|
|
55
|
+
"gitHead": "1cbe7ba097fb2d2763c776e5e429e4670cdd583c"
|
|
56
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import PluginManager from '@jbrowse/core/PluginManager'
|
|
2
|
+
import { ConfigurationSchema } from '@jbrowse/core/configuration'
|
|
3
|
+
import { baseLinearDisplayConfigSchema } from '@jbrowse/plugin-linear-genome-view'
|
|
4
|
+
|
|
5
|
+
export function configSchemaFactory(pluginManager: PluginManager) {
|
|
6
|
+
return ConfigurationSchema(
|
|
7
|
+
'LinearLollipopDisplay',
|
|
8
|
+
{ renderer: pluginManager.pluggableConfigSchemaType('renderer') },
|
|
9
|
+
{
|
|
10
|
+
baseConfiguration: baseLinearDisplayConfigSchema,
|
|
11
|
+
explicitlyTyped: true,
|
|
12
|
+
},
|
|
13
|
+
)
|
|
14
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AnyConfigurationSchemaType,
|
|
3
|
+
ConfigurationReference,
|
|
4
|
+
} from '@jbrowse/core/configuration'
|
|
5
|
+
import { types } from 'mobx-state-tree'
|
|
6
|
+
import { BaseLinearDisplay } from '@jbrowse/plugin-linear-genome-view'
|
|
7
|
+
|
|
8
|
+
export function stateModelFactory(configSchema: AnyConfigurationSchemaType) {
|
|
9
|
+
return types
|
|
10
|
+
.compose(
|
|
11
|
+
'LinearLollipopDisplay',
|
|
12
|
+
BaseLinearDisplay,
|
|
13
|
+
types.model({
|
|
14
|
+
type: types.literal('LinearLollipopDisplay'),
|
|
15
|
+
configuration: ConfigurationReference(configSchema),
|
|
16
|
+
}),
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
.views(self => {
|
|
20
|
+
const { renderProps: superRenderProps } = self
|
|
21
|
+
return {
|
|
22
|
+
get blockType() {
|
|
23
|
+
return 'dynamicBlocks'
|
|
24
|
+
},
|
|
25
|
+
get renderDelay() {
|
|
26
|
+
return 500
|
|
27
|
+
},
|
|
28
|
+
renderProps() {
|
|
29
|
+
return {
|
|
30
|
+
...superRenderProps(),
|
|
31
|
+
rpcDriverName: self.rpcDriverName,
|
|
32
|
+
config: self.configuration.renderer,
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
get rendererTypeName() {
|
|
36
|
+
return self.configuration.renderer.type
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
}
|