@genome-spy/core 0.46.1 → 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.
Files changed (44) hide show
  1. package/dist/bundle/index.es.js +5184 -5086
  2. package/dist/bundle/index.js +104 -93
  3. package/dist/schema.json +38 -0
  4. package/dist/src/genomeSpy.d.ts.map +1 -1
  5. package/dist/src/genomeSpy.js +23 -15
  6. package/dist/src/gl/webGLHelper.d.ts +2 -1
  7. package/dist/src/gl/webGLHelper.d.ts.map +1 -1
  8. package/dist/src/gl/webGLHelper.js +8 -1
  9. package/dist/src/marks/mark.d.ts +24 -12
  10. package/dist/src/marks/mark.d.ts.map +1 -1
  11. package/dist/src/marks/mark.js +27 -13
  12. package/dist/src/marks/point.d.ts +0 -1
  13. package/dist/src/marks/point.d.ts.map +1 -1
  14. package/dist/src/marks/point.js +6 -2
  15. package/dist/src/marks/text.d.ts.map +1 -1
  16. package/dist/src/marks/text.js +4 -1
  17. package/dist/src/scale/scale.js +2 -0
  18. package/dist/src/spec/parameter.d.ts +20 -1
  19. package/dist/src/types/embedApi.d.ts +7 -0
  20. package/dist/src/types/rendering.d.ts +6 -0
  21. package/dist/src/utils/animator.d.ts +15 -0
  22. package/dist/src/utils/animator.d.ts.map +1 -1
  23. package/dist/src/utils/animator.js +66 -0
  24. package/dist/src/utils/inertia.d.ts +4 -15
  25. package/dist/src/utils/inertia.d.ts.map +1 -1
  26. package/dist/src/utils/inertia.js +28 -63
  27. package/dist/src/utils/inputBinding.d.ts.map +1 -1
  28. package/dist/src/utils/inputBinding.js +26 -2
  29. package/dist/src/view/gridView.d.ts +4 -6
  30. package/dist/src/view/gridView.d.ts.map +1 -1
  31. package/dist/src/view/gridView.js +45 -27
  32. package/dist/src/view/unitView.d.ts +3 -14
  33. package/dist/src/view/unitView.d.ts.map +1 -1
  34. package/dist/src/view/unitView.js +26 -8
  35. package/dist/src/view/view.d.ts +14 -5
  36. package/dist/src/view/view.d.ts.map +1 -1
  37. package/dist/src/view/view.js +26 -7
  38. package/dist/src/view/zoom.d.ts +2 -2
  39. package/dist/src/view/zoom.d.ts.map +1 -1
  40. package/dist/src/view/zoom.js +1 -1
  41. package/package.json +2 -2
  42. package/dist/src/view/renderingContext/layoutRecorderViewRenderingContext.d.ts +0 -60
  43. package/dist/src/view/renderingContext/layoutRecorderViewRenderingContext.d.ts.map +0 -1
  44. package/dist/src/view/renderingContext/layoutRecorderViewRenderingContext.js +0 -128
@@ -9,7 +9,7 @@
9
9
 
10
10
  /**
11
11
  * @param {import("../utils/interactionEvent.js").default} event
12
- * @param {import("./renderingContext/layoutRecorderViewRenderingContext.js").Rectangle} coords The plot area
12
+ * @param {import("./layout/rectangle.js").default} coords
13
13
  * @param {(zoomEvent: ZoomEvent) => void} handleZoom
14
14
  * @param {import("../types/viewContext.js").Hover} [hover]
15
15
  */
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "contributors": [],
9
9
  "license": "MIT",
10
- "version": "0.46.1",
10
+ "version": "0.47.0",
11
11
  "jsdelivr": "dist/bundle/index.js",
12
12
  "unpkg": "dist/bundle/index.js",
13
13
  "browser": "dist/bundle/index.js",
@@ -64,5 +64,5 @@
64
64
  "vega-scale": "^7.3.1",
65
65
  "vega-util": "^1.17.2"
