gridviz 3.0.15 → 3.0.17

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 (55) hide show
  1. package/README.md +127 -128
  2. package/dist/gridviz.js +7958 -7861
  3. package/dist/gridviz.min.js +1 -1
  4. package/package.json +74 -74
  5. package/src/button/ZoomButtons.js +101 -96
  6. package/src/core/Dataset.js +154 -157
  7. package/src/core/Drawable.js +60 -61
  8. package/src/core/GeoCanvas.js +409 -370
  9. package/src/core/Layer.js +23 -25
  10. package/src/core/Legend.js +108 -110
  11. package/src/core/Map.js +494 -495
  12. package/src/core/MultiResolutionDataset.js +93 -97
  13. package/src/core/Style.js +98 -99
  14. package/src/dataset/CSVGrid.js +112 -112
  15. package/src/dataset/GeoTIFF.js +122 -123
  16. package/src/dataset/JSGrid.js +55 -54
  17. package/src/dataset/TiledGrid.js +289 -288
  18. package/src/dataset/worker.js +18 -0
  19. package/src/index.js +77 -71
  20. package/src/layer/BackgroundLayer.js +162 -158
  21. package/src/layer/BackgroundLayerImage.js +81 -84
  22. package/src/layer/BackgroundLayerWMS.js +104 -108
  23. package/src/layer/GeoJSONLayer.js +214 -220
  24. package/src/layer/GridLayer.js +148 -157
  25. package/src/layer/LabelLayer.js +194 -193
  26. package/src/legend/ColorCategoryLegend.js +109 -110
  27. package/src/legend/ColorDiscreteLegend.js +100 -102
  28. package/src/legend/ColorLegend.js +115 -118
  29. package/src/legend/OrientationLegend.js +89 -91
  30. package/src/legend/SizeLegend.js +224 -224
  31. package/src/legend/TernaryLegend.js +302 -210
  32. package/src/style/CompositionStyle.js +291 -288
  33. package/src/style/DotDensityStyle.js +133 -134
  34. package/src/style/ImageStyle.js +100 -102
  35. package/src/style/IsoFenceStyle.js +217 -203
  36. package/src/style/JoyPlotStyle.js +127 -128
  37. package/src/style/LegoStyle.js +110 -110
  38. package/src/style/MosaicStyle.js +99 -99
  39. package/src/style/NinjaStarStyle.js +102 -102
  40. package/src/style/PillarStyle.js +207 -208
  41. package/src/style/SegmentStyle.js +105 -105
  42. package/src/style/ShapeColorSizeStyle.js +147 -132
  43. package/src/style/SideCategoryStyle.js +112 -114
  44. package/src/style/SideStyle.js +212 -205
  45. package/src/style/SquareColorCategoryWebGLStyle.js +107 -108
  46. package/src/style/SquareColorWebGLStyle.js +126 -126
  47. package/src/style/StrokeStyle.js +135 -136
  48. package/src/style/TanakaStyle.js +69 -68
  49. package/src/style/TextStyle.js +110 -111
  50. package/src/style/TimeSeriesStyle.js +222 -229
  51. package/src/utils/scale.js +218 -228
  52. package/src/utils/stretching.js +120 -133
  53. package/src/utils/ternary.js +203 -204
  54. package/src/utils/utils.js +58 -63
  55. package/src/utils/webGLUtils.js +72 -70
