@genome-spy/core 0.58.1 → 0.60.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 (117) hide show
  1. package/dist/bundle/{index-DwLfOHEk.js → index-5ajWdKly.js} +1 -1
  2. package/dist/bundle/{index-vgGDWUPz.js → index-B03-Om4z.js} +1 -1
  3. package/dist/bundle/index-Bg7C4Xat.js +2750 -0
  4. package/dist/bundle/{index-CalimFw3.js → index-C3QR8Lv6.js} +79 -79
  5. package/dist/bundle/{index-DKe9Bhvi.js → index-g8iXgW0W.js} +1 -1
  6. package/dist/bundle/index.es.js +6554 -6011
  7. package/dist/bundle/index.js +189 -164
  8. package/dist/bundle/{long-BviWyoZx.js → long-B-FASCSo.js} +45 -45
  9. package/dist/schema.json +312 -25
  10. package/dist/src/data/collector.d.ts.map +1 -1
  11. package/dist/src/data/collector.js +1 -0
  12. package/dist/src/data/flowNode.d.ts.map +1 -1
  13. package/dist/src/data/sources/dataSource.d.ts.map +1 -1
  14. package/dist/src/data/sources/dataUtils.d.ts +2 -1
  15. package/dist/src/data/sources/dataUtils.d.ts.map +1 -1
  16. package/dist/src/data/sources/dataUtils.js +3 -4
  17. package/dist/src/data/sources/inlineSource.d.ts +8 -0
  18. package/dist/src/data/sources/inlineSource.d.ts.map +1 -1
  19. package/dist/src/data/sources/inlineSource.js +17 -1
  20. package/dist/src/data/sources/urlSource.d.ts +1 -0
  21. package/dist/src/data/sources/urlSource.d.ts.map +1 -1
  22. package/dist/src/data/sources/urlSource.js +33 -4
  23. package/dist/src/data/transforms/identifier.d.ts.map +1 -1
  24. package/dist/src/data/transforms/measureText.js +1 -1
  25. package/dist/src/data/transforms/regexFold.d.ts.map +1 -1
  26. package/dist/src/data/transforms/regexFold.js +10 -0
  27. package/dist/src/data/transforms/regexFold.test.js +13 -0
  28. package/dist/src/encoder/encoder.d.ts +1 -1
  29. package/dist/src/fonts/bmFontManager.js +2 -2
  30. package/dist/src/fonts/bmFontMetrics.d.ts.map +1 -1
  31. package/dist/src/genomeSpy.d.ts.map +1 -1
  32. package/dist/src/genomeSpy.js +39 -19
  33. package/dist/src/gl/arrayBuilder.d.ts.map +1 -1
  34. package/dist/src/gl/colorUtils.d.ts +4 -0
  35. package/dist/src/gl/colorUtils.d.ts.map +1 -1
  36. package/dist/src/gl/colorUtils.js +8 -0
  37. package/dist/src/gl/glslScaleGenerator.d.ts +1 -1
  38. package/dist/src/gl/glslScaleGenerator.d.ts.map +1 -1
  39. package/dist/src/gl/glslScaleGenerator.js +1 -9
  40. package/dist/src/gl/includes/common.glsl.js +1 -1
  41. package/dist/src/gl/webGLHelper.d.ts +1 -1
  42. package/dist/src/gl/webGLHelper.d.ts.map +1 -1
  43. package/dist/src/marks/link.d.ts.map +1 -1
  44. package/dist/src/marks/link.js +9 -1
  45. package/dist/src/marks/mark.d.ts +8 -0
  46. package/dist/src/marks/mark.d.ts.map +1 -1
  47. package/dist/src/marks/mark.js +101 -3
  48. package/dist/src/marks/point.d.ts +1 -1
  49. package/dist/src/marks/point.d.ts.map +1 -1
  50. package/dist/src/marks/point.fragment.glsl.js +1 -1
  51. package/dist/src/marks/point.vertex.glsl.js +1 -1
  52. package/dist/src/marks/rect.common.glsl.js +1 -1
  53. package/dist/src/marks/rect.d.ts.map +1 -1
  54. package/dist/src/marks/rect.fragment.glsl.js +1 -1
  55. package/dist/src/marks/rect.js +41 -0
  56. package/dist/src/marks/rect.vertex.glsl.js +1 -1
  57. package/dist/src/selection/selection.d.ts +27 -2
  58. package/dist/src/selection/selection.d.ts.map +1 -1
  59. package/dist/src/selection/selection.js +53 -3
  60. package/dist/src/spec/data.d.ts +18 -1
  61. package/dist/src/spec/mark.d.ts +58 -1
  62. package/dist/src/spec/parameter.d.ts +71 -31
  63. package/dist/src/spec/sampleView.d.ts +12 -1
  64. package/dist/src/spec/view.d.ts +9 -2
  65. package/dist/src/styles/genome-spy.css.d.ts +1 -1
  66. package/dist/src/styles/genome-spy.css.d.ts.map +1 -1
  67. package/dist/src/styles/genome-spy.css.js +12 -1
  68. package/dist/src/styles/genome-spy.scss +19 -1
  69. package/dist/src/types/selectionTypes.d.ts +4 -7
  70. package/dist/src/types/viewContext.d.ts +0 -15
  71. package/dist/src/utils/expression.d.ts.map +1 -1
  72. package/dist/src/utils/expression.js +4 -0
  73. package/dist/src/utils/indexer.d.ts +0 -2
  74. package/dist/src/utils/indexer.d.ts.map +1 -1
  75. package/dist/src/utils/reservationMap.d.ts +4 -4
  76. package/dist/src/utils/reservationMap.d.ts.map +1 -1
  77. package/dist/src/utils/scaleNull.d.ts +0 -2
  78. package/dist/src/utils/scaleNull.d.ts.map +1 -1
  79. package/dist/src/utils/trees.d.ts +2 -2
  80. package/dist/src/utils/ui/tooltip.d.ts +6 -10
  81. package/dist/src/utils/ui/tooltip.d.ts.map +1 -1
  82. package/dist/src/utils/ui/tooltip.js +74 -42
  83. package/dist/src/view/concatView.d.ts +1 -1
  84. package/dist/src/view/concatView.d.ts.map +1 -1
  85. package/dist/src/view/concatView.js +1 -1
  86. package/dist/src/view/gridView/gridChild.d.ts +53 -0
  87. package/dist/src/view/gridView/gridChild.d.ts.map +1 -0
  88. package/dist/src/view/gridView/gridChild.js +753 -0
  89. package/dist/src/view/gridView/gridView.d.ts +64 -0
  90. package/dist/src/view/gridView/gridView.d.ts.map +1 -0
  91. package/dist/src/view/{gridView.js → gridView/gridView.js} +40 -595
  92. package/dist/src/view/gridView/scrollbar.d.ts +32 -0
  93. package/dist/src/view/gridView/scrollbar.d.ts.map +1 -0
  94. package/dist/src/view/gridView/scrollbar.js +186 -0
  95. package/dist/src/view/gridView/selectionRect.d.ts +10 -0
  96. package/dist/src/view/gridView/selectionRect.d.ts.map +1 -0
  97. package/dist/src/view/gridView/selectionRect.js +182 -0
  98. package/dist/src/view/layout/rectangle.d.ts +11 -1
  99. package/dist/src/view/layout/rectangle.d.ts.map +1 -1
  100. package/dist/src/view/layout/rectangle.js +22 -2
  101. package/dist/src/view/layout/rectangle.test.js +12 -0
  102. package/dist/src/view/paramMediator.d.ts.map +1 -1
  103. package/dist/src/view/paramMediator.js +11 -2
  104. package/dist/src/view/scaleResolution.d.ts +1 -0
  105. package/dist/src/view/scaleResolution.d.ts.map +1 -1
  106. package/dist/src/view/scaleResolution.js +43 -33
  107. package/dist/src/view/testUtils.d.ts.map +1 -1
  108. package/dist/src/view/testUtils.js +0 -4
  109. package/dist/src/view/view.d.ts +6 -0
  110. package/dist/src/view/view.d.ts.map +1 -1
  111. package/dist/src/view/view.js +19 -0
  112. package/dist/src/view/viewFactory.d.ts.map +1 -1
  113. package/dist/src/view/viewFactory.js +13 -1
  114. package/package.json +2 -2
  115. package/dist/bundle/index-DS2hvLgl.js +0 -3425
  116. package/dist/src/view/gridView.d.ts +0 -135
  117. package/dist/src/view/gridView.d.ts.map +0 -1
