@jbrowse/plugin-circular-view 1.7.11 → 2.0.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/BaseChordDisplay/components/BaseChordDisplay.d.ts +2 -7
- package/dist/BaseChordDisplay/components/BaseChordDisplay.js +18 -48
- package/dist/BaseChordDisplay/components/BaseChordDisplay.js.map +1 -0
- package/dist/BaseChordDisplay/components/DisplayError.d.ts +9 -4
- package/dist/BaseChordDisplay/components/DisplayError.js +24 -67
- package/dist/BaseChordDisplay/components/DisplayError.js.map +1 -0
- package/dist/BaseChordDisplay/components/Loading.d.ts +2 -3
- package/dist/BaseChordDisplay/components/Loading.js +98 -112
- package/dist/BaseChordDisplay/components/Loading.js.map +1 -0
- package/dist/BaseChordDisplay/components/RpcRenderedSvgGroup.d.ts +3 -3
- package/dist/BaseChordDisplay/components/RpcRenderedSvgGroup.js +80 -91
- package/dist/BaseChordDisplay/components/RpcRenderedSvgGroup.js.map +1 -0
- package/dist/BaseChordDisplay/index.d.ts +1 -1
- package/dist/BaseChordDisplay/index.js +12 -30
- package/dist/BaseChordDisplay/index.js.map +1 -0
- package/dist/BaseChordDisplay/models/BaseChordDisplayModel.d.ts +10 -10
- package/dist/BaseChordDisplay/models/BaseChordDisplayModel.js +204 -232
- package/dist/BaseChordDisplay/models/BaseChordDisplayModel.js.map +1 -0
- package/dist/BaseChordDisplay/models/baseChordDisplayConfig.js +12 -18
- package/dist/BaseChordDisplay/models/baseChordDisplayConfig.js.map +1 -0
- package/dist/BaseChordDisplay/models/renderReaction.js +115 -138
- package/dist/BaseChordDisplay/models/renderReaction.js.map +1 -0
- package/dist/CircularView/components/CircularView.js +111 -185
- package/dist/CircularView/components/CircularView.js.map +1 -0
- package/dist/CircularView/components/ImportForm.js +77 -92
- package/dist/CircularView/components/ImportForm.js.map +1 -0
- package/dist/CircularView/components/Ruler.js +148 -194
- package/dist/CircularView/components/Ruler.js.map +1 -0
- package/dist/CircularView/models/CircularView.d.ts +3 -3
- package/dist/CircularView/models/CircularView.js +346 -409
- package/dist/CircularView/models/CircularView.js.map +1 -0
- package/dist/CircularView/models/slices.js +90 -104
- package/dist/CircularView/models/slices.js.map +1 -0
- package/dist/CircularView/models/viewportVisibleRegion.js +229 -264
- package/dist/CircularView/models/viewportVisibleRegion.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +147 -176
- package/dist/index.js.map +1 -0
- package/esm/BaseChordDisplay/components/BaseChordDisplay.d.ts +4 -0
- package/esm/BaseChordDisplay/components/BaseChordDisplay.js +17 -0
- package/esm/BaseChordDisplay/components/BaseChordDisplay.js.map +1 -0
- package/esm/BaseChordDisplay/components/DisplayError.d.ts +9 -0
- package/esm/BaseChordDisplay/components/DisplayError.js +21 -0
- package/esm/BaseChordDisplay/components/DisplayError.js.map +1 -0
- package/esm/BaseChordDisplay/components/Loading.d.ts +9 -0
- package/esm/BaseChordDisplay/components/Loading.js +66 -0
- package/esm/BaseChordDisplay/components/Loading.js.map +1 -0
- package/esm/BaseChordDisplay/components/RpcRenderedSvgGroup.d.ts +4 -0
- package/esm/BaseChordDisplay/components/RpcRenderedSvgGroup.js +48 -0
- package/esm/BaseChordDisplay/components/RpcRenderedSvgGroup.js.map +1 -0
- package/esm/BaseChordDisplay/index.d.ts +3 -0
- package/esm/BaseChordDisplay/index.js +4 -0
- package/esm/BaseChordDisplay/index.js.map +1 -0
- package/esm/BaseChordDisplay/models/BaseChordDisplayModel.d.ts +99 -0
- package/esm/BaseChordDisplay/models/BaseChordDisplayModel.js +181 -0
- package/esm/BaseChordDisplay/models/BaseChordDisplayModel.js.map +1 -0
- package/esm/BaseChordDisplay/models/baseChordDisplayConfig.d.ts +2 -0
- package/esm/BaseChordDisplay/models/baseChordDisplayConfig.js +11 -0
- package/esm/BaseChordDisplay/models/baseChordDisplayConfig.js.map +1 -0
- package/esm/BaseChordDisplay/models/renderReaction.d.ts +30 -0
- package/esm/BaseChordDisplay/models/renderReaction.js +52 -0
- package/esm/BaseChordDisplay/models/renderReaction.js.map +1 -0
- package/esm/CircularView/components/CircularView.d.ts +4 -0
- package/esm/CircularView/components/CircularView.js +121 -0
- package/esm/CircularView/components/CircularView.js.map +1 -0
- package/esm/CircularView/components/ImportForm.d.ts +5 -0
- package/esm/CircularView/components/ImportForm.js +40 -0
- package/esm/CircularView/components/ImportForm.js.map +1 -0
- package/esm/CircularView/components/Ruler.d.ts +5 -0
- package/esm/CircularView/components/Ruler.js +126 -0
- package/esm/CircularView/components/Ruler.js.map +1 -0
- package/esm/CircularView/models/CircularView.d.ts +97 -0
- package/esm/CircularView/models/CircularView.js +317 -0
- package/esm/CircularView/models/CircularView.js.map +1 -0
- package/esm/CircularView/models/slices.d.ts +27 -0
- package/esm/CircularView/models/slices.js +53 -0
- package/esm/CircularView/models/slices.js.map +1 -0
- package/esm/CircularView/models/viewportVisibleRegion.d.ts +6 -0
- package/esm/CircularView/models/viewportVisibleRegion.js +223 -0
- package/esm/CircularView/models/viewportVisibleRegion.js.map +1 -0
- package/esm/index.d.ts +10 -0
- package/esm/index.js +49 -0
- package/esm/index.js.map +1 -0
- package/package.json +19 -11
- package/src/BaseChordDisplay/components/BaseChordDisplay.tsx +13 -25
- package/src/BaseChordDisplay/components/DisplayError.js +64 -66
- package/src/BaseChordDisplay/components/Loading.tsx +104 -107
- package/src/BaseChordDisplay/components/RpcRenderedSvgGroup.js +44 -51
- package/src/BaseChordDisplay/index.ts +1 -1
- package/src/BaseChordDisplay/models/BaseChordDisplayModel.ts +2 -1
- package/src/CircularView/components/CircularView.js +17 -16
- package/src/CircularView/components/ImportForm.tsx +5 -5
- package/src/CircularView/components/Ruler.js +4 -3
- package/src/CircularView/models/CircularView.ts +29 -42
- package/src/CircularView/models/slices.ts +2 -7
- package/src/index.ts +5 -2
- package/dist/CircularView/models/slices.test.js +0 -83
- package/dist/CircularView/models/viewportVisibleRegion.test.js +0 -130
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
6
|
-
|
|
7
|
-
var _slices2 = require("./slices");
|
|
8
|
-
|
|
9
|
-
test('one slice', function () {
|
|
10
|
-
var view = {
|
|
11
|
-
elidedRegions: [{
|
|
12
|
-
refName: 'toast',
|
|
13
|
-
start: 0,
|
|
14
|
-
end: 10000,
|
|
15
|
-
widthBp: 10000
|
|
16
|
-
}],
|
|
17
|
-
spacingPx: 5,
|
|
18
|
-
radiusPx: 1000,
|
|
19
|
-
totalBp: 10000,
|
|
20
|
-
bpPerRadian: 10000 / (2 * Math.PI),
|
|
21
|
-
pxPerRadian: 1000
|
|
22
|
-
};
|
|
23
|
-
var slices = (0, _slices2.calculateStaticSlices)(view); // console.log(slices)
|
|
24
|
-
|
|
25
|
-
expect(slices.length).toBe(1);
|
|
26
|
-
|
|
27
|
-
var _slices = (0, _slicedToArray2.default)(slices, 1),
|
|
28
|
-
slice = _slices[0]; // expect(slices).toMatchSnapshot()
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
expect(slice).toMatchSnapshot();
|
|
32
|
-
});
|
|
33
|
-
test('two slices', function () {
|
|
34
|
-
var view = {
|
|
35
|
-
elidedRegions: [{
|
|
36
|
-
refName: 'toast',
|
|
37
|
-
start: 0,
|
|
38
|
-
end: 10000,
|
|
39
|
-
widthBp: 10000
|
|
40
|
-
}, {
|
|
41
|
-
refName: 'teest',
|
|
42
|
-
start: 0,
|
|
43
|
-
end: 10000,
|
|
44
|
-
widthBp: 10000
|
|
45
|
-
}],
|
|
46
|
-
spacingPx: 5,
|
|
47
|
-
radiusPx: 1000,
|
|
48
|
-
pxPerRadian: 1000,
|
|
49
|
-
totalBp: 20000,
|
|
50
|
-
bpPerRadian: 20000 / (2 * Math.PI)
|
|
51
|
-
};
|
|
52
|
-
var slices = (0, _slices2.calculateStaticSlices)(view); // console.log(slices)
|
|
53
|
-
|
|
54
|
-
expect(slices.length).toBe(2);
|
|
55
|
-
expect(slices).toMatchSnapshot();
|
|
56
|
-
});
|
|
57
|
-
test('volvox', function () {
|
|
58
|
-
var totalBp = 50001 + 6079;
|
|
59
|
-
var view = {
|
|
60
|
-
elidedRegions: [{
|
|
61
|
-
refName: 'ctgA',
|
|
62
|
-
start: 0,
|
|
63
|
-
end: 50001,
|
|
64
|
-
assemblyName: 'volvox',
|
|
65
|
-
widthBp: 50001
|
|
66
|
-
}, {
|
|
67
|
-
refName: 'ctgB',
|
|
68
|
-
start: 0,
|
|
69
|
-
end: 6079,
|
|
70
|
-
assemblyName: 'volvox',
|
|
71
|
-
widthBp: 6079
|
|
72
|
-
}],
|
|
73
|
-
spacingPx: 5,
|
|
74
|
-
radiusPx: 1000,
|
|
75
|
-
pxPerRadian: 1000,
|
|
76
|
-
totalBp: totalBp,
|
|
77
|
-
bpPerRadian: totalBp / (2 * Math.PI)
|
|
78
|
-
};
|
|
79
|
-
var slices = (0, _slices2.calculateStaticSlices)(view); // console.log(slices)
|
|
80
|
-
|
|
81
|
-
expect(slices.length).toBe(2);
|
|
82
|
-
expect(slices).toMatchSnapshot();
|
|
83
|
-
});
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
6
|
-
|
|
7
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
8
|
-
|
|
9
|
-
var _viewportVisibleRegion = require("./viewportVisibleRegion");
|
|
10
|
-
|
|
11
|
-
describe('viewportVisibleSection', function () {
|
|
12
|
-
// test('circle contained in viewport', () => {
|
|
13
|
-
// const result = viewportVisibleSection([0, 1, 0, 1], [0.5, 0.5], 0.3)
|
|
14
|
-
// expect(result).toEqual({ rho: [0, 0.3], theta: [0, 2 * Math.PI] })
|
|
15
|
-
// })
|
|
16
|
-
// test('viewport completely inside circle', () => {
|
|
17
|
-
// const result = viewportVisibleSection([0, 1, 0, 1], [0.5, 0.5], 20)
|
|
18
|
-
// expect(result.theta).toEqual([0, 2 * Math.PI])
|
|
19
|
-
// expect(result.rho[0]).toEqual(0)
|
|
20
|
-
// expect(result.rho[1]).toBeCloseTo(0.7071)
|
|
21
|
-
// })
|
|
22
|
-
// test('viewport on left half of circle', () => {
|
|
23
|
-
// const result = viewportVisibleSection([200, 500, 0, 1000], [500, 500], 20)
|
|
24
|
-
// expect(result).toEqual({
|
|
25
|
-
// rho: [0, 20],
|
|
26
|
-
// theta: [Math.PI / 2, 1.5 * Math.PI],
|
|
27
|
-
// })
|
|
28
|
-
// })
|
|
29
|
-
// test('viewport on right half of circle', () => {
|
|
30
|
-
// const result = viewportVisibleSection([200, 500, 0, 1000], [200, 500], 20)
|
|
31
|
-
// expect(result).toEqual({
|
|
32
|
-
// rho: [0, 20],
|
|
33
|
-
// theta: [1.5 * Math.PI, 2.5 * Math.PI],
|
|
34
|
-
// })
|
|
35
|
-
// })
|
|
36
|
-
// test('viewport corner in circle', () => {
|
|
37
|
-
// const { theta, rho } = viewportVisibleSection(
|
|
38
|
-
// [200, 500, 0, 700],
|
|
39
|
-
// [199, 701],
|
|
40
|
-
// 100,
|
|
41
|
-
// )
|
|
42
|
-
// expect(rho).toEqual([1.4142135623730951, 100])
|
|
43
|
-
// expect(theta[0]).toBeCloseTo(1.5 * Math.PI, 1)
|
|
44
|
-
// expect(theta[1]).toBeCloseTo(2 * Math.PI, 1)
|
|
45
|
-
// })
|
|
46
|
-
// test('viewport on center right', () => {
|
|
47
|
-
// const { theta, rho } = viewportVisibleSection(
|
|
48
|
-
// [1102, 2153, 880, 1280],
|
|
49
|
-
// [1068.8119697255406, 1068.8119697255406],
|
|
50
|
-
// 1048.8119697255406,
|
|
51
|
-
// )
|
|
52
|
-
// expect(theta[1]).toBeGreaterThan(2 * Math.PI)
|
|
53
|
-
// expect(theta[1]).toBeLessThan(2.5 * Math.PI)
|
|
54
|
-
// expect(theta[0]).toBeGreaterThan(1.5 * Math.PI)
|
|
55
|
-
// expect(theta[0]).toBeLessThan(2 * Math.PI)
|
|
56
|
-
// })
|
|
57
|
-
// test('viewport on center right 2', () => {
|
|
58
|
-
// const { theta, rho } = viewportVisibleSection(
|
|
59
|
-
// [1816, 2937, 1074, 1474],
|
|
60
|
-
// [1468.6015446723616, 1468.6015446723616],
|
|
61
|
-
// 1448.6015446723616,
|
|
62
|
-
// )
|
|
63
|
-
// expect(theta[1]).toBeGreaterThan(2 * Math.PI)
|
|
64
|
-
// expect(theta[1]).toBeLessThan(2.5 * Math.PI)
|
|
65
|
-
// expect(theta[0]).toBeGreaterThan(1.5 * Math.PI)
|
|
66
|
-
// expect(theta[0]).toBeLessThan(2 * Math.PI)
|
|
67
|
-
// })
|
|
68
|
-
// test('viewport on lower center', () => {
|
|
69
|
-
// const { theta, rho } = viewportVisibleSection(
|
|
70
|
-
// [259, 1350, 1176, 1576],
|
|
71
|
-
// [787.7952717090081, 787.7952717090081],
|
|
72
|
-
// 767.7952717090081,
|
|
73
|
-
// )
|
|
74
|
-
// expect(theta[1]).toBeGreaterThan(Math.PI / 2)
|
|
75
|
-
// expect(theta[1]).toBeLessThan(Math.PI)
|
|
76
|
-
// expect(theta[0]).toBeGreaterThan(0)
|
|
77
|
-
// expect(theta[0]).toBeLessThan(Math.PI / 2)
|
|
78
|
-
// })
|
|
79
|
-
// test('viewport on upper center', () => {
|
|
80
|
-
// const { theta, rho } = viewportVisibleSection(
|
|
81
|
-
// [286, 1377, 0, 400],
|
|
82
|
-
// [787.7952717090081, 787.7952717090081],
|
|
83
|
-
// 767.7952717090081,
|
|
84
|
-
// )
|
|
85
|
-
// expect(theta[1]).toBeGreaterThan(1.5 * Math.PI)
|
|
86
|
-
// expect(theta[1]).toBeLessThan(2 * Math.PI)
|
|
87
|
-
// expect(theta[0]).toBeGreaterThan(Math.PI)
|
|
88
|
-
// expect(theta[0]).toBeLessThan(1.5 * Math.PI)
|
|
89
|
-
// })
|
|
90
|
-
test('viewport on upper center 2', function () {
|
|
91
|
-
// [180.48708681644143, 359.3411680673888] [4.6042679453532855, 541.6042679453533]
|
|
92
|
-
// see '~/Desktop/Screen Shot 2019-06-28 at 3.01.22 PM.png'
|
|
93
|
-
var _viewportVisibleSecti = (0, _viewportVisibleRegion.viewportVisibleSection)([0, 962, 157, 557], [561.6042679453533, 561.6042679453533], 541.6042679453533),
|
|
94
|
-
theta = _viewportVisibleSecti.theta;
|
|
95
|
-
|
|
96
|
-
expect(theta[1]).toBeGreaterThan(1.75 * Math.PI);
|
|
97
|
-
expect(theta[1]).toBeLessThan(2 * Math.PI);
|
|
98
|
-
expect(theta[0]).toBeGreaterThan(Math.PI);
|
|
99
|
-
expect(theta[0]).toBeLessThan(1.1 * Math.PI);
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
describe('cartesian to polar', function () {
|
|
103
|
-
;
|
|
104
|
-
[[[-1, -1], [1.414, 180 + 45]], [[-1, 1], [1.414, 90 + 45]], [[1, 1], [1.414, 45]], [[1, -1], [1.414, 360 - 45]], [[0, 1], [1, 90]], [[0, -1], [1, 270]], [[-1, 0], [1, 180]], [[1, 0], [1, 0]]].forEach(function (testCase) {
|
|
105
|
-
var _testCase = (0, _slicedToArray2.default)(testCase, 2),
|
|
106
|
-
input = _testCase[0],
|
|
107
|
-
output = _testCase[1];
|
|
108
|
-
|
|
109
|
-
test("".concat(input, " -> ").concat(output), function () {
|
|
110
|
-
var result = _viewportVisibleRegion.cartesianToPolar.apply(void 0, (0, _toConsumableArray2.default)(input));
|
|
111
|
-
|
|
112
|
-
expect(result[0]).toBeCloseTo(output[0]);
|
|
113
|
-
expect(result[1] * 180 / Math.PI).toBeCloseTo(output[1]);
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
describe('theta overlap testing', function () {
|
|
118
|
-
;
|
|
119
|
-
[[[0, 2 * Math.PI, 0, 2 * Math.PI], true], [[6.1, Math.PI / 2, 0, Math.PI / 2], true], [[6.1, Math.PI / 2, 0, 0.1], true], [[6.1, 0.1, 6.12, 0.05], true], [[-12, 0.1, -12.05, 0.05], false], [[-12, 0.1, -12.05, 0.06], true]].forEach(function (testCase) {
|
|
120
|
-
var _testCase2 = (0, _slicedToArray2.default)(testCase, 2),
|
|
121
|
-
input = _testCase2[0],
|
|
122
|
-
output = _testCase2[1];
|
|
123
|
-
|
|
124
|
-
test("".concat(input, " -> ").concat(output), function () {
|
|
125
|
-
var result = _viewportVisibleRegion.thetaRangesOverlap.apply(void 0, (0, _toConsumableArray2.default)(input));
|
|
126
|
-
|
|
127
|
-
expect(result).toBe(output);
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
});
|