@@ -1,102 +1,100 @@
1
- //@ts-check
2
- 'use strict'
3
-
4
- import { Legend } from '../core/Legend.js'
5
-
6
- /**
7
- * A legend element for discrete color style.
8
- * Inspiration: https://observablehq.com/@d3/color-legend
9
- *
10
- * @module legend
11
- * @author Julien Gaffuri
12
- */
13
- export class ColorDiscreteLegend extends Legend {
14
- /** @param {Object} opts */
15
- constructor(opts) {
16
- super(opts)
17
- opts = opts || {}
18
-
19
- /** @private @type {function(import('../core/Style').ViewScale):Array.<string>} */
20
- this.colors = opts.colors
21
- /** @private @type {function(import('../core/Style').ViewScale):Array.<number>} */
22
- this.breaks = opts.breaks
23
-
24
- this.width = opts.width || 300
25
- this.height = opts.height || 15
26
-
27
- this.tickSize = opts.tickSize || 3
28
-
29
- //label
30
- this.invert = opts.invert
31
- }
32
-
33
- /**
34
- * @param {{viewScale:import('../core/Style').ViewScale} } opts
35
- */
36
- update(opts) {
37
-
38
- //clear
39
- this.div.selectAll('*').remove()
40
-
41
- //title
42
- this.makeTitle()
43
-
44
- //get colors and breaks
45
- const colors = this.colors(opts.viewScale)
46
- const breaks = this.breaks(opts.viewScale)
47
- if (!breaks) return
48
-
49
- //classes
50
- const nb = colors.length
51
- if (nb == 0) return
52
- const w = this.width / nb
53
-
54
- //make svg element
55
- const svg = this.div
56
- .append('svg')
57
- .attr('width', this.width)
58
- .attr('height', this.height + this.tickSize + 2 + 10)
59
-
60
- //draw graphic elements
61
- for (let i = 0; i < nb; i++) {
62
- svg.append('rect')
63
- .attr('x', i * w)
64
- .attr('y', 0)
65
- .attr('width', w)
66
- .attr('height', this.height)
67
- .style('fill', colors[i])
68
- }
69
-
70
- //tick line
71
- for (let i = 1; i < nb; i++) {
72
- svg.append('line')
73
- .attr('x1', w * i)
74
- .attr('y1', 0)
75
- .attr('x2', w * i)
76
- .attr('y2', this.height + this.tickSize)
77
- .style('stroke', 'black')
78
- }
79
-
80
- //labels
81
- for (let i = 1; i < nb; i++) {
82
-
83
- let label = breaks[i - 1]
84
- if (isNaN(label) || label == undefined) continue
85
- if(this.labelFormat) label = this.labelFormat(label)
86
-
87
- //label
88
- svg.append('text')
89
- .attr('id', 'ticklabel_' + i)
90
- .attr('x', w * i)
91
- .attr('y', this.height + this.tickSize + 2)
92
- .style('font-size', this.labelFontSize)
93
- //.style("font-weight", "bold")
94
- //.style("font-family", "Arial")
95
- .style('text-anchor', 'middle')
96
- .style('alignment-baseline', 'top')
97
- .style('dominant-baseline', 'hanging')
98
- .style('pointer-events', 'none')
99
- .text(label)
100
- }
101
- }
102
- }
1
+ //@ts-check
2
+ 'use strict'
3
+
4
+ import { Legend } from '../core/Legend.js'
5
+
6
+ /**
7
+ * A legend element for discrete color style.
8
+ * Inspiration: https://observablehq.com/@d3/color-legend
9
+ *
10
+ * @module legend
11
+ * @author Julien Gaffuri
12
+ */
13
+ export class ColorDiscreteLegend extends Legend {
14
+ /** @param {Object} opts */
15
+ constructor(opts) {
16
+ super(opts)
17
+ opts = opts || {}
18
+
19
+ /** @private @type {function(import('../core/Style').ViewScale):Array.<string>} */
20
+ this.colors = opts.colors
21
+ /** @private @type {function(import('../core/Style').ViewScale):Array.<number>} */
22
+ this.breaks = opts.breaks
23
+
24
+ this.width = opts.width || 300
25
+ this.height = opts.height || 15
26
+
27
+ this.tickSize = opts.tickSize || 3
28
+
29
+ //label
30
+ this.invert = opts.invert
31
+ }
32
+
33
+ /**
34
+ * @param {{viewScale:import('../core/Style').ViewScale} } opts
35
+ */
36
+ update(opts) {
37
+ //clear
38
+ this.div.selectAll('*').remove()
39
+
40
+ //title
41
+ this.makeTitle()
42
+
43
+ //get colors and breaks
44
+ const colors = this.colors(opts.viewScale)
45
+ const breaks = this.breaks(opts.viewScale)
46
+ if (!breaks) return
47
+
48
+ //classes
49
+ const nb = colors.length
50
+ if (nb == 0) return
51
+ const w = this.width / nb
52
+
53
+ //make svg element
54
+ const svg = this.div
55
+ .append('svg')
56
+ .attr('width', this.width)
57
+ .attr('height', this.height + this.tickSize + 2 + 10)
58
+
59
+ //draw graphic elements
60
+ for (let i = 0; i < nb; i++) {
61
+ svg.append('rect')
62
+ .attr('x', i * w)
63
+ .attr('y', 0)
64
+ .attr('width', w)
65
+ .attr('height', this.height)
66
+ .style('fill', colors[i])
67
+ }
68
+
69
+ //tick line
70
+ for (let i = 1; i < nb; i++) {
71
+ svg.append('line')
72
+ .attr('x1', w * i)
73
+ .attr('y1', 0)
74
+ .attr('x2', w * i)
75
+ .attr('y2', this.height + this.tickSize)
76
+ .style('stroke', 'black')
77
+ }
78
+
79
+ //labels
80
+ for (let i = 1; i < nb; i++) {
81
+ let label = breaks[i - 1]
82
+ if (isNaN(label) || label == undefined) continue
83
+ if (this.labelFormat) label = this.labelFormat(label)
84
+
85
+ //label
86
+ svg.append('text')
87
+ .attr('id', 'ticklabel_' + i)
88
+ .attr('x', w * i)
89
+ .attr('y', this.height + this.tickSize + 2)
90
+ .style('font-size', this.labelFontSize)
91
+ //.style("font-weight", "bold")
92
+ //.style("font-family", "Arial")
93
+ .style('text-anchor', 'middle')
94
+ .style('alignment-baseline', 'top')
95
+ .style('dominant-baseline', 'hanging')
96
+ .style('pointer-events', 'none')
97
+ .text(label)
98
+ }
99
+ }
100
+ }
@@ -1,118 +1,115 @@
1
- //@ts-check
2
- 'use strict'
3
-
4
- import { Legend } from '../core/Legend.js'
5
-
6
- /**
7
- * A legend element for continuous color style.
8
- * Inspiration: https://observablehq.com/@d3/color-legend
9
- *
10
- * @module legend
11
- * @author Joseph Davies, Julien Gaffuri
12
- */
13
- export class ColorLegend extends Legend {
14
- /** @param {Object} opts */
15
- constructor(opts) {
16
- super(opts)
17
- opts = opts || {}
18
-
19
- //a function [0,1]->color for continuous colors.
20
- //it can take as second argument the viewscale.
21
- this.colorScale = opts.colorScale
22
-
23
- //function (t[0,1]) -> value (for label text)
24
- //it can take as second argument the viewscale.
25
- this.textScale = opts.textScale || (t => t)
26
-
27
- this.margin = opts.margin || 5
28
-
29
- //replace with labels ?
30
- this.tickSize = opts.tickSize || 6
31
- this.ticks = opts.ticks || Math.floor(this.width / 50)
32
- this.tickFormat = opts.tickFormat
33
- this.tickUnit = opts.tickUnit
34
-
35
- this.fontSize = opts.fontSize || '0.8em'
36
- this.invert = opts.invert
37
-
38
- this.width = opts.width || 300
39
- this.height = opts.height || 15
40
- }
41
-
42
- /**
43
- * @param {{viewScale:import('../core/Style').ViewScale} } opts
44
- */
45
- update(opts) {
46
-
47
- //clear
48
- this.div.selectAll('*').remove()
49
-
50
- //title
51
- this.makeTitle()
52
-
53
- const svgW = this.width + 2 * this.margin
54
- const svgH = this.height + this.margin + this.tickSize + 10
55
- const svg = this.div.append('svg').attr('width', svgW).attr('height', svgH)
56
- // <rect width="300" height="100" style="fill:rgb(0,0,255);stroke-width:3;stroke:rgb(0,0,0)" />
57
-
58
- const g = svg
59
- .append('g')
60
- .attr('transform', 'translate(' + this.margin + ' ' + 0 + ')')
61
-
62
- //draw color bar
63
- const w = this.width,
64
- h = this.height
65
- const step = 5
66
- for (let i = 0; i < w; i += step) {
67
- let t = i / (w - 1)
68
- if (this.invert) t = 1 - t
69
- g.append('rect')
70
- .attr('x', i)
71
- .attr('y', 0)
72
- .attr('width', step)
73
- .attr('height', h)
74
- .style('fill', this.colorScale(t, opts.viewScale))
75
- }
76
-
77
- for (let i = 0; i < this.ticks; i++) {
78
- let t = i / (this.ticks - 1)
79
-
80
- //tick line
81
- g.append('line')
82
- .attr('x1', w * t)
83
- .attr('y1', 0)
84
- .attr('x2', w * t)
85
- .attr('y2', h + this.tickSize)
86
- .style('stroke', 'black')
87
-
88
- //prepare tick label
89
- g.append('text')
90
- .attr('id', 'ticklabel_' + i)
91
- .attr('x', w * t)
92
- .attr('y', h + this.tickSize + 2)
93
- .style('font-size', this.fontSize)
94
- //.style("font-weight", "bold")
95
- //.style("font-family", "Arial")
96
- .style('text-anchor', i == 0 ? 'start' : i == this.ticks - 1 ? 'end' : 'middle')
97
- .style('alignment-baseline', 'top')
98
- .style('dominant-baseline', 'hanging')
99
- .style('pointer-events', 'none')
100
- //.text("-")
101
- }
102
-
103
- //update tick labels
104
-
105
- //label text format
106
- const f = this.tickFormat && this.tickFormat != 'text' ? this.tickFormat : (v) => v
107
- for (let i = 0; i < this.ticks; i++) {
108
- let t = i / (this.ticks - 1)
109
-
110
- const v = this.textScale(t, opts.viewScale)
111
- const text = (v ? f(v) : '0') + (this.tickUnit ? this.tickUnit : '')
112
- if (text == undefined) continue
113
-
114
- //tick label
115
- this.div.select('#' + 'ticklabel_' + i).text(text)
116
- }
117
- }
118
- }
1
+ //@ts-check
2
+ 'use strict'
3
+
4
+ import { Legend } from '../core/Legend.js'
5
+
6
+ /**
7
+ * A legend element for continuous color style.
8
+ * Inspiration: https://observablehq.com/@d3/color-legend
9
+ *
10
+ * @module legend
11
+ * @author Joseph Davies, Julien Gaffuri
12
+ */
13
+ export class ColorLegend extends Legend {
14
+ /** @param {Object} opts */
15
+ constructor(opts) {
16
+ super(opts)
17
+ opts = opts || {}
18
+
19
+ //a function [0,1]->color for continuous colors.
20
+ //it can take as second argument the viewscale.
21
+ this.colorScale = opts.colorScale
22
+
23
+ //function (t[0,1]) -> value (for label text)
24
+ //it can take as second argument the viewscale.
25
+ this.textScale = opts.textScale || ((t) => t)
26
+
27
+ this.margin = opts.margin || 5
28
+
29
+ //replace with labels ?
30
+ this.tickSize = opts.tickSize || 6
31
+ this.ticks = opts.ticks || Math.floor(this.width / 50)
32
+ this.tickFormat = opts.tickFormat
33
+ this.tickUnit = opts.tickUnit
34
+
35
+ this.fontSize = opts.fontSize || '0.8em'
36
+ this.invert = opts.invert
37
+
38
+ this.width = opts.width || 300
39
+ this.height = opts.height || 15
40
+ }
41
+
42
+ /**
43
+ * @param {{viewScale:import('../core/Style').ViewScale} } opts
44
+ */
45
+ update(opts) {
46
+ //clear
47
+ this.div.selectAll('*').remove()
48
+
49
+ //title
50
+ this.makeTitle()
51
+
52
+ const svgW = this.width + 2 * this.margin
53
+ const svgH = this.height + this.margin + this.tickSize + 10
54
+ const svg = this.div.append('svg').attr('width', svgW).attr('height', svgH)
55
+ // <rect width="300" height="100" style="fill:rgb(0,0,255);stroke-width:3;stroke:rgb(0,0,0)" />
56
+
57
+ const g = svg.append('g').attr('transform', 'translate(' + this.margin + ' ' + 0 + ')')
58
+
59
+ //draw color bar
60
+ const w = this.width,
61
+ h = this.height
62
+ const step = 5
63
+ for (let i = 0; i < w; i += step) {
64
+ let t = i / (w - 1)
65
+ if (this.invert) t = 1 - t
66
+ g.append('rect')
67
+ .attr('x', i)
68
+ .attr('y', 0)
69
+ .attr('width', step)
70
+ .attr('height', h)
71
+ .style('fill', this.colorScale(t, opts.viewScale))
72
+ }
73
+
74
+ for (let i = 0; i < this.ticks; i++) {
75
+ let t = i / (this.ticks - 1)
76
+
77
+ //tick line
78
+ g.append('line')
79
+ .attr('x1', w * t)
80
+ .attr('y1', 0)
81
+ .attr('x2', w * t)
82
+ .attr('y2', h + this.tickSize)
83
+ .style('stroke', 'black')
84
+
85
+ //prepare tick label
86
+ g.append('text')
87
+ .attr('id', 'ticklabel_' + i)
88
+ .attr('x', w * t)
89
+ .attr('y', h + this.tickSize + 2)
90
+ .style('font-size', this.fontSize)
91
+ //.style("font-weight", "bold")
92
+ //.style("font-family", "Arial")
93
+ .style('text-anchor', i == 0 ? 'start' : i == this.ticks - 1 ? 'end' : 'middle')
94
+ .style('alignment-baseline', 'top')
95
+ .style('dominant-baseline', 'hanging')
96
+ .style('pointer-events', 'none')
97
+ //.text("-")
98
+ }
99
+
100
+ //update tick labels
101
+
102
+ //label text format
103
+ const f = this.tickFormat && this.tickFormat != 'text' ? this.tickFormat : (v) => v
104
+ for (let i = 0; i < this.ticks; i++) {
105
+ let t = i / (this.ticks - 1)
106
+
107
+ const v = this.textScale(t, opts.viewScale)
108
+ const text = (v ? f(v) : '0') + (this.tickUnit ? this.tickUnit : '')
109
+ if (text == undefined) continue
110
+
111
+ //tick label
112
+ this.div.select('#' + 'ticklabel_' + i).text(text)
113
+ }
114
+ }
115
+ }
@@ -1,91 +1,89 @@
1
- //@ts-check
2
- 'use strict'
3
-
4
- import { Legend } from '../core/Legend.js'
5
-
6
- /**
7
- * A legend element for segment orientation.
8
- *
9
- * @module legend
10
- * @author Joseph Davies, Julien Gaffuri
11
- */
12
- export class OrientationLegend extends Legend {
13
- /** @param {Object} opts */
14
- constructor(opts) {
15
- super(opts)
16
- opts = opts || {}
17
-
18
- //orientation
19
- this.orientation = opts.orientation || 0
20
- //color
21
- this.color = opts.color || ((resolution, z, viewScale) => 'gray')
22
- //width
23
- this.width = opts.width || ((resolution, z, viewScale) => 3 * z)
24
- //length
25
- this.length = opts.length || ((resolution, z, viewScale) => resolution)
26
-
27
- //label
28
- this.label = opts.label || "-"
29
- }
30
-
31
- /**
32
- * @param {{ style: import("../style/SegmentStyle.js").SegmentStyle, resolution: number, z: number, viewScale:object }} opts
33
- */
34
- update(opts) {
35
-
36
- //clear
37
- this.div.selectAll('*').remove()
38
-
39
- //title
40
- this.makeTitle()
41
-
42
- const d = this.div.append('div')
43
-
44
- //compute segment color, width and length
45
- const color = this.color(opts.resolution, opts.z, opts.viewScale)
46
- const widthPix = this.width(opts.resolution, opts.z, opts.viewScale) / opts.z
47
- const lengthPix = this.length(opts.resolution, opts.z, opts.viewScale) / opts.z
48
-
49
- //draw SVG segment
50
- const svgS = Math.max(lengthPix, widthPix)
51
- const svg = d.append('svg').attr('width', svgS).attr('height', svgS).style('', 'inline-block')
52
-
53
- const cos = Math.cos((-this.orientation * Math.PI) / 180)
54
- const sin = Math.sin((-this.orientation * Math.PI) / 180)
55
- const dc = svgS * 0.5,
56
- l2 = lengthPix * 0.5
57
- svg.append('line')
58
- .attr('x1', dc - cos * l2)
59
- .attr('y1', dc - sin * l2)
60
- .attr('x2', dc + cos * l2)
61
- .attr('y2', dc + sin * l2)
62
- .style('stroke', color)
63
- .style('stroke-width', widthPix)
64
-
65
-
66
- //label
67
- d.append('div')
68
- .style('display', 'inline')
69
- .style('padding-left', '5px')
70
- .style('font-size', this.labelFontSize)
71
- .text(this.label + (this.labelUnitText ? ' ' : '') + this.labelUnitText)
72
- }
73
- }
74
-
75
- /**
76
- *
77
- * @param {Array.<number>} orientations
78
- * @param {Array.<string>} labels
79
- * @param {object} opts
80
- * @returns { Array.<OrientationLegend> }
81
- */
82
- export function orientationLegend(orientations, labels, opts = {}) {
83
- const legends = []
84
- for (let i = 0; i < orientations.length; i++) {
85
- opts.title = i == 0 ? opts.title : undefined;
86
- opts.orientation = orientations[i]
87
- opts.label = labels[i]
88
- legends.push(new OrientationLegend(opts))
89
- }
90
- return legends
91
- }
1
+ //@ts-check
2
+ 'use strict'
3
+
4
+ import { Legend } from '../core/Legend.js'
5
+
6
+ /**
7
+ * A legend element for segment orientation.
8
+ *
9
+ * @module legend
10
+ * @author Joseph Davies, Julien Gaffuri
11
+ */
12
+ export class OrientationLegend extends Legend {
13
+ /** @param {Object} opts */
14
+ constructor(opts) {
15
+ super(opts)
16
+ opts = opts || {}
17
+
18
+ //orientation
19
+ this.orientation = opts.orientation || 0
20
+ //color
21
+ this.color = opts.color || ((resolution, z, viewScale) => 'gray')
22
+ //width
23
+ this.width = opts.width || ((resolution, z, viewScale) => 3 * z)
24
+ //length
25
+ this.length = opts.length || ((resolution, z, viewScale) => resolution)
26
+
27
+ //label
28
+ this.label = opts.label || '-'
29
+ }
30
+
31
+ /**
32
+ * @param {{ style: import("../style/SegmentStyle.js").SegmentStyle, resolution: number, z: number, viewScale:object }} opts
33
+ */
34
+ update(opts) {
35
+ //clear
36
+ this.div.selectAll('*').remove()
37
+
38
+ //title
39
+ this.makeTitle()
40
+
41
+ const d = this.div.append('div')
42
+
43
+ //compute segment color, width and length
44
+ const color = this.color(opts.resolution, opts.z, opts.viewScale)
45
+ const widthPix = this.width(opts.resolution, opts.z, opts.viewScale) / opts.z
46
+ const lengthPix = this.length(opts.resolution, opts.z, opts.viewScale) / opts.z
47
+
48
+ //draw SVG segment
49
+ const svgS = Math.max(lengthPix, widthPix)
50
+ const svg = d.append('svg').attr('width', svgS).attr('height', svgS).style('', 'inline-block')
51
+
52
+ const cos = Math.cos((-this.orientation * Math.PI) / 180)
53
+ const sin = Math.sin((-this.orientation * Math.PI) / 180)
54
+ const dc = svgS * 0.5,
55
+ l2 = lengthPix * 0.5
56
+ svg.append('line')
57
+ .attr('x1', dc - cos * l2)
58
+ .attr('y1', dc - sin * l2)
59
+ .attr('x2', dc + cos * l2)
60
+ .attr('y2', dc + sin * l2)
61
+ .style('stroke', color)
62
+ .style('stroke-width', widthPix)
63
+
64
+ //label
65
+ d.append('div')
66
+ .style('display', 'inline')
67
+ .style('padding-left', '5px')
68
+ .style('font-size', this.labelFontSize)
69
+ .text(this.label + (this.labelUnitText ? ' ' : '') + this.labelUnitText)
70
+ }
71
+ }
72
+
73
+ /**
74
+ *
75
+ * @param {Array.<number>} orientations
76
+ * @param {Array.<string>} labels
77
+ * @param {object} opts
78
+ * @returns { Array.<OrientationLegend> }
79
+ */
80
+ export function orientationLegend(orientations, labels, opts = {}) {
81
+ const legends = []
82
+ for (let i = 0; i < orientations.length; i++) {
83
+ opts.title = i == 0 ? opts.title : undefined
84
+ opts.orientation = orientations[i]
85
+ opts.label = labels[i]
86
+ legends.push(new OrientationLegend(opts))
87
+ }
88
+ return legends
89
+ }