gridviz 2.0.45 → 2.0.47

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 (54) hide show
  1. package/README.md +119 -119
  2. package/dist/gridviz.js +7559 -7549
  3. package/dist/gridviz.min.js +1 -1
  4. package/package.json +78 -76
  5. package/src/App.js +668 -668
  6. package/src/BackgroundLayer.js +182 -182
  7. package/src/BackgroundLayerWMS.js +131 -131
  8. package/src/Dataset.js +76 -76
  9. package/src/DatasetComponent.js +101 -101
  10. package/src/GeoCanvas.js +420 -420
  11. package/src/LabelLayer.js +190 -190
  12. package/src/Layer.js +92 -92
  13. package/src/Legend.js +86 -86
  14. package/src/LineLayer.js +150 -150
  15. package/src/Style.js +114 -114
  16. package/src/Tooltip.js +172 -172
  17. package/src/dataset/COGeo.js +24 -24
  18. package/src/dataset/CSVGrid.js +104 -104
  19. package/src/dataset/GeoTIFF.js +127 -127
  20. package/src/dataset/GridTile.js +41 -41
  21. package/src/dataset/TiledGrid.js +264 -264
  22. package/src/index.js +177 -176
  23. package/src/legend/ColorCategoryLegend.js +124 -124
  24. package/src/legend/ColorDiscreteLegend.js +103 -103
  25. package/src/legend/ColorLegend.js +124 -124
  26. package/src/legend/SegmentOrientationLegend.js +87 -87
  27. package/src/legend/SegmentWidthLegend.js +97 -97
  28. package/src/legend/SizeLegend.js +141 -141
  29. package/src/style/CompositionStyle.js +300 -300
  30. package/src/style/ContourStyle.js +54 -54
  31. package/src/style/DotDensityStyle.js +156 -156
  32. package/src/style/JoyPlotStyle.js +135 -135
  33. package/src/style/LegoStyle.js +112 -112
  34. package/src/style/MosaicStyle.js +107 -107
  35. package/src/style/NinjaStarStyle.js +124 -124
  36. package/src/style/PillarStyle.js +230 -230
  37. package/src/style/SegmentStyle.js +142 -142
  38. package/src/style/ShapeColorSizeStyle.js +126 -126
  39. package/src/style/SideCatStyle.js +172 -172
  40. package/src/style/SideStyle.js +218 -218
  41. package/src/style/SquareColorCatWGLStyle.js +120 -120
  42. package/src/style/SquareColorWGLStyle.js +146 -146
  43. package/src/style/StrokeStyle.js +131 -131
  44. package/src/style/TanakaStyle.js +160 -160
  45. package/src/style/TextStyle.js +132 -132
  46. package/src/utils/Utils.js +35 -35
  47. package/src/utils/WebGLRectangleColoring.js +106 -106
  48. package/src/utils/WebGLSquareColoring.js +118 -118
  49. package/src/utils/WebGLSquareColoringAdvanced.js +230 -230
  50. package/src/utils/WebGLSquareColoringCatAdvanced.js +133 -133
  51. package/src/utils/WebGLSquareColoringKS.js +153 -153
  52. package/src/utils/stretching.js +131 -131
  53. package/src/utils/webGLUtils.js +71 -71
  54. package/src/utils/zoomUtils.js +142 -142
