gridviz 3.0.9 → 3.0.10

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.9",
3
+ "version": "3.0.10",
4
4
  "description": "Visualization tool for gridded statistics",
5
5
  "keywords": [
6
6
  "statistics",
@@ -23,7 +23,7 @@
23
23
  "license": "EUPL-1.2",
24
24
  "repository": {
25
25
  "type": "git",
26
- "url": "https://github.com/eurostat/gridviz.git"
26
+ "url": "git+https://github.com/eurostat/gridviz.git"
27
27
  },
28
28
  "bugs": {
29
29
  "url": "https://github.com/eurostat/gridviz/issues",
@@ -40,7 +40,7 @@
40
40
  "start": "export NODE_OPTIONS=--openssl-legacy-provider && webpack --config webpack.config.dev.cjs",
41
41
  "start-dev": "webpack --config webpack.config.dev.cjs",
42
42
  "server": "webpack serve -c webpack.config.dev.cjs",
43
- "doc": "./node_modules/.bin/jsdoc -c docs/jsdoc/jsdoc.conf.json",
43
+ "doc": "jsdoc -c docs/jsdoc/jsdoc.conf.json",
44
44
  "bp": "webpack --config webpack.config.prod.cjs",
45
45
  "test": "jest"
46
46
  },
@@ -59,16 +59,11 @@
59
59
  "jsdoc": "^4.0.2"
60
60
  },
61
61
  "devDependencies": {
62
- "@babel/core": "^7.9.0",
63
- "@babel/plugin-transform-runtime": "^7.12.1",
64
- "@babel/preset-env": "^7.9.0",
65
- "@babel/runtime": "^7.12.1",
62
+ "@babel/preset-env": "^7.25.4",
66
63
  "babel-loader": "^8.1.0",
67
- "jest": "^26.6.1",
68
64
  "jshint": "^2.12.0",
69
65
  "prettier": "2.8.8",
70
- "puppeteer": "^9.1.1",
71
- "webpack": "^5.89.0",
66
+ "webpack": "^5.94.0",
72
67
  "webpack-cli": "^5.1.4",
73
68
  "webpack-dev-server": "^4.15.1",
74
69
  "webpack-livereload-plugin": "^3.0.2"
@@ -18,16 +18,15 @@ export class Button {
18
18
  * opts.y
19
19
  */
20
20
  constructor(opts = {}) {
21
-
22
21
  this.map = opts.map
23
22
  this.parentNode = opts.parentNode || opts.map.container
24
23
 
25
24
  // the div element
26
- if (this.id) this.div = select('#' + this.id)
25
+ if (opts.id) this.div = select('#' + opts.id)
27
26
 
28
27
  if (!this.div || this.div.empty()) {
29
28
  this.div = select(document.createElement('div'))
30
- if (this.id) this.div.attr('id', this.id)
29
+ if (opts.id) this.div.attr('id', opts.id)
31
30
  }
32
31
 
33
32
  if (opts.title) this.div.attr('title', opts.title)
@@ -37,7 +36,10 @@ export class Button {
37
36
  if (opts.onClickFunction) this.div.on('click', opts.onClickFunction)
38
37
 
39
38
  //set styles
40
- this.style('box-shadow', '0 7px 8px rgba(0,47,103,.08), 0 0 22px rgba(0,47,103,.04), 0 12px 17px rgba(0,47,103,.04), 0 -4px 4px rgba(0,47,103,.04)') //.ecl-u-shadow-3
39
+ this.style(
40
+ 'box-shadow',
41
+ '0 7px 8px rgba(0,47,103,.08), 0 0 22px rgba(0,47,103,.04), 0 12px 17px rgba(0,47,103,.04), 0 -4px 4px rgba(0,47,103,.04)'
42
+ ) //.ecl-u-shadow-3
41
43
  this.style('background-color', '#ffffff')
42
44
  this.style('position', 'absolute')
43
45
  this.style('cursor', 'pointer')
@@ -48,7 +50,6 @@ export class Button {
48
50
  this.style('height', '30px')
49
51
  // this.style(padding , '4px'
50
52
 
51
-
52
53
  // append to parent
53
54
  this.parentNode.appendChild(this.div.node())
54
55
  }
@@ -82,6 +82,7 @@ export class ColorDiscreteLegend extends Legend {
82
82
 
83
83
  let label = breaks[i - 1]
84
84
  if (isNaN(label) || label == undefined) continue
85
+ if(this.labelFormat) label = this.labelFormat(label)
85
86
 
86
87
  //label
87
88
  svg.append('text')
@@ -51,6 +51,7 @@ export class SideCategoryStyle extends SideStyle {
51
51
  //draw sides
52
52
 
53
53
  geoCanvas.ctx.lineCap = 'butt'
54
+ const r2 = resolution*0.5
54
55
  for (let side of sides) {
55
56
 
56
57
  //get category codes for both cells
@@ -73,8 +74,8 @@ export class SideCategoryStyle extends SideStyle {
73
74
  if (code2) {
74
75
  geoCanvas.ctx.beginPath()
75
76
  geoCanvas.ctx.strokeStyle = this.color[code2]
76
- geoCanvas.ctx.moveTo(side.x, side.y + w2)
77
- geoCanvas.ctx.lineTo(side.x + resolution, side.y + w2)
77
+ geoCanvas.ctx.moveTo(side.x-r2, side.y + w2)
78
+ geoCanvas.ctx.lineTo(side.x+r2, side.y + w2)
78
79
  geoCanvas.ctx.stroke()
79
80
  }
80
81
 
@@ -82,8 +83,8 @@ export class SideCategoryStyle extends SideStyle {
82
83
  if (code1) {
83
84
  geoCanvas.ctx.beginPath()
84
85
  geoCanvas.ctx.strokeStyle = this.color[code1]
85
- geoCanvas.ctx.moveTo(side.x, side.y - w2)
86
- geoCanvas.ctx.lineTo(side.x + resolution, side.y - w2)
86
+ geoCanvas.ctx.moveTo(side.x-r2, side.y - w2)
87
+ geoCanvas.ctx.lineTo(side.x+r2, side.y - w2)
87
88
  geoCanvas.ctx.stroke()
88
89
  }
89
90
  } else {
@@ -91,8 +92,8 @@ export class SideCategoryStyle extends SideStyle {
91
92
  if (code2) {
92
93
  geoCanvas.ctx.beginPath()
93
94
  geoCanvas.ctx.strokeStyle = this.color[code2]
94
- geoCanvas.ctx.moveTo(side.x + w2, side.y)
95
- geoCanvas.ctx.lineTo(side.x + w2, side.y + resolution)
95
+ geoCanvas.ctx.moveTo(side.x + w2, side.y-r2)
96
+ geoCanvas.ctx.lineTo(side.x + w2, side.y+r2)
96
97
  geoCanvas.ctx.stroke()
97
98
  }
98
99
 
@@ -100,8 +101,8 @@ export class SideCategoryStyle extends SideStyle {
100
101
  if (code1) {
101
102
  geoCanvas.ctx.beginPath()
102
103
  geoCanvas.ctx.strokeStyle = this.color[code1]
103
- geoCanvas.ctx.moveTo(side.x - w2, side.y)
104
- geoCanvas.ctx.lineTo(side.x - w2, side.y + resolution)
104
+ geoCanvas.ctx.moveTo(side.x - w2, side.y-r2)
105
+ geoCanvas.ctx.lineTo(side.x - w2, side.y+r2)
105
106
  geoCanvas.ctx.stroke()
106
107
  }
107
108
  }