@@ -8,6 +8,7 @@ import {
8
8
  isString,
9
9
  lerp,
10
10
  } from "vega-util";
11
+ import { format as d3format } from "d3-format";
11
12
  import smoothstep from "./smoothstep.js";
12
13
  import clamp from "./clamp.js";
13
14
  import linearstep from "./linearstep.js";
@@ -18,6 +19,9 @@ import { selectionTest } from "../selection/selection.js";
18
19
  */
19
20
  const functionContext = {
20
21
  clamp,
22
+ format(/** @type {number} */ value, /** @type {string} */ format) {
23
+ return d3format(format)(value);
24
+ },
21
25
  isArray,
22
26
  isBoolean,
23
27
  isDefined(/** @type {any} */ _) {
@@ -7,9 +7,7 @@
7
7
  */
8
8
  export default function createIndexer<T>(): {
9
9
  (value: T): number;
10
- /** @param {Iterable<T>} iterable */
11
10
  addAll(iterable: Iterable<T>): void;
12
- /** @param {number} value */
13
11
  invert(value: number): T;
14
12
  domain(): T[];
15
13
  };
@@ -1 +1 @@
1
- {"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../../../src/utils/indexer.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,sCAFa,CAAC;YAYE,CAAC;IAeb,oCAAoC;qBAAxB,QAAQ,CAAC,CAAC,CAAC;IAOvB,4BAA4B;kBAAhB,MAAM;;EAYrB"}
1
+ {"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../../../src/utils/indexer.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,sCAFa,CAAC;YAYE,CAAC;qBAeD,QAAQ,CAAC,CAAC,CAAC;kBAOX,MAAM;;EAYrB"}
@@ -17,10 +17,10 @@ export default class ReservationMap {
17
17
  maxSize: number;
18
18
  lowerLimit: number;
19
19
  upperLimit: number;
20
- lowerLimits: Float64Array;
21
- upperLimits: Float64Array;
22
- lowerChildren: Int32Array;
23
- upperChildren: Int32Array;
20
+ lowerLimits: Float64Array<ArrayBuffer>;
21
+ upperLimits: Float64Array<ArrayBuffer>;
22
+ lowerChildren: Int32Array<ArrayBuffer>;
23
+ upperChildren: Int32Array<ArrayBuffer>;
24
24
  reset(): void;
25
25
  n: number;
26
26
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"reservationMap.d.ts","sourceRoot":"","sources":["../../../src/utils/reservationMap.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH;IACI;;;;;OAKG;IACH,qBAJW,MAAM,eACN,MAAM,eACN,MAAM,EAehB;IAZG,gBAAsB;IACtB,mBAA4B;IAC5B,mBAA4B;IAI5B,0BAA0C;IAC1C,0BAA0C;IAC1C,0BAA0C;IAC1C,0BAA0C;IAK9C,cAUC;IAHG,UAAU;IAKd;;;;;;OAMG;IACH,iBALW,MAAM,SACN,MAAM,MACN,MAAM,GACJ,MAAM,CAkBlB;IAED;;;;;OAKG;IACH,eAJW,MAAM,SACN,MAAM,GACJ,OAAO,CA8BnB;CACJ"}
1
+ {"version":3,"file":"reservationMap.d.ts","sourceRoot":"","sources":["../../../src/utils/reservationMap.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH;IACI;;;;;OAKG;IACH,qBAJW,MAAM,eACN,MAAM,eACN,MAAM,EAehB;IAZG,gBAAsB;IACtB,mBAA4B;IAC5B,mBAA4B;IAI5B,uCAA0C;IAC1C,uCAA0C;IAC1C,uCAA0C;IAC1C,uCAA0C;IAK9C,cAUC;IAHG,UAAU;IAKd;;;;;;OAMG;IACH,iBALW,MAAM,SACN,MAAM,MACN,MAAM,GACJ,MAAM,CAkBlB;IAED;;;;;OAKG;IACH,eAJW,MAAM,SACN,MAAM,GACJ,OAAO,CA8BnB;CACJ"}
@@ -3,10 +3,8 @@
3
3
  */
4
4
  export default function scaleNull(): {
5
5
  (x: any): any;
6
- /** @param {any} x */
7
6
  invert(x: any): any;
8
7
  copy: typeof scaleNull;
9
- /** Keep vega-scale happy */
10
8
  invertRange(): void;
11
9
  type: string;
12
10
  };
@@ -1 +1 @@
1
- {"version":3,"file":"scaleNull.d.ts","sourceRoot":"","sources":["../../../src/utils/scaleNull.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;QACgB,GAAG;IAGf,qBAAqB;cAAT,GAAG;;IAKf,4BAA4B;;;EAQ/B"}
1
+ {"version":3,"file":"scaleNull.d.ts","sourceRoot":"","sources":["../../../src/utils/scaleNull.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;QACgB,GAAG;cAGH,GAAG;;;;EAalB"}
@@ -10,7 +10,7 @@
10
10
  */
11
11
  export function nodesToTreesWithAccessor<T>(nodes: T[], parentAccessor: (node: T) => T): {
12
12
  ref: T;
13
- children: any[];
13
+ children: /*elided*/ any[];
14
14
  }[];
15
15
  /**
16
16
  * Takes an array of nodes that have parent references and turns them into a
@@ -24,7 +24,7 @@ export function nodesToTrees<T extends {
24
24
  parent: T;
25
25
  }>(nodes: T[]): {
26
26
  ref: T;
27
- children: any[];
27
+ children: /*elided*/ any[];
28
28
  }[];
29
29
  /**
30
30
  * Visits a tree using depth-first search. Uses a custom accessor for children.
@@ -4,16 +4,11 @@ export default class Tooltip {
4
4
  * @param {HTMLElement} container
5
5
  */
6
6
  constructor(container: HTMLElement);
7
- container: HTMLElement;
8
- element: HTMLDivElement;
9
- _visible: boolean;
10
- /** @type {any} */
11
- _previousTooltipDatum: any;
12
- enabledStack: boolean[];
13
- _penaltyUntil: number;
14
- /** @type {[number, number]} */
15
- _lastCoords: [number, number];
16
- _previousMove: number;
7
+ /**
8
+ * @param {boolean} sticky
9
+ */
10
+ set sticky(sticky: boolean);
11
+ get sticky(): boolean;
17
12
  /**
18
13
  * @param {boolean} visible
19
14
  */
@@ -46,5 +41,6 @@ export default class Tooltip {
46
41
  */
47
42
  updateWithDatum<T>(datum: T, converter?: (arg0: T) => Promise<string | HTMLElement | import("lit").TemplateResult>): void;
48
43
  _isPenalty(): boolean;
44
+ #private;
49
45
  }
50
46
  //# sourceMappingURL=tooltip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../../src/utils/ui/tooltip.js"],"names":[],"mappings":"AAIA,gEAAiE;AAEjE;IACI;;OAEG;IACH,uBAFW,WAAW,EAsBrB;IAnBG,uBAA0B;IAE1B,wBAA4C;IAE5C,kBAAoB;IAGpB,kBAAkB;IAClB,uBADW,GAAG,CACwB;IAEtC,wBAA0B;IAE1B,sBAAsB;IACtB,+BAA+B;IAC/B,aADW,CAAC,MAAM,EAAE,MAAM,CAAC,CACC;IAE5B,sBAAsB;IAK1B;;OAEG;IACH,8BAKC;IAED,uBAEC;IAED,uBAEC;IAED;;OAEG;IACH,0BAFW,OAAO,QAOjB;IAED,wBAEC;IAED;;OAEG;IACH,4BAFW,UAAU,QAkCpB;IA/BG,8BAA0D;IAiC9D,wBAiBC;IAED;;OAEG;IACH,oBAFW,MAAM,GAAG,OAAO,KAAK,EAAE,cAAc,GAAG,WAAW,QAiB7D;IAED,cAGC;IAED;;;;;;;OAOG;IACH,gBAFa,CAAC,SAFH,CAAC,cACD,CAAS,IAAC,EAAD,CAAC,KAAE,OAAO,CAAC,MAAM,GAAG,WAAW,GAAG,OAAO,KAAK,EAAE,cAAc,CAAC,QAmBlF;IAED,sBAEC;CACJ"}
1
+ {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../../src/utils/ui/tooltip.js"],"names":[],"mappings":"AAIA,0CAA2C,qBAAqB,CAAC;AAEjE;IAsBI;;OAEG;IACH,uBAFW,WAAW,EAUrB;IAED;;OAEG;IACH,mBAFW,OAAO,EAQjB;IAED,cAVW,OAAO,CAYjB;IAED;;OAEG;IACH,qBAFW,OAAO,EAOjB;IAED,eATW,OAAO,CAWjB;IAED,uBAEC;IAED;;OAEG;IACH,0BAFW,OAAO,QAOjB;IAED,wBAEC;IAED;;OAEG;IACH,4BAFW,UAAU,QAsCpB;IA/BG,8BAA2D;IAiC/D,wBAiBC;IAED;;OAEG;IACH,oBAFW,MAAM,GAAG,OAAO,KAAK,EAAE,cAAc,GAAG,WAAW,QAqB7D;IAED,cAGC;IAED;;;;;;;OAOG;IACH,gBAFa,CAAC,SAFH,CAAC,cACD,CAAS,IAAC,EAAD,CAAC,KAAE,OAAO,CAAC,MAAM,GAAG,WAAW,GAAG,OAAO,KAAK,EAAE,cAAc,CAAC,QAmBlF;IAED,sBAEC;;CACJ"}
@@ -5,68 +5,96 @@ import { peek } from "../arrayUtils.js";
5
5
  export const SUPPRESS_TOOLTIP_CLASS_NAME = "gs-suppress-tooltip";
6
6
 
7
7
  export default class Tooltip {
8
+ #sticky = false;
9
+ #visible = true;
10
+
11
+ /** @type {any} */
12
+ #previousTooltipDatum = undefined;
13
+
14
+ #penaltyUntil = 0;
15
+
16
+ /** @type {[number, number]} */
17
+ #lastCoords = undefined;
18
+
19
+ #previousMove = 0;
20
+
21
+ /** @type {HTMLDivElement} */
22
+ #element;
23
+
24
+ /** @type {HTMLElement} */
25
+ #container;
26
+
27
+ #enabledStack = [true];
28
+
8
29
  /**
9
30
  * @param {HTMLElement} container
10
31
  */
11
32
  constructor(container) {
12
- this.container = container;
13
-
14
- this.element = document.createElement("div");
15
- this.element.className = "tooltip";
16
- this._visible = true;
17
- this.container.appendChild(this.element);
33
+ this.#container = container;
18
34
 
19
- /** @type {any} */
20
- this._previousTooltipDatum = undefined;
35
+ this.#element = document.createElement("div");
36
+ this.#element.className = "tooltip";
37
+ this.#container.appendChild(this.#element);
21
38
 
22
- this.enabledStack = [true];
23
-
24
- this._penaltyUntil = 0;
25
- /** @type {[number, number]} */
26
- this._lastCoords = undefined;
39
+ this.clear();
40
+ }
27
41
 
28
- this._previousMove = 0;
42
+ /**
43
+ * @param {boolean} sticky
44
+ */
45
+ set sticky(sticky) {
46
+ if (!sticky && this.#sticky) {
47
+ this.clear();
48
+ }
49
+ this.#sticky = sticky;
50
+ this.#element.classList.toggle("sticky", this.#sticky);
51
+ }
29
52
 
30
- this.clear();
53
+ get sticky() {
54
+ return this.#sticky;
31
55
  }
32
56
 
33
57
  /**
34
58
  * @param {boolean} visible
35
59
  */
36
60
  set visible(visible) {
37
- if (visible != this._visible) {
38
- this.element.style.display = visible ? null : "none";
39
- this._visible = visible;
61
+ if (visible != this.#visible) {
62
+ this.#element.style.display = visible ? null : "none";
63
+ this.#visible = visible;
40
64
  }
41
65
  }
42
66
 
43
67
  get visible() {
44
- return this._visible;
68
+ return this.#visible;
45
69
  }
46
70
 
47
71
  get enabled() {
48
- return peek(this.enabledStack) ?? true;
72
+ return peek(this.#enabledStack) ?? true;
49
73
  }
50
74
 
51
75
  /**
52
76
  * @param {boolean} enabled True if tooltip is enabled (allowed to be shown)
53
77
  */
54
78
  pushEnabledState(enabled) {
55
- this.enabledStack.push(enabled);
79
+ this.#enabledStack.push(enabled);
56
80
  if (!enabled) {
57
81
  this.visible = false;
58
82
  }
59
83
  }
60
84
 
61
85
  popEnabledState() {
62
- this.enabledStack.pop();
86
+ this.#enabledStack.pop();
63
87
  }
64
88
 
65
89
  /**
66
90
  * @param {MouseEvent} mouseEvent
67
91
  */
68
92
  handleMouseMove(mouseEvent) {
69
- this.mouseCoords = clientPoint(this.container, mouseEvent);
93
+ if (this.#sticky) {
94
+ return;
95
+ }
96
+
97
+ this.mouseCoords = clientPoint(this.#container, mouseEvent);
70
98
 
71
99
  const now = performance.now();
72
100
 
@@ -75,28 +103,28 @@ export default class Tooltip {
75
103
  if (
76
104
  !this.visible &&
77
105
  !this._isPenalty() &&
78
- now - this._previousMove > 500
106
+ now - this.#previousMove > 500
79
107
  ) {
80
- this._penaltyUntil = now + 70;
108
+ this.#penaltyUntil = now + 70;
81
109
  }
82
110
 
83
111
  // Disable the tooltip for a while if the mouse is being moved very quickly.
84
112
  // Makes the tooltip less annoying.
85
113
  // TODO: Should calculate speed: pixels per millisecond or something
86
114
  if (
87
- this._lastCoords &&
88
- distance(this.mouseCoords, this._lastCoords) > 20
115
+ this.#lastCoords &&
116
+ distance(this.mouseCoords, this.#lastCoords) > 20
89
117
  ) {
90
- this._penaltyUntil = now + 400;
118
+ this.#penaltyUntil = now + 400;
91
119
  }
92
120
 
93
- this._lastCoords = this.mouseCoords;
121
+ this.#lastCoords = this.mouseCoords;
94
122
 
95
123
  if (this.visible) {
96
124
  this.updatePlacement();
97
125
  }
98
126
 
99
- this._previousMove = now;
127
+ this.#previousMove = now;
100
128
  }
101
129
 
102
130
  updatePlacement() {
@@ -106,15 +134,15 @@ export default class Tooltip {
106
134
  const [mouseX, mouseY] = this.mouseCoords;
107
135
 
108
136
  let x = mouseX + spacing;
109
- if (x > this.container.clientWidth - this.element.offsetWidth) {
110
- x = mouseX - spacing - this.element.offsetWidth;
137
+ if (x > this.#container.clientWidth - this.#element.offsetWidth) {
138
+ x = mouseX - spacing - this.#element.offsetWidth;
111
139
  }
112
- this.element.style.left = x + "px";
140
+ this.#element.style.left = x + "px";
113
141
 
114
- this.element.style.top =
142
+ this.#element.style.top =
115
143
  Math.min(
116
144
  mouseY + spacing,
117
- this.container.clientHeight - this.element.offsetHeight
145
+ this.#container.clientHeight - this.#element.offsetHeight
118
146
  ) + "px";
119
147
  }
120
148
 
@@ -122,16 +150,20 @@ export default class Tooltip {
122
150
  * @param {string | import("lit").TemplateResult | HTMLElement} content
123
151
  */
124
152
  setContent(content) {
153
+ if (this.#sticky) {
154
+ return;
155
+ }
156
+
125
157
  if (!content || !this.enabled || this._isPenalty()) {
126
158
  if (this.visible) {
127
- render("", this.element);
159
+ render("", this.#element);
128
160
  this.visible = false;
129
161
  }
130
- this._previousTooltipDatum = undefined;
162
+ this.#previousTooltipDatum = undefined;
131
163
  return;
132
164
  }
133
165
 
134
- render(content, this.element);
166
+ render(content, this.#element);
135
167
 
136
168
  this.visible = true;
137
169
 
@@ -139,7 +171,7 @@ export default class Tooltip {
139
171
  }
140
172
 
141
173
  clear() {
142
- this._previousTooltipDatum = undefined;
174
+ this.#previousTooltipDatum = undefined;
143
175
  this.setContent(undefined);
144
176
  }
145
177
 
@@ -152,8 +184,8 @@ export default class Tooltip {
152
184
  * @template T
153
185
  */
154
186
  updateWithDatum(datum, converter) {
155
- if (datum !== this._previousTooltipDatum) {
156
- this._previousTooltipDatum = datum;
187
+ if (datum !== this.#previousTooltipDatum) {
188
+ this.#previousTooltipDatum = datum;
157
189
  if (!converter) {
158
190
  converter = (d) =>
159
191
  Promise.resolve(html` ${JSON.stringify(d)} `);
@@ -170,7 +202,7 @@ export default class Tooltip {
170
202
  }
171
203
 
172
204
  _isPenalty() {
173
- return this._penaltyUntil && this._penaltyUntil > performance.now();
205
+ return this.#penaltyUntil && this.#penaltyUntil > performance.now();
174
206
  }
175
207
  }
176
208
 
@@ -12,5 +12,5 @@ export default class ConcatView extends GridView {
12
12
  */
13
13
  constructor(spec: import("../spec/view.js").AnyConcatSpec, context: import("../types/viewContext.js").default, layoutParent: import("./containerView.js").default, dataParent: import("./view.js").default, name: string);
14
14
  }
15
- import GridView from "./gridView.js";
15
+ import GridView from "./gridView/gridView.js";
16
16
  //# sourceMappingURL=concatView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"concatView.d.ts","sourceRoot":"","sources":["../../../src/view/concatView.js"],"names":[],"mappings":"AAGA;;GAEG;AACH;IACI;;;;;;;OAOG;IACH,kBANW,OAAO,iBAAiB,EAAE,aAAa,WACvC,OAAO,yBAAyB,EAAE,OAAO,gBACzC,OAAO,oBAAoB,EAAE,OAAO,cACpC,OAAO,WAAW,EAAE,OAAO,QAC3B,MAAM,EAiBhB;CAqDJ;qBAlFoB,eAAe"}
1
+ {"version":3,"file":"concatView.d.ts","sourceRoot":"","sources":["../../../src/view/concatView.js"],"names":[],"mappings":"AAGA;;GAEG;AACH;IACI;;;;;;;OAOG;IACH,kBANW,OAAO,iBAAiB,EAAE,aAAa,WACvC,OAAO,yBAAyB,EAAE,OAAO,gBACzC,OAAO,oBAAoB,EAAE,OAAO,cACpC,OAAO,WAAW,EAAE,OAAO,QAC3B,MAAM,EAiBhB;CAqDJ;qBAlFoB,wBAAwB"}
@@ -1,5 +1,5 @@
1
1
  import { isConcatSpec, isHConcatSpec, isVConcatSpec } from "./viewFactory.js";
2
- import GridView from "./gridView.js";
2
+ import GridView from "./gridView/gridView.js";
3
3
 
4
4
  /**
5
5
  * Creates a vertically or horizontally concatenated layout for children.
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @param {import("../../spec/view.js").ViewBackground} viewBackground
3
+ * @returns {import("../../spec/view.js").UnitSpec}
4
+ */
5
+ export function createBackground(viewBackground: import("../../spec/view.js").ViewBackground): import("../../spec/view.js").UnitSpec;
6
+ /**
7
+ * @param {import("../../spec/view.js").ViewBackground} viewBackground
8
+ * @returns {import("../../spec/view.js").UnitSpec}
9
+ */
10
+ export function createBackgroundStroke(viewBackground: import("../../spec/view.js").ViewBackground): import("../../spec/view.js").UnitSpec;
11
+ export default class GridChild {
12
+ /**
13
+ * @param {import("../view.js").default} view
14
+ * @param {import("../containerView.js").default} layoutParent
15
+ * @param {number} serial
16
+ */
17
+ constructor(view: import("../view.js").default, layoutParent: import("../containerView.js").default, serial: number);
18
+ layoutParent: import("../containerView.js").default;
19
+ view: import("../view.js").default;
20
+ serial: number;
21
+ /** @type {UnitView} */
22
+ background: UnitView;
23
+ /** @type {UnitView} */
24
+ backgroundStroke: UnitView;
25
+ /** @type {Partial<Record<import("../../spec/axis.js").AxisOrient, AxisView>>} axes */
26
+ axes: Partial<Record<import("../../spec/axis.js").AxisOrient, AxisView>>;
27
+ /** @type {Partial<Record<import("../../spec/axis.js").AxisOrient, AxisGridView>>} gridLines */
28
+ gridLines: Partial<Record<import("../../spec/axis.js").AxisOrient, AxisGridView>>;
29
+ /** @type {Partial<Record<import("./scrollbar.js").ScrollDirection, Scrollbar>>} */
30
+ scrollbars: Partial<Record<import("./scrollbar.js").ScrollDirection, Scrollbar>>;
31
+ /** @type {SelectionRect} */
32
+ selectionRect: SelectionRect;
33
+ /** @type {UnitView} */
34
+ title: UnitView;
35
+ /** @type {Rectangle} */
36
+ coords: Rectangle;
37
+ getChildren(): Generator<import("../view.js").default, void, unknown>;
38
+ /**
39
+ * Create view decorations, grid lines, axes, etc.
40
+ */
41
+ createAxes(): Promise<void>;
42
+ getOverhang(): Padding;
43
+ getOverhangAndPadding(): Padding;
44
+ #private;
45
+ }
46
+ import UnitView from "../unitView.js";
47
+ import AxisView from "../axisView.js";
48
+ import AxisGridView from "../axisGridView.js";
49
+ import Scrollbar from "./scrollbar.js";
50
+ import SelectionRect from "./selectionRect.js";
51
+ import Rectangle from "../layout/rectangle.js";
52
+ import Padding from "../layout/padding.js";
53
+ //# sourceMappingURL=gridChild.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gridChild.d.ts","sourceRoot":"","sources":["../../../../src/view/gridView/gridChild.js"],"names":[],"mappings":"AA+pBA;;;GAGG;AACH,iDAHW,OAAO,oBAAoB,EAAE,cAAc,GACzC,OAAO,oBAAoB,EAAE,QAAQ,CA8BjD;AAED;;;GAGG;AACH,uDAHW,OAAO,oBAAoB,EAAE,cAAc,GACzC,OAAO,oBAAoB,EAAE,QAAQ,CA6CjD;AA7tBD;IACI;;;;OAIG;IACH,kBAJW,OAAO,YAAY,EAAE,OAAO,gBAC5B,OAAO,qBAAqB,EAAE,OAAO,UACrC,MAAM,EAyFhB;IAtFG,oDAAgC;IAChC,mCAAgB;IAChB,eAAoB;IAEpB,uBAAuB;IACvB,YADW,QAAQ,CACQ;IAE3B,uBAAuB;IACvB,kBADW,QAAQ,CACc;IAEjC,sFAAsF;IACtF,MADW,OAAO,CAAC,MAAM,CAAC,OAAO,oBAAoB,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAC/D;IAEd,+FAA+F;IAC/F,WADW,OAAO,CAAC,MAAM,CAAC,OAAO,oBAAoB,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC,CAC9D;IAEnB,mFAAmF;IACnF,YADW,OAAO,CAAC,MAAM,CAAC,OAAO,gBAAgB,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,CAC3D;IAEpB,4BAA4B;IAC5B,eADW,aAAa,CACM;IAE9B,uBAAuB;IACvB,OADW,QAAQ,CACG;IAEtB,wBAAwB;IACxB,QADW,SAAS,CACQ;IAiZhC,sEAiBC;IAED;;OAEG;IACH,4BAsKC;IAED,uBAqBC;IAED,iCAEC;;CACJ;qBA9oBoB,gBAAgB;qBANK,gBAAgB;yBADjC,oBAAoB;sBAQvB,gBAAgB;0BACZ,oBAAoB;sBAJxB,wBAAwB;oBAF1B,sBAAsB"}