gridviz 2.0.38 → 2.0.40

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 (58) hide show
  1. package/README.md +119 -119
  2. package/dist/gridviz.js +7945 -8887
  3. package/dist/gridviz.min.js +1 -1
  4. package/package.json +77 -78
  5. package/src/App.js +698 -698
  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 +103 -103
  10. package/src/GeoCanvas.js +419 -419
  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 +168 -168
  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/ParquetGrid.js +122 -122
  22. package/src/dataset/TiledGrid.js +296 -296
  23. package/src/index.js +174 -177
  24. package/src/legend/ColorCategoryLegend.js +124 -124
  25. package/src/legend/ColorDiscreteLegend.js +105 -105
  26. package/src/legend/ColorLegend.js +125 -125
  27. package/src/legend/SegmentOrientationLegend.js +87 -87
  28. package/src/legend/SegmentWidthLegend.js +97 -97
  29. package/src/legend/SizeLegend.js +141 -141
  30. package/src/style/CompositionStyle.js +300 -300
  31. package/src/style/ContourStyle.js +54 -54
  32. package/src/style/DotDensityStyle.js +156 -156
  33. package/src/style/JoyPlotStyle.js +135 -135
  34. package/src/style/LegoStyle.js +112 -112
  35. package/src/style/MosaicStyle.js +107 -107
  36. package/src/style/NinjaStarStyle.js +124 -124
  37. package/src/style/PillarStyle.js +230 -230
  38. package/src/style/SegmentStyle.js +142 -142
  39. package/src/style/ShapeColorSizeStyle.js +126 -126
  40. package/src/style/SideCatStyle.js +172 -172
  41. package/src/style/SideStyle.js +218 -218
  42. package/src/style/SquareColorCatWGLStyle.js +120 -120
  43. package/src/style/SquareColorWGLStyle.js +146 -146
  44. package/src/style/StrokeStyle.js +131 -131
  45. package/src/style/TanakaStyle.js +160 -160
  46. package/src/style/TextStyle.js +132 -132
  47. package/src/utils/Utils.js +35 -35
  48. package/src/utils/WebGLRectangleColoring.js +106 -106
  49. package/src/utils/WebGLSquareColoring.js +118 -118
  50. package/src/utils/WebGLSquareColoringAdvanced.js +230 -230
  51. package/src/utils/WebGLSquareColoringCatAdvanced.js +133 -133
  52. package/src/utils/WebGLSquareColoringKS.js +153 -153
  53. package/src/utils/stretching.js +131 -131
  54. package/src/utils/webGLUtils.js +71 -71
  55. package/src/utils/zoomUtils.js +142 -142
  56. package/src/style/KernelSmoothingOldStyle.js +0 -221
  57. package/src/style/KernelSmoothingStyle.js +0 -115
  58. package/src/style/KernelSmoothingWGLStyle.js +0 -130
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,168 +1,168 @@
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
- * @private
52
- * @type {import("d3-selection").Selection} */
53
- this.tooltip = select('#' + this.div)
54
- if (this.tooltip.empty())
55
- this.tooltip = select('#' + this.parentElement.id)
56
- .append('div')
57
- .attr('id', this.div)
58
-
59
- //initialise
60
- this.tooltip.style('max-width', this.maxWidth)
61
- this.tooltip.style('overflow', 'hidden')
62
- this.tooltip.style('font-size', this.fontSize)
63
- this.tooltip.style('background', this.background)
64
- this.tooltip.style('padding', this.padding)
65
- this.tooltip.style('border', this.border)
66
- this.tooltip.style('border-radius', this['border-radius'])
67
- this.tooltip.style('box-shadow', this['box-shadow'])
68
- this.tooltip.style('font-family', this['font-family'])
69
- this.tooltip.style('position', 'absolute')
70
- this.tooltip.style('pointer-events', 'none')
71
- this.tooltip.style('opacity', '0')
72
-
73
- // aria-labels (thanks to wahlatlas)
74
- this.tooltip.attr('role', 'tooltip').attr('aria-live', 'polite')
75
- }
76
-
77
- /** Show the tooltip */
78
- show() {
79
- // @ts-ignore
80
- this.tooltip.transition().duration(this.transitionDuration).style('opacity', 1)
81
- }
82
-
83
- /** Hide the tooltip */
84
- hide() {
85
- // @ts-ignore
86
- this.tooltip.transition().duration(this.transitionDuration).style('opacity', 0)
87
- }
88
-
89
- /**
90
- * Set the content of the tooltip.
91
- * @param {string} html
92
- */
93
- html(html) {
94
- this.tooltip.html(html)
95
- }
96
-
97
- /**
98
- * Set the position of the tooltip at the mouse event position.
99
- * @param {MouseEvent} event
100
- */
101
- setPosition(event) {
102
- let parentRect = this.parentElement.getBoundingClientRect()
103
-
104
- this.tooltip
105
- .style('left', event.pageX - parentRect.left + this.xOffset + 'px')
106
- .style('top', event.pageY - parentRect.top - this.yOffset + 'px')
107
-
108
- this.ensureTooltipInsideContainer(event, parentRect)
109
- }
110
-
111
- /*
112
- my.mouseover = function (event, html) {
113
- if (html) my.html(html);
114
- my.setPosition(event);
115
- my.show()
116
- //this.ensureTooltipInsideContainer();
117
- };
118
-
119
- my.mousemove = function (event) {
120
- my.setPosition(event);
121
- //this.ensureTooltipInsideContainer();
122
- };
123
-
124
- my.mouseout = function () {
125
- my.hide();
126
- };*/
127
-
128
- style(k, v) {
129
- if (arguments.length == 1) return this.tooltip.style(k)
130
- this.tooltip.style(k, v)
131
- return this
132
- }
133
-
134
- attr(k, v) {
135
- if (arguments.length == 1) return this.tooltip.attr(k)
136
- this.tooltip.attr(k, v)
137
- return this
138
- }
139
-
140
- /**
141
- * @function ensureTooltipInsideContainer
142
- * @description Prevents the tooltip from overflowing out of the App container (ensures that the tooltip is inside the gridviz container)
143
- * @param {MouseEvent} event
144
- * @param {DOMRect} parentRect
145
- */
146
- ensureTooltipInsideContainer = function (event, parentRect) {
147
- let ttNode = this.tooltip.node()
148
-
149
- //too far right
150
- let maxRight = parentRect.width
151
- let ttRight = ttNode.offsetLeft + ttNode.clientWidth
152
- if (ttRight > maxRight) {
153
- let left = event.pageX - parentRect.left - ttNode.clientWidth - this.xOffset
154
- ttNode.style.left = left + 'px'
155
- // check if mouse covers tooltip
156
- if (ttNode.offsetLeft + ttNode.clientWidth + parentRect.left > event.pageX) {
157
- //move tooltip left so it doesnt cover mouse
158
- let left2 = event.pageX - (ttNode.clientWidth + this.xOffset + parentRect.left)
159
- ttNode.style.left = left2 + 'px'
160
- }
161
- }
162
-
163
- //too far down
164
- if (ttNode.offsetTop + ttNode.clientHeight > parentRect.height) {
165
- ttNode.style.top = ttNode.offsetTop - ttNode.clientHeight + 'px'
166
- }
167
- }
168
- }
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
+ * @private
52
+ * @type {import("d3-selection").Selection} */
53
+ this.tooltip = select('#' + this.div)
54
+ if (this.tooltip.empty())
55
+ this.tooltip = select('#' + this.parentElement.id)
56
+ .append('div')
57
+ .attr('id', this.div)
58
+
59
+ //initialise
60
+ this.tooltip.style('max-width', this.maxWidth)
61
+ this.tooltip.style('overflow', 'hidden')
62
+ this.tooltip.style('font-size', this.fontSize)
63
+ this.tooltip.style('background', this.background)
64
+ this.tooltip.style('padding', this.padding)
65
+ this.tooltip.style('border', this.border)
66
+ this.tooltip.style('border-radius', this['border-radius'])
67
+ this.tooltip.style('box-shadow', this['box-shadow'])
68
+ this.tooltip.style('font-family', this['font-family'])
69
+ this.tooltip.style('position', 'absolute')
70
+ this.tooltip.style('pointer-events', 'none')
71
+ this.tooltip.style('opacity', '0')
72
+
73
+ // aria-labels (thanks to wahlatlas)
74
+ this.tooltip.attr('role', 'tooltip').attr('aria-live', 'polite')
75
+ }
76
+
77
+ /** Show the tooltip */
78
+ show() {
79
+ // @ts-ignore
80
+ this.tooltip.transition().duration(this.transitionDuration).style('opacity', 1)
81
+ }
82
+
83
+ /** Hide the tooltip */
84
+ hide() {
85
+ // @ts-ignore
86
+ this.tooltip.transition().duration(this.transitionDuration).style('opacity', 0)
87
+ }
88
+
89
+ /**
90
+ * Set the content of the tooltip.
91
+ * @param {string} html
92
+ */
93
+ html(html) {
94
+ this.tooltip.html(html)
95
+ }
96
+
97
+ /**
98
+ * Set the position of the tooltip at the mouse event position.
99
+ * @param {MouseEvent} event
100
+ */
101
+ setPosition(event) {
102
+ let parentRect = this.parentElement.getBoundingClientRect()
103
+
104
+ this.tooltip
105
+ .style('left', event.pageX - parentRect.left + this.xOffset + 'px')
106
+ .style('top', event.pageY - parentRect.top - this.yOffset + 'px')
107
+
108
+ this.ensureTooltipInsideContainer(event, parentRect)
109
+ }
110
+
111
+ /*
112
+ my.mouseover = function (event, html) {
113
+ if (html) my.html(html);
114
+ my.setPosition(event);
115
+ my.show()
116
+ //this.ensureTooltipInsideContainer();
117
+ };
118
+
119
+ my.mousemove = function (event) {
120
+ my.setPosition(event);
121
+ //this.ensureTooltipInsideContainer();
122
+ };
123
+
124
+ my.mouseout = function () {
125
+ my.hide();
126
+ };*/
127
+
128
+ style(k, v) {
129
+ if (arguments.length == 1) return this.tooltip.style(k)
130
+ this.tooltip.style(k, v)
131
+ return this
132
+ }
133
+
134
+ attr(k, v) {
135
+ if (arguments.length == 1) return this.tooltip.attr(k)
136
+ this.tooltip.attr(k, v)
137
+ return this
138
+ }
139
+
140
+ /**
141
+ * @function ensureTooltipInsideContainer
142
+ * @description Prevents the tooltip from overflowing out of the App container (ensures that the tooltip is inside the gridviz container)
143
+ * @param {MouseEvent} event
144
+ * @param {DOMRect} parentRect
145
+ */
146
+ ensureTooltipInsideContainer = function (event, parentRect) {
147
+ let ttNode = this.tooltip.node()
148
+
149
+ //too far right
150
+ let maxRight = parentRect.width
151
+ let ttRight = ttNode.offsetLeft + ttNode.clientWidth
152
+ if (ttRight > maxRight) {
153
+ let left = event.pageX - parentRect.left - ttNode.clientWidth - this.xOffset
154
+ ttNode.style.left = left + 'px'
155
+ // check if mouse covers tooltip
156
+ if (ttNode.offsetLeft + ttNode.clientWidth + parentRect.left > event.pageX) {
157
+ //move tooltip left so it doesnt cover mouse
158
+ let left2 = event.pageX - (ttNode.clientWidth + this.xOffset + parentRect.left)
159
+ ttNode.style.left = left2 + 'px'
160
+ }
161
+ }
162
+
163
+ //too far down
164
+ if (ttNode.offsetTop + ttNode.clientHeight > parentRect.height) {
165
+ ttNode.style.top = ttNode.offsetTop - ttNode.clientHeight + 'px'
166
+ }
167
+ }
168
+ }
@@ -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
+ }