@genome-spy/core 0.46.0 → 0.47.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/bundle/index.es.js +5429 -5306
- package/dist/bundle/index.js +104 -93
- package/dist/schema.json +38 -0
- package/dist/src/data/flowNode.d.ts +22 -7
- package/dist/src/data/flowNode.d.ts.map +1 -1
- package/dist/src/data/flowNode.js +29 -6
- package/dist/src/data/flowTestUtils.d.ts +5 -0
- package/dist/src/data/flowTestUtils.d.ts.map +1 -1
- package/dist/src/data/flowTestUtils.js +11 -0
- package/dist/src/data/transforms/clone.d.ts +1 -0
- package/dist/src/data/transforms/clone.d.ts.map +1 -1
- package/dist/src/data/transforms/coverage.d.ts +4 -1
- package/dist/src/data/transforms/coverage.d.ts.map +1 -1
- package/dist/src/data/transforms/coverage.js +44 -31
- package/dist/src/data/transforms/filter.d.ts +2 -1
- package/dist/src/data/transforms/filter.d.ts.map +1 -1
- package/dist/src/data/transforms/filter.js +4 -2
- package/dist/src/data/transforms/filter.test.js +2 -6
- package/dist/src/data/transforms/formula.d.ts +2 -1
- package/dist/src/data/transforms/formula.d.ts.map +1 -1
- package/dist/src/data/transforms/formula.js +4 -2
- package/dist/src/data/transforms/formula.test.js +9 -9
- package/dist/src/genomeSpy.d.ts.map +1 -1
- package/dist/src/genomeSpy.js +23 -15
- package/dist/src/gl/webGLHelper.d.ts +2 -1
- package/dist/src/gl/webGLHelper.d.ts.map +1 -1
- package/dist/src/gl/webGLHelper.js +8 -1
- package/dist/src/marks/mark.d.ts +24 -12
- package/dist/src/marks/mark.d.ts.map +1 -1
- package/dist/src/marks/mark.js +27 -13
- package/dist/src/marks/point.d.ts +0 -1
- package/dist/src/marks/point.d.ts.map +1 -1
- package/dist/src/marks/point.js +6 -2
- package/dist/src/marks/text.d.ts.map +1 -1
- package/dist/src/marks/text.js +4 -1
- package/dist/src/scale/scale.js +2 -0
- package/dist/src/spec/parameter.d.ts +20 -1
- package/dist/src/types/embedApi.d.ts +7 -0
- package/dist/src/types/rendering.d.ts +6 -0
- package/dist/src/utils/animator.d.ts +15 -0
- package/dist/src/utils/animator.d.ts.map +1 -1
- package/dist/src/utils/animator.js +66 -0
- package/dist/src/utils/inertia.d.ts +4 -15
- package/dist/src/utils/inertia.d.ts.map +1 -1
- package/dist/src/utils/inertia.js +28 -63
- package/dist/src/utils/inputBinding.d.ts.map +1 -1
- package/dist/src/utils/inputBinding.js +26 -2
- package/dist/src/view/gridView.d.ts +4 -6
- package/dist/src/view/gridView.d.ts.map +1 -1
- package/dist/src/view/gridView.js +45 -27
- package/dist/src/view/unitView.d.ts +3 -14
- package/dist/src/view/unitView.d.ts.map +1 -1
- package/dist/src/view/unitView.js +26 -8
- package/dist/src/view/view.d.ts +14 -5
- package/dist/src/view/view.d.ts.map +1 -1
- package/dist/src/view/view.js +26 -7
- package/dist/src/view/zoom.d.ts +2 -2
- package/dist/src/view/zoom.d.ts.map +1 -1
- package/dist/src/view/zoom.js +1 -1
- package/package.json +2 -2
- package/dist/src/view/renderingContext/layoutRecorderViewRenderingContext.d.ts +0 -60
- package/dist/src/view/renderingContext/layoutRecorderViewRenderingContext.d.ts.map +0 -1
- package/dist/src/view/renderingContext/layoutRecorderViewRenderingContext.js +0 -128
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { peek } from "../../utils/arrayUtils.js";
|
|
2
|
-
import ViewRenderingContext from "./viewRenderingContext.js";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* A Rendering context that doesn't render anything. It creates a hierarchy
|
|
6
|
-
* of view coordinates, including faceted views that are repeated multiple times.
|
|
7
|
-
* The coordinates can be used for mouse events / interactions, for example.
|
|
8
|
-
*
|
|
9
|
-
* @typedef {import("../view.js").default} View
|
|
10
|
-
* @typedef {import("../layout/rectangle.js").default} Rectangle
|
|
11
|
-
*
|
|
12
|
-
*/
|
|
13
|
-
export default class LayoutRecorderViewRenderingContext extends ViewRenderingContext {
|
|
14
|
-
/**
|
|
15
|
-
* @param {import("../../types/rendering.js").GlobalRenderingOptions} globalOptions
|
|
16
|
-
*/
|
|
17
|
-
constructor(globalOptions) {
|
|
18
|
-
super(globalOptions);
|
|
19
|
-
|
|
20
|
-
/** @type {ViewCoords} */
|
|
21
|
-
this.root = undefined;
|
|
22
|
-
|
|
23
|
-
/** @type {ViewCoords[]} */
|
|
24
|
-
this.stack = [];
|
|
25
|
-
|
|
26
|
-
/** @type {ViewCoords} */
|
|
27
|
-
this.lastAddition = undefined;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Must be called when a view's render() method is entered
|
|
32
|
-
*
|
|
33
|
-
* @param {View} view
|
|
34
|
-
* @param {Rectangle} coords View coordinates
|
|
35
|
-
* inside the padding.
|
|
36
|
-
*/
|
|
37
|
-
pushView(view, coords) {
|
|
38
|
-
// TODO: Facet id
|
|
39
|
-
|
|
40
|
-
const viewCoords = new ViewCoords(view, coords);
|
|
41
|
-
|
|
42
|
-
if (!this.root) {
|
|
43
|
-
this.root = viewCoords;
|
|
44
|
-
} else {
|
|
45
|
-
peek(this.stack).addChild(viewCoords);
|
|
46
|
-
}
|
|
47
|
-
this.stack.push(viewCoords);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Must be called when a view's render() method is being exited
|
|
52
|
-
*
|
|
53
|
-
* @param {View} view
|
|
54
|
-
*/
|
|
55
|
-
popView(view) {
|
|
56
|
-
this.stack.pop();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
getLayout() {
|
|
60
|
-
return this.root;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Represents coordinates of view instances. Faceted views objects may have
|
|
66
|
-
* been rendered at multiple locations.
|
|
67
|
-
*/
|
|
68
|
-
class ViewCoords {
|
|
69
|
-
/**
|
|
70
|
-
* @param {View} view
|
|
71
|
-
* @param {Rectangle} coords
|
|
72
|
-
*/
|
|
73
|
-
constructor(view, coords) {
|
|
74
|
-
this.view = view;
|
|
75
|
-
this.coords = coords;
|
|
76
|
-
/** @type {ViewCoords[]} */
|
|
77
|
-
this.children = [];
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
*
|
|
82
|
-
* @param {ViewCoords} viewCoords
|
|
83
|
-
*/
|
|
84
|
-
addChild(viewCoords) {
|
|
85
|
-
const last = peek(this.children);
|
|
86
|
-
if (
|
|
87
|
-
last &&
|
|
88
|
-
viewCoords.view === last.view &&
|
|
89
|
-
viewCoords.coords.equals(last.coords)
|
|
90
|
-
) {
|
|
91
|
-
// Skip extra copies of sample facets. They all have the same coords.
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
this.children.push(viewCoords);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Broadcasts a message to views that include the given (x, y) point.
|
|
100
|
-
* This is mainly intended for mouse events.
|
|
101
|
-
*
|
|
102
|
-
* @param {import("../../utils/interactionEvent.js").default} event
|
|
103
|
-
*/
|
|
104
|
-
dispatchInteractionEvent(event) {
|
|
105
|
-
if (this.coords.containsPoint(event.point.x, event.point.y)) {
|
|
106
|
-
this.view.handleInteractionEvent(this.coords, event, true);
|
|
107
|
-
if (event.stopped) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (this.children.length == 0) {
|
|
112
|
-
event.target = this.view;
|
|
113
|
-
} else {
|
|
114
|
-
for (const child of this.children) {
|
|
115
|
-
child.dispatchInteractionEvent(event);
|
|
116
|
-
if (event.target) {
|
|
117
|
-
break;
|
|
118
|
-
}
|
|
119
|
-
if (event.stopped) {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
this.view.handleInteractionEvent(this.coords, event, false);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|