package/src/Style.js CHANGED
@@ -1,114 +1,114 @@
1
- //@ts-check
2
- 'use strict'
3
-
4
- /**
5
- * Statistics of a set of values
6
- * @typedef {{min:number,max:number}} Stat */
7
-
8
- /** @typedef {"square"|"circle"|"diamond"|"donut"|"none"} Shape */
9
-
10
- /**
11
- * A style, to show a grid dataset.
12
- *
13
- * @abstract
14
- *
15
- * @author Joseph Davies, Julien Gaffuri
16
- */
17
- export class Style {
18
- /**
19
- * @abstract
20
- * @param {{filter?:function(import('./Dataset').Cell):boolean,offset?:function(import('./Dataset').Cell,number,number):{dx:number,dy:number},minZoom?:number,maxZoom?:number}} opts
21
- * minZoom: The minimum zoom level when to show the layer. maxZoom: The maximum zoom level when to show the layer
22
- */
23
- constructor(opts) {
24
- opts = opts || {}
25
-
26
- /** A filter function to apply to the cell list, to filter out some cells not to be drawn (such as for example the cells with value=0).
27
- * @protected
28
- * @type {function(import('./Dataset').Cell):boolean} */
29
- this.filter = opts.filter || (() => true)
30
-
31
- /** An offset. This is to alter the position of all symbols in a given direction. In geographical unit.
32
- * @protected
33
- * @type {function(import('./Dataset').Cell,number,number):{dx:number,dy:number}} */
34
- this.offset = opts.offset || ((c, r, zf) => ({ dx: 0, dy: 0 }))
35
-
36
- /** The minimum zoom factor: Below this level, the layer is not shown.
37
- * @type {number}
38
- * */
39
- this.minZoom = opts.minZoom || 0
40
-
41
- /** The maximum zoom factor: Above this level, the layer is not shown.
42
- * @type {number}
43
- * */
44
- this.maxZoom = opts.maxZoom || Infinity
45
-
46
- //ensure acceptable values for the zoom limits.
47
- if (this.minZoom >= this.maxZoom)
48
- throw new Error('Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.')
49
-
50
- /**
51
- * @public
52
- * @type {Array.<import("./Legend").Legend>} */
53
- this.legends = []
54
- }
55
-
56
- /**
57
- * Draw cells.
58
- *
59
- * @param {Array.<import('./Dataset').Cell>} cells The cells to draw.
60
- * @param {number} resolution Their resolution (in geographic unit)
61
- * @param {import("./GeoCanvas").GeoCanvas} cg The canvas where to draw them.
62
- * @abstract
63
- */
64
- draw(cells, resolution, cg) {
65
- throw new Error('Method draw not implemented.')
66
- }
67
-
68
- //getters and setters
69
-
70
- /** @returns {function(import('./Dataset').Cell,number,number):{dx:number,dy:number}} */
71
- getOffset() {
72
- return this.offset
73
- }
74
- /** @param {function(import('./Dataset').Cell,number,number):{dx:number,dy:number}} val @returns {this} */
75
- setOffset(val) {
76
- this.offset = val
77
- return this
78
- }
79
-
80
- /** Hide all legend elements of the style, if any
81
- * @param {object} opts
82
- * @returns {this} */
83
- updateLegends(opts) {
84
- for (const lg of this.legends) lg.update(opts)
85
- return this
86
- }
87
-
88
- /**
89
- * Compute some statistics on a value of some cells.
90
- * This is used to define how to draw specifically the cells within the view.
91
- * TODO: compute median ?
92
- *
93
- * @param {Array.<import('./Dataset').Cell>} cells
94
- * @param {function(import('./Dataset').Cell):number} valFun
95
- * @param {boolean} ignoreZeros
96
- * @returns {Stat | undefined}
97
- */
98
- static getStatistics(cells, valFun, ignoreZeros) {
99
- if (!cells || cells.length == 0) return undefined
100
- let min = Infinity
101
- let max = -Infinity
102
- //let sum = 0
103
- //let nb = 0
104
- for (const cell of cells) {
105
- const v = +valFun(cell)
106
- if (ignoreZeros && !v) continue
107
- if (v < min) min = v
108
- if (v > max) max = v
109
- //sum += v
110
- //nb++
111
- }
112
- return { min: min, max: max }
113
- }
114
- }
1
+ //@ts-check
2
+ 'use strict'
3
+
4
+ /**
5
+ * Statistics of a set of values
6
+ * @typedef {{min:number,max:number}} Stat */
7
+
8
+ /** @typedef {"square"|"circle"|"diamond"|"donut"|"none"} Shape */
9
+
10
+ /**
11
+ * A style, to show a grid dataset.
12
+ *
13
+ * @abstract
14
+ *
15
+ * @author Joseph Davies, Julien Gaffuri
16
+ */
17
+ export class Style {
18
+ /**
19
+ * @abstract
20
+ * @param {{filter?:function(import('./Dataset').Cell):boolean,offset?:function(import('./Dataset').Cell,number,number):{dx:number,dy:number},minZoom?:number,maxZoom?:number}} opts
21
+ * minZoom: The minimum zoom level when to show the layer. maxZoom: The maximum zoom level when to show the layer
22
+ */
23
+ constructor(opts) {
24
+ opts = opts || {}
25
+
26
+ /** A filter function to apply to the cell list, to filter out some cells not to be drawn (such as for example the cells with value=0).
27
+ * @protected
28
+ * @type {function(import('./Dataset').Cell):boolean} */
29
+ this.filter = opts.filter || (() => true)
30
+
31
+ /** An offset. This is to alter the position of all symbols in a given direction. In geographical unit.
32
+ * @protected
33
+ * @type {function(import('./Dataset').Cell,number,number):{dx:number,dy:number}} */
34
+ this.offset = opts.offset || ((c, r, zf) => ({ dx: 0, dy: 0 }))
35
+
36
+ /** The minimum zoom factor: Below this level, the layer is not shown.
37
+ * @type {number}
38
+ * */
39
+ this.minZoom = opts.minZoom || 0
40
+
41
+ /** The maximum zoom factor: Above this level, the layer is not shown.
42
+ * @type {number}
43
+ * */
44
+ this.maxZoom = opts.maxZoom || Infinity
45
+
46
+ //ensure acceptable values for the zoom limits.
47
+ if (this.minZoom >= this.maxZoom)
48
+ throw new Error('Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.')
49
+
50
+ /**
51
+ * @public
52
+ * @type {Array.<import("./Legend").Legend>} */
53
+ this.legends = []
54
+ }
55
+
56
+ /**
57
+ * Draw cells.
58
+ *
59
+ * @param {Array.<import('./Dataset').Cell>} cells The cells to draw.
60
+ * @param {number} resolution Their resolution (in geographic unit)
61
+ * @param {import("./GeoCanvas").GeoCanvas} cg The canvas where to draw them.
62
+ * @abstract
63
+ */
64
+ draw(cells, resolution, cg) {
65
+ throw new Error('Method draw not implemented.')
66
+ }
67
+
68
+ //getters and setters
69
+
70
+ /** @returns {function(import('./Dataset').Cell,number,number):{dx:number,dy:number}} */
71
+ getOffset() {
72
+ return this.offset
73
+ }
74
+ /** @param {function(import('./Dataset').Cell,number,number):{dx:number,dy:number}} val @returns {this} */
75
+ setOffset(val) {
76
+ this.offset = val
77
+ return this
78
+ }
79
+
80
+ /** Hide all legend elements of the style, if any
81
+ * @param {object} opts
82
+ * @returns {this} */
83
+ updateLegends(opts) {
84
+ for (const lg of this.legends) lg.update(opts)
85
+ return this
86
+ }
87
+
88
+ /**
89
+ * Compute some statistics on a value of some cells.
90
+ * This is used to define how to draw specifically the cells within the view.
91
+ * TODO: compute median ?
92
+ *
93
+ * @param {Array.<import('./Dataset').Cell>} cells
94
+ * @param {function(import('./Dataset').Cell):number} valFun
95
+ * @param {boolean} ignoreZeros
96
+ * @returns {Stat | undefined}
97
+ */
98
+ static getStatistics(cells, valFun, ignoreZeros) {
99
+ if (!cells || cells.length == 0) return undefined
100
+ let min = Infinity
101
+ let max = -Infinity
102
+ //let sum = 0
103
+ //let nb = 0
104
+ for (const cell of cells) {
105
+ const v = +valFun(cell)
106
+ if (ignoreZeros && !v) continue
107
+ if (v < min) min = v
108
+ if (v > max) max = v
109
+ //sum += v
110
+ //nb++
111
+ }
112
+ return { min: min, max: max }
113
+ }
114
+ }
package/src/Tooltip.js CHANGED
@@ -1,172 +1,172 @@
1
- //@ts-check
2
- 'use strict'
3
-
4
- import { select } from 'd3-selection'
5
- //import { transition } from "d3-transition";
6
-
7
- /**
8
- * A generic class to make a tooltip.
9
- * It is a div element, which can be moved under the mouse pointer and filled with some information in html.
10
- */
11
- export class Tooltip {
12
- /**
13
- * @param {object} opts
14
- */
15
- constructor(opts) {
16
- opts = opts || {}
17
-
18
- /** @type {string} */
19
- this.div = opts.div || 'tooltip_eurostat'
20
- /** @type {string} */
21
- this.maxWidth = opts.maxWidth || '20em'
22
- /** @type {string} */
23
- this.fontSize = opts.fontSize || '1.2em'
24
- /** @type {string} */
25
- this.background = opts.background || 'white'
26
- /** @type {string} */
27
- this.padding = opts.padding || '5px'
28
- /** @type {string} */
29
- this.border = opts.border || '0px'
30
- /** @type {string} */
31
- this['border-radius'] = opts['border-radius'] || '5px'
32
- /** @type {string} */
33
- this['box-shadow'] = opts['box-shadow'] || '5px 5px 5px grey'
34
- /** @type {string} */
35
- this['font-family'] = opts['font-family'] || 'Helvetica, Arial, sans-serif'
36
-
37
- /** @type {number} */
38
- this.transitionDuration = opts.transitionDuration || 100
39
- /** @type {number} */
40
- this.xOffset = opts.xOffset || 30
41
- /** @type {number} */
42
- this.yOffset = opts.yOffset || 20
43
- /** @type {number} */ // e.g. to prevent mouse cursor covering cell being highlighted
44
- this.yMouseOffset = opts.yMouseOffset || 0
45
- /** @type {number} */
46
- this.xMouseOffset = opts.xMouseOffset || 0
47
- /** @type {HTMLElement} */
48
- this.parentElement = opts.parentElement || document.body
49
-
50
- /**
51
- * @public
52
- * @type {import("d3-selection").Selection} */
53
- this.tooltip = select('#' + this.div)
54
- if (this.tooltip.empty())
55
- this.tooltip = select(
56
- '#' + this.parentElement.id && this.parentElement.id != ''
57
- ? '#' + this.parentElement.id
58
- : 'body'
59
- )
60
- .append('div')
61
- .attr('id', this.div)
62
-
63
- //initialise
64
- this.tooltip.style('max-width', this.maxWidth)
65
- this.tooltip.style('overflow', 'hidden')
66
- this.tooltip.style('font-size', this.fontSize)
67
- this.tooltip.style('background', this.background)
68
- this.tooltip.style('padding', this.padding)
69
- this.tooltip.style('border', this.border)
70
- this.tooltip.style('border-radius', this['border-radius'])
71
- this.tooltip.style('box-shadow', this['box-shadow'])
72
- this.tooltip.style('font-family', this['font-family'])
73
- this.tooltip.style('position', 'absolute')
74
- this.tooltip.style('pointer-events', 'none')
75
- this.tooltip.style('opacity', '0')
76
-
77
- // aria-labels (thanks to wahlatlas)
78
- this.tooltip.attr('role', 'tooltip').attr('aria-live', 'polite')
79
- }
80
-
81
- /** Show the tooltip */
82
- show() {
83
- // @ts-ignore
84
- this.tooltip.transition().duration(this.transitionDuration).style('opacity', 1)
85
- }
86
-
87
- /** Hide the tooltip */
88
- hide() {
89
- // @ts-ignore
90
- this.tooltip.transition().duration(this.transitionDuration).style('opacity', 0)
91
- }
92
-
93
- /**
94
- * Set the content of the tooltip.
95
- * @param {string} html
96
- */
97
- html(html) {
98
- this.tooltip.html(html)
99
- }
100
-
101
- /**
102
- * Set the position of the tooltip at the mouse event position.
103
- * @param {MouseEvent} event
104
- */
105
- setPosition(event) {
106
- let parentRect = this.parentElement.getBoundingClientRect()
107
-
108
- this.tooltip
109
- .style('left', event.pageX - parentRect.left + this.xOffset + 'px')
110
- .style('top', event.pageY - parentRect.top - this.yOffset + 'px')
111
-
112
- this.ensureTooltipInsideContainer(event, parentRect)
113
- }
114
-
115
- /*
116
- my.mouseover = function (event, html) {
117
- if (html) my.html(html);
118
- my.setPosition(event);
119
- my.show()
120
- //this.ensureTooltipInsideContainer();
121
- };
122
-
123
- my.mousemove = function (event) {
124
- my.setPosition(event);
125
- //this.ensureTooltipInsideContainer();
126
- };
127
-
128
- my.mouseout = function () {
129
- my.hide();
130
- };*/
131
-
132
- style(k, v) {
133
- if (arguments.length == 1) return this.tooltip.style(k)
134
- this.tooltip.style(k, v)
135
- return this
136
- }
137
-
138
- attr(k, v) {
139
- if (arguments.length == 1) return this.tooltip.attr(k)
140
- this.tooltip.attr(k, v)
141
- return this
142
- }
143
-
144
- /**
145
- * @function ensureTooltipInsideContainer
146
- * @description Prevents the tooltip from overflowing out of the App container (ensures that the tooltip is inside the gridviz container)
147
- * @param {MouseEvent} event
148
- * @param {DOMRect} parentRect
149
- */
150
- ensureTooltipInsideContainer = function (event, parentRect) {
151
- let ttNode = this.tooltip.node()
152
-
153
- //too far right
154
- let maxRight = parentRect.width
155
- let ttRight = ttNode.offsetLeft + ttNode.clientWidth
156
- if (ttRight > maxRight) {
157
- let left = event.pageX - parentRect.left - ttNode.clientWidth - this.xOffset
158
- ttNode.style.left = left + 'px'
159
- // check if mouse covers tooltip
160
- if (ttNode.offsetLeft + ttNode.clientWidth + parentRect.left > event.pageX) {
161
- //move tooltip left so it doesnt cover mouse
162
- let left2 = event.pageX - (ttNode.clientWidth + this.xOffset + parentRect.left)
163
- ttNode.style.left = left2 + 'px'
164
- }
165
- }
166
-
167
- //too far down
168
- if (ttNode.offsetTop + ttNode.clientHeight > parentRect.height) {
169
- ttNode.style.top = ttNode.offsetTop - ttNode.clientHeight + 'px'
170
- }
171
- }
172
- }
1
+ //@ts-check
2
+ 'use strict'
3
+
4
+ import { select } from 'd3-selection'
5
+ //import { transition } from "d3-transition";
6
+
7
+ /**
8
+ * A generic class to make a tooltip.
9
+ * It is a div element, which can be moved under the mouse pointer and filled with some information in html.
10
+ */
11
+ export class Tooltip {
12
+ /**
13
+ * @param {object} opts
14
+ */
15
+ constructor(opts) {
16
+ opts = opts || {}
17
+
18
+ /** @type {string} */
19
+ this.div = opts.div || 'tooltip_eurostat'
20
+ /** @type {string} */
21
+ this.maxWidth = opts.maxWidth || '20em'
22
+ /** @type {string} */
23
+ this.fontSize = opts.fontSize || '1.2em'
24
+ /** @type {string} */
25
+ this.background = opts.background || 'white'
26
+ /** @type {string} */
27
+ this.padding = opts.padding || '5px'
28
+ /** @type {string} */
29
+ this.border = opts.border || '0px'
30
+ /** @type {string} */
31
+ this['border-radius'] = opts['border-radius'] || '5px'
32
+ /** @type {string} */
33
+ this['box-shadow'] = opts['box-shadow'] || '5px 5px 5px grey'
34
+ /** @type {string} */
35
+ this['font-family'] = opts['font-family'] || 'Helvetica, Arial, sans-serif'
36
+
37
+ /** @type {number} */
38
+ this.transitionDuration = opts.transitionDuration || 100
39
+ /** @type {number} */
40
+ this.xOffset = opts.xOffset || 30
41
+ /** @type {number} */
42
+ this.yOffset = opts.yOffset || 20
43
+ /** @type {number} */ // e.g. to prevent mouse cursor covering cell being highlighted
44
+ this.yMouseOffset = opts.yMouseOffset || 0
45
+ /** @type {number} */
46
+ this.xMouseOffset = opts.xMouseOffset || 0
47
+ /** @type {HTMLElement} */
48
+ this.parentElement = opts.parentElement || document.body
49
+
50
+ /**
51
+ * @public
52
+ * @type {import("d3-selection").Selection} */
53
+ this.tooltip = select('#' + this.div)
54
+ if (this.tooltip.empty())
55
+ this.tooltip = select(
56
+ '#' + this.parentElement.id && this.parentElement.id != ''
57
+ ? '#' + this.parentElement.id
58
+ : 'body'
59
+ )
60
+ .append('div')
61
+ .attr('id', this.div)
62
+
63
+ //initialise
64
+ this.tooltip.style('max-width', this.maxWidth)
65
+ this.tooltip.style('overflow', 'hidden')
66
+ this.tooltip.style('font-size', this.fontSize)
67
+ this.tooltip.style('background', this.background)
68
+ this.tooltip.style('padding', this.padding)
69
+ this.tooltip.style('border', this.border)
70
+ this.tooltip.style('border-radius', this['border-radius'])
71
+ this.tooltip.style('box-shadow', this['box-shadow'])
72
+ this.tooltip.style('font-family', this['font-family'])
73
+ this.tooltip.style('position', 'absolute')
74
+ this.tooltip.style('pointer-events', 'none')
75
+ this.tooltip.style('opacity', '0')
76
+
77
+ // aria-labels (thanks to wahlatlas)
78
+ this.tooltip.attr('role', 'tooltip').attr('aria-live', 'polite')
79
+ }
80
+
81
+ /** Show the tooltip */
82
+ show() {
83
+ // @ts-ignore
84
+ this.tooltip.transition().duration(this.transitionDuration).style('opacity', 1)
85
+ }
86
+
87
+ /** Hide the tooltip */
88
+ hide() {
89
+ // @ts-ignore
90
+ this.tooltip.transition().duration(this.transitionDuration).style('opacity', 0)
91
+ }
92
+
93
+ /**
94
+ * Set the content of the tooltip.
95
+ * @param {string} html
96
+ */
97
+ html(html) {
98
+ this.tooltip.html(html)
99
+ }
100
+
101
+ /**
102
+ * Set the position of the tooltip at the mouse event position.
103
+ * @param {MouseEvent} event
104
+ */
105
+ setPosition(event) {
106
+ let parentRect = this.parentElement.getBoundingClientRect()
107
+
108
+ this.tooltip
109
+ .style('left', event.pageX - parentRect.left + this.xOffset + 'px')
110
+ .style('top', event.pageY - parentRect.top - this.yOffset + 'px')
111
+
112
+ this.ensureTooltipInsideContainer(event, parentRect)
113
+ }
114
+
115
+ /*
116
+ my.mouseover = function (event, html) {
117
+ if (html) my.html(html);
118
+ my.setPosition(event);
119
+ my.show()
120
+ //this.ensureTooltipInsideContainer();
121
+ };
122
+
123
+ my.mousemove = function (event) {
124
+ my.setPosition(event);
125
+ //this.ensureTooltipInsideContainer();
126
+ };
127
+
128
+ my.mouseout = function () {
129
+ my.hide();
130
+ };*/
131
+
132
+ style(k, v) {
133
+ if (arguments.length == 1) return this.tooltip.style(k)
134
+ this.tooltip.style(k, v)
135
+ return this
136
+ }
137
+
138
+ attr(k, v) {
139
+ if (arguments.length == 1) return this.tooltip.attr(k)
140
+ this.tooltip.attr(k, v)
141
+ return this
142
+ }
143
+
144
+ /**
145
+ * @function ensureTooltipInsideContainer
146
+ * @description Prevents the tooltip from overflowing out of the App container (ensures that the tooltip is inside the gridviz container)
147
+ * @param {MouseEvent} event
148
+ * @param {DOMRect} parentRect
149
+ */
150
+ ensureTooltipInsideContainer = function (event, parentRect) {
151
+ let ttNode = this.tooltip.node()
152
+
153
+ //too far right
154
+ let maxRight = parentRect.width
155
+ let ttRight = ttNode.offsetLeft + ttNode.clientWidth
156
+ if (ttRight > maxRight) {
157
+ let left = event.pageX - parentRect.left - ttNode.clientWidth - this.xOffset
158
+ ttNode.style.left = left + 'px'
159
+ // check if mouse covers tooltip
160
+ if (ttNode.offsetLeft + ttNode.clientWidth + parentRect.left > event.pageX) {
161
+ //move tooltip left so it doesnt cover mouse
162
+ let left2 = event.pageX - (ttNode.clientWidth + this.xOffset + parentRect.left)
163
+ ttNode.style.left = left2 + 'px'
164
+ }
165
+ }
166
+
167
+ //too far down
168
+ if (ttNode.offsetTop + ttNode.clientHeight > parentRect.height) {
169
+ ttNode.style.top = ttNode.offsetTop - ttNode.clientHeight + 'px'
170
+ }
171
+ }
172
+ }
@@ -1,24 +1,24 @@
1
- //@ts-check
2
- 'use strict'
3
-
4
- import { DatasetComponent } from '../DatasetComponent.js'
5
-
6
- /**
7
- * @todo
8
- * A dataset composed of a COGeo file.
9
- * @see https://www.cogeo.org/
10
- *
11
- * @author Joseph Davies, Julien Gaffuri
12
- */
13
- export class COGeo extends DatasetComponent {
14
- /**
15
- *
16
- * @param {String} url
17
- * @param {{preprocess?:(function(import("../Dataset").Cell):boolean)}} opts
18
- */
19
- constructor(url, opts = {}) {
20
- super(url, 0, opts)
21
- }
22
-
23
- //TODO Use https://geotiffjs.github.io/
24
- }
1
+ //@ts-check
2
+ 'use strict'
3
+
4
+ import { DatasetComponent } from '../DatasetComponent.js'
5
+
6
+ /**
7
+ * @todo
8
+ * A dataset composed of a COGeo file.
9
+ * @see https://www.cogeo.org/
10
+ *
11
+ * @author Joseph Davies, Julien Gaffuri
12
+ */
13
+ export class COGeo extends DatasetComponent {
14
+ /**
15
+ *
16
+ * @param {String} url
17
+ * @param {{preprocess?:(function(import("../Dataset").Cell):boolean)}} opts
18
+ */
19
+ constructor(url, opts = {}) {
20
+ super(url, 0, opts)
21
+ }
22
+
23
+ //TODO Use https://geotiffjs.github.io/
24
+ }