gridviz 3.0.25 → 3.0.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gridviz",
3
- "version": "3.0.25",
3
+ "version": "3.0.26",
4
4
  "description": "Visualization tool for gridded statistics",
5
5
  "keywords": [
6
6
  "statistics",
@@ -71,4 +71,4 @@
71
71
  "engines": {
72
72
  "node": ">=14"
73
73
  }
74
- }
74
+ }
@@ -30,6 +30,7 @@ export class GeoCanvas {
30
30
 
31
31
  /** @type {HTMLCanvasElement} */
32
32
  this.canvas = canvas
33
+ this.canvas.style.cursor = 'grab' // default shown when hover
33
34
 
34
35
  /** @type {number} */
35
36
  this.w = this.canvas.offsetWidth
@@ -102,6 +103,8 @@ export class GeoCanvas {
102
103
  })
103
104
  .on('start', (e) => {
104
105
  // start of zoom event
106
+ // show grabbing during pan/zoom
107
+ try { this.canvas.style.cursor = 'grabbing' } catch (err) { }
105
108
  this._isZooming = true;
106
109
  // save the current canvas state to keep onscreen during pan/zoom before redrawing
107
110
  this.canvasSave.c = document.createElement('canvas')
@@ -115,11 +118,13 @@ export class GeoCanvas {
115
118
  })
116
119
  .on('end', (e) => {
117
120
  // end of pan/zoom event
121
+ // restore cursor
122
+ try { this.canvas.style.cursor = 'grab' } catch (err) { }
118
123
  this._isZooming = false;
119
124
  this.redraw()
120
125
  this.canvasSave = { c: null, dx: 0, dy: 0, f: 1 }
121
126
  if (this.onZoomEndFun) this.onZoomEndFun(e)
122
-
127
+
123
128
  })
124
129
  // @ts-ignore
125
130
  z(select(this.canvas))