66
66
  },
67
- "gitHead": "9e43f979e60032c4a6a3780b1eba429358917bd7"
67
+ "gitHead": "4c4aabc561aa5c61a200b7c4eaaf0d2cbec623b6"
68
68
  }
@@ -1,60 +0,0 @@
1
- /**
2
- * A Rendering context that doesn't render anything. It creates a hierarchy
3
- * of view coordinates, including faceted views that are repeated multiple times.
4
- * The coordinates can be used for mouse events / interactions, for example.
5
- *
6
- * @typedef {import("../view.js").default} View
7
- * @typedef {import("../layout/rectangle.js").default} Rectangle
8
- *
9
- */
10
- export default class LayoutRecorderViewRenderingContext extends ViewRenderingContext {
11
- /** @type {ViewCoords} */
12
- root: ViewCoords;
13
- /** @type {ViewCoords[]} */
14
- stack: ViewCoords[];
15
- /** @type {ViewCoords} */
16
- lastAddition: ViewCoords;
17
- getLayout(): ViewCoords;
18
- }
19
- /**
20
- * A Rendering context that doesn't render anything. It creates a hierarchy
21
- * of view coordinates, including faceted views that are repeated multiple times.
22
- * The coordinates can be used for mouse events / interactions, for example.
23
- */
24
- export type View = import("../view.js").default;
25
- /**
26
- * A Rendering context that doesn't render anything. It creates a hierarchy
27
- * of view coordinates, including faceted views that are repeated multiple times.
28
- * The coordinates can be used for mouse events / interactions, for example.
29
- */
30
- export type Rectangle = import("../layout/rectangle.js").default;
31
- import ViewRenderingContext from "./viewRenderingContext.js";
32
- /**
33
- * Represents coordinates of view instances. Faceted views objects may have
34
- * been rendered at multiple locations.
35
- */
36
- declare class ViewCoords {
37
- /**
38
- * @param {View} view
39
- * @param {Rectangle} coords
40
- */
41
- constructor(view: View, coords: Rectangle);
42
- view: import("../view.js").default;
43
- coords: import("../layout/rectangle.js").default;
44
- /** @type {ViewCoords[]} */
45
- children: ViewCoords[];
46
- /**
47
- *
48
- * @param {ViewCoords} viewCoords
49
- */
50
- addChild(viewCoords: ViewCoords): void;
51
- /**
52
- * Broadcasts a message to views that include the given (x, y) point.
53
- * This is mainly intended for mouse events.
54
- *
55
- * @param {import("../../utils/interactionEvent.js").default} event
56
- */
57
- dispatchInteractionEvent(event: import("../../utils/interactionEvent.js").default): void;
58
- }
59
- export {};
60
- //# sourceMappingURL=layoutRecorderViewRenderingContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"layoutRecorderViewRenderingContext.d.ts","sourceRoot":"","sources":["../../../../src/view/renderingContext/layoutRecorderViewRenderingContext.js"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH;IAOQ,yBAAyB;IACzB,MADW,UAAU,CACA;IAErB,2BAA2B;IAC3B,OADW,UAAU,EAAE,CACR;IAEf,yBAAyB;IACzB,cADW,UAAU,CACQ;IAgCjC,wBAEC;CACJ;;;;;;mBArDY,OAAO,YAAY,EAAE,OAAO;;;;;;wBAC5B,OAAO,wBAAwB,EAAE,OAAO;iCARpB,2BAA2B;AA8D5D;;;GAGG;AACH;IACI;;;OAGG;IACH,kBAHW,IAAI,UACJ,SAAS,EAOnB;IAJG,mCAAgB;IAChB,iDAAoB;IACpB,2BAA2B;IAC3B,UADW,UAAU,EAAE,CACL;IAGtB;;;OAGG;IACH,qBAFW,UAAU,QAcpB;IAED;;;;;OAKG;IACH,gCAFW,OAAO,iCAAiC,EAAE,OAAO,QAyB3D;CACJ"}
@@ -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
- }