@emerson-eps/color-tables 0.2.4 → 0.2.7

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 (72) hide show
  1. package/.vscode/settings.json +3 -0
  2. package/dist/component/ColorSelector/ColorSelectorAccordion.js +3 -3
  3. package/dist/component/ColorSelector/ColorSelectorAccordion.js.map +1 -1
  4. package/dist/component/ColorSelector/ColorSelectorComponent.js +51 -45
  5. package/dist/component/ColorSelector/ColorSelectorComponent.js.map +1 -1
  6. package/dist/component/ColorSelector/ColorSelectorWrapper.js +21 -20
  7. package/dist/component/ColorSelector/ColorSelectorWrapper.js.map +1 -1
  8. package/dist/component/ColorTableTypes.d.ts +2 -2
  9. package/dist/component/Legend/ColorLegend.d.ts +4 -1
  10. package/dist/component/Legend/ColorLegend.js +16 -7
  11. package/dist/component/Legend/ColorLegend.js.map +1 -1
  12. package/dist/component/Legend/ContinuousLegend.d.ts +2 -2
  13. package/dist/component/Legend/ContinuousLegend.js +188 -153
  14. package/dist/component/Legend/ContinuousLegend.js.map +1 -1
  15. package/dist/component/Legend/DiscreteLegend.d.ts +2 -2
  16. package/dist/component/Legend/DiscreteLegend.js +162 -116
  17. package/dist/component/Legend/DiscreteLegend.js.map +1 -1
  18. package/dist/component/Utils/continousLegend.js +14 -12
  19. package/dist/component/Utils/continousLegend.js.map +1 -1
  20. package/dist/component/Utils/d3ColorScale.js +1 -1
  21. package/dist/component/Utils/d3ColorScale.js.map +1 -1
  22. package/dist/component/Utils/discreteLegend.d.ts +3 -3
  23. package/dist/component/Utils/discreteLegend.js +121 -64
  24. package/dist/component/Utils/discreteLegend.js.map +1 -1
  25. package/dist/stories/ColorLegends/ColorSelector/Selector.stories.js +2 -2
  26. package/dist/stories/ColorLegends/ColorSelector/Selector.stories.js.map +1 -1
  27. package/dist/stories/ColorLegends/ContinousLegends/MD.stories.js +27 -16
  28. package/dist/stories/ColorLegends/ContinousLegends/MD.stories.js.map +1 -1
  29. package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.js +27 -16
  30. package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.js.map +1 -1
  31. package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.js +27 -16
  32. package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.js.map +1 -1
  33. package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.js +27 -16
  34. package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.js.map +1 -1
  35. package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.js +27 -16
  36. package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.js.map +1 -1
  37. package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.js +27 -16
  38. package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.js.map +1 -1
  39. package/dist/stories/ColorLegends/ContinousLegends/SW.stories.js +27 -16
  40. package/dist/stories/ColorLegends/ContinousLegends/SW.stories.js.map +1 -1
  41. package/dist/stories/ColorLegends/DiscreteLegends/Facies.stories.js +25 -14
  42. package/dist/stories/ColorLegends/DiscreteLegends/Facies.stories.js.map +1 -1
  43. package/dist/stories/ColorLegends/DiscreteLegends/FaciesNoCalcite.stories.js +25 -14
  44. package/dist/stories/ColorLegends/DiscreteLegends/FaciesNoCalcite.stories.js.map +1 -1
  45. package/dist/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.js +25 -14
  46. package/dist/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.js.map +1 -1
  47. package/dist/stories/ColorLegends/DiscreteLegends/FaultProximityFlag.stories.js +25 -14
  48. package/dist/stories/ColorLegends/DiscreteLegends/FaultProximityFlag.stories.js.map +1 -1
  49. package/dist/stories/ColorLegends/DiscreteLegends/RDE.stories.js +25 -14
  50. package/dist/stories/ColorLegends/DiscreteLegends/RDE.stories.js.map +1 -1
  51. package/dist/stories/ColorLegends/DiscreteLegends/RDE_Orig.stories.js +25 -14
  52. package/dist/stories/ColorLegends/DiscreteLegends/RDE_Orig.stories.js.map +1 -1
  53. package/dist/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.js +25 -14
  54. package/dist/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.js.map +1 -1
  55. package/dist/stories/ColorLegends/DiscreteLegends/Zonelog.stories.js +25 -14
  56. package/dist/stories/ColorLegends/DiscreteLegends/Zonelog.stories.js.map +1 -1
  57. package/dist/stories/ColorLegends/LegendWithSelector/DiscreteLegendWithSelector.stories.js +25 -14
  58. package/dist/stories/ColorLegends/LegendWithSelector/DiscreteLegendWithSelector.stories.js.map +1 -1
  59. package/dist/stories/ColorLegends/LegendWithSelector/LegendWithSelector.stories.js +27 -16
  60. package/dist/stories/ColorLegends/LegendWithSelector/LegendWithSelector.stories.js.map +1 -1
  61. package/dist/stories/ColorLegends/SingleComponent/Single.stories.js +29 -18
  62. package/dist/stories/ColorLegends/SingleComponent/Single.stories.js.map +1 -1
  63. package/package.json +2 -1
  64. package/src/component/ColorSelector/ColorSelectorAccordion.tsx +2 -2
  65. package/src/component/ColorSelector/ColorSelectorComponent.tsx +17 -12
  66. package/src/component/ColorSelector/ColorSelectorWrapper.tsx +4 -4
  67. package/src/component/ColorTableTypes.ts +1 -1
  68. package/src/component/Legend/ColorLegend.tsx +13 -3
  69. package/src/component/Legend/ContinuousLegend.tsx +52 -54
  70. package/src/component/Legend/DiscreteLegend.tsx +118 -79
  71. package/src/component/Utils/discreteLegend.ts +125 -75
  72. package/tsconfig.json +1 -1
@@ -1,14 +1,14 @@
1
1
  import * as React from "react";
2
2
  import { useRef } from "react";
3
3
  import discreteLegendUtil from "../Utils/discreteLegend";
4
- import { select } from "d3";
4
+ import { select, scaleOrdinal } from "d3";
5
5
  import { colorTablesArray, colorTablesObj } from "../ColorTableTypes";
6
6
 
7
- declare type ItemColor = {
7
+ interface ItemColor {
8
8
  color: string;
9
9
  }
10
10
 
11
- declare type colorLegendProps = {
11
+ interface colorLegendProps {
12
12
  discreteData: { objects: Record<string, [number[], number]> };
13
13
  dataObjectName: string;
14
14
  position?: number[] | null;
@@ -30,11 +30,13 @@ export const DiscreteColorLegend: React.FC<colorLegendProps> = ({
30
30
  const divRef = useRef<HTMLDivElement>(null);
31
31
  let itemName: string[] = [];
32
32
  let itemColor: ItemColor[] = [];
33
- let testColor: ItemColor[] = [];
34
- let testName: string[] = [];
33
+ const testColor: ItemColor[] = [];
34
+ const testName: string[] = [];
35
35
 
36
36
  React.useEffect(() => {
37
37
  if (divRef.current) {
38
+ select(divRef.current).select("div").remove();
39
+ select(divRef.current).select("svg").remove();
38
40
  discreteLegend();
39
41
  }
40
42
  return function cleanup() {
@@ -45,111 +47,147 @@ export const DiscreteColorLegend: React.FC<colorLegendProps> = ({
45
47
 
46
48
  async function discreteLegend() {
47
49
  let dataSet;
48
- let discreteFlag = false
50
+ let useSelectorLegend = false;
49
51
 
50
52
  try {
51
53
  // fix for dash wrapper
52
54
  if (typeof colorTables === "string") {
53
- let res = await fetch(colorTables);
54
- dataSet = await res.json()
55
+ const res = await fetch(colorTables);
56
+ dataSet = await res.json();
55
57
  }
56
58
 
57
- let colorsArray = typeof colorTables === "string" ?
58
- colorTableData(colorName, dataSet)
59
- :
60
- colorTableData(colorName, colorTables);
59
+ const colorsArray =
60
+ typeof colorTables === "string"
61
+ ? colorTableData(colorName, dataSet)
62
+ : colorTableData(colorName, colorTables);
63
+
64
+ console.log('updateLegend', updateLegend)
61
65
 
62
66
  // Main discrete legend
63
- if(!updateLegend) {
67
+ if (!updateLegend || updateLegend.length == 0) {
64
68
  Object.keys(discreteData).forEach((key) => {
65
69
  //eslint-disable-next-line
66
70
  let code = (discreteData as { [key: string]: any })[key][1]
67
71
  //compare the first value in colorarray(colortable) and code from discreteData
68
- const matchedColorsArrays = colorsArray.find((value: number[]) => {
69
- return value[0] == code;
70
- });
72
+ const matchedColorsArrays = colorsArray.find(
73
+ (value: number[]) => {
74
+ return value[0] == code;
75
+ }
76
+ );
71
77
  if (matchedColorsArrays)
72
- itemColor.push({color: RGBToHex(matchedColorsArrays)});
73
- itemName.push(key);
78
+ itemColor.push({
79
+ color: RGBToHex(matchedColorsArrays),
80
+ });
81
+ itemName.push(key);
74
82
  });
75
- discreteFlag = false
76
- }
83
+ useSelectorLegend = false;
84
+ }
77
85
  // Discrete legend using Colortable colors
78
- else if (updateLegend && updateLegend.color) {
79
- // Object.keys(discreteData).forEach((key) => {
80
- // //eslint-disable-next-line
81
- // let code = (discreteData as { [key: string]: any })[key][1]
82
- // //compare the first value in colorarray(colortable) and code from discreteData
83
- // const matchedColorsArrays = updateLegend.color.find((value: number[]) => {
84
- // return value[0] == code;
85
- // });
86
- // if (matchedColorsArrays) {
87
- // testColor.push({color: RGBToHex(matchedColorsArrays)});
88
- // testName.push(key);
89
- // }
90
-
91
- // });
92
-
93
- //let color = updateLegend;
86
+ else if (updateLegend?.color) {
94
87
  updateLegend.color.forEach((key: any) => {
95
- testColor.push({color: RGBToHex(key)});
88
+ testColor.push({ color: RGBToHex(key) });
96
89
  });
97
90
 
98
- itemColor = testColor
99
- itemName = testName
100
- discreteFlag = true
91
+ itemColor = testColor;
92
+ itemName = testName;
93
+ useSelectorLegend = true;
101
94
  }
102
95
  // Discrete legend using d3 colors
103
- else {
96
+ else if (updateLegend?.colorsObject) {
104
97
  updateLegend.colorsObject.forEach((key: any) => {
105
- itemColor.push({color: key});
98
+ itemColor.push({ color: key });
106
99
  });
107
100
 
108
- itemColor = itemColor
109
- itemName = updateLegend.legendColorName
110
- discreteFlag = true
111
-
101
+ //itemColor = itemColor;
102
+ itemName = updateLegend.legendColorName;
103
+ useSelectorLegend = true;
112
104
  }
113
105
 
114
- //const ordinalValues = scaleOrdinal().domain(itemName);
115
- const colorLegend = discreteLegendUtil(itemColor, discreteFlag)
116
- const legendLength = itemColor.length;
117
- const calcLegendHeight = 22 * legendLength + 4 * legendLength;
118
- const selectedLegend = select(divRef.current);
119
- selectedLegend
106
+ // const toolTipName = itemName.map((word, idx) => {
107
+ // return <li key={idx}>{word}</li>;
108
+ // });
109
+
110
+ // let nameTool;
111
+
112
+ // toolTipName.forEach((data) => {
113
+ // //nameTool.push(data.props.children)
114
+ // nameTool = data.props.children;
115
+ // });
116
+
117
+ // // create a tooltip
118
+ // const tooltip = select(divRef.current)
119
+ // .append("div")
120
+ // .style("position", "absolute")
121
+ // .style("visibility", "hidden")
122
+ // .style("background-color", "black")
123
+ // .style("border", "solid")
124
+ // .style("border-width", "1px")
125
+ // .style("border-radius", "5px")
126
+ // .style("padding", "10px")
127
+ // .text(nameTool)
128
+ // .style("color", "grey");
129
+
130
+ const ordinalValues = scaleOrdinal().domain(itemName);
131
+ const colorLegend = discreteLegendUtil(
132
+ itemColor,
133
+ useSelectorLegend,
134
+ horizontal
135
+ ).inputScale(ordinalValues);
136
+ const currentDiv = select(divRef.current);
137
+ let totalRect;
138
+
139
+ // append the title
140
+ currentDiv
120
141
  .append("div")
121
142
  .text(dataObjectName)
143
+ .style("color", "grey")
122
144
  .attr("y", 10)
123
- .style("margin-bottom", "5px")
124
- if (horizontal && !discreteFlag) selectedLegend.style("height", 150 + "px");
125
- const svgLegend = selectedLegend
126
- .style("margin-right", "41px")
127
- .style("margin-top", "5px")
145
+ .style("margin-bottom", "5px");
146
+
147
+ // Append svg to the div
148
+ const svgLegend = currentDiv
149
+ .style("margin", "5px")
128
150
  .append("svg")
151
+ // .on("mouseover", function () {
152
+ // return tooltip.style("visibility", "visible");
153
+ // })
154
+ // .on("mouseout", function () {
155
+ // return tooltip.style("visibility", "hidden");
156
+ // })
129
157
  .call(colorLegend);
130
- if (colorLegend && !horizontal) {
131
- svgLegend
132
- .attr("height", calcLegendHeight + "px")
133
- .attr("width", 220 + "px");
134
- } else if (!discreteFlag && horizontal) {
135
- svgLegend
136
- .style("transform", "rotate(90deg)")
137
- .attr("height", calcLegendHeight + "px")
138
- .attr("width", calcLegendHeight + "px");
158
+
159
+ // Style for main horizontal legend
160
+ if (!useSelectorLegend) {
161
+ totalRect = itemColor.length;
139
162
  }
163
+ // Style for color selector legend
140
164
  else {
141
-
142
- var totalRect;
143
- if (updateLegend.color) {
144
- totalRect = updateLegend.color.length
145
- } else {
146
- totalRect = updateLegend.colorsObject.length
165
+ // calculate width for legend using colortable colors
166
+ if (updateLegend?.color) {
167
+ totalRect = updateLegend.color.length;
168
+ }
169
+ // calculate width for legend using d3 colors
170
+ else {
171
+ totalRect = updateLegend.colorsObject.length;
147
172
  }
148
- svgLegend.attr("viewBox", `0 0 ${totalRect} 2`)
149
- .attr("preserveAspectRatio", "none")
150
- .style("font-size", ".5")
151
- .attr("height", "50px")
152
- .attr("width", "150px");
173
+ }
174
+
175
+ if (horizontal) {
176
+ svgLegend
177
+ .attr("viewBox", `0 0 ${totalRect} 2`)
178
+ .attr("preserveAspectRatio", "none")
179
+ .style("font-size", ".4")
180
+ .attr("height", "50px")
181
+ .attr("width", "150px");
182
+ }
183
+ // vertical legend
184
+ else if (!horizontal) {
185
+ svgLegend
186
+ .attr("viewBox", `0 0 4 ${totalRect}`)
187
+ .attr("preserveAspectRatio", "none")
188
+ .style("font-size", ".4")
189
+ .attr("height", "150px")
190
+ .attr("width", "100px");
153
191
  }
154
192
  } catch (error) {
155
193
  console.error(error);
@@ -160,10 +198,11 @@ export const DiscreteColorLegend: React.FC<colorLegendProps> = ({
160
198
  <div
161
199
  style={{
162
200
  position: "absolute",
163
- right: position ? position[0] : ' ',
164
- top: position ? position[1] : ' ',
201
+ right: position ? position[0] : " ",
202
+ top: position ? position[1] : " ",
165
203
  backgroundColor: "#ffffffcc",
166
204
  borderRadius: "5px",
205
+ zIndex: "999 !important",
167
206
  }}
168
207
  >
169
208
  <div id="legend" ref={divRef}></div>
@@ -1,105 +1,155 @@
1
- declare type ItemColor = {
2
- color: any;
3
- }
1
+ interface ItemColor {
2
+ color: any;
3
+ };
4
4
 
5
5
  // eslint-disable-next-line
6
- export default function discreteLegendUtil(itemColor: ItemColor[], isSelectorLegend?: boolean): any {
7
- var cellWidth = 22;
8
- var cellHeight = 22;
9
- const cellPadding = 2;
6
+ export default function discreteLegendUtil(itemColor: ItemColor[], isSelectorLegend?: boolean, horizontal?: any): any {
7
+ // var cellWidth = 22;
8
+ // var cellHeight = 22;
10
9
 
11
- if (isSelectorLegend) {
12
- cellWidth = 25;
13
- cellHeight = 22;
14
- }
10
+ // if (isSelectorLegend) {
11
+ // cellWidth = 25;
12
+ // cellHeight = 22;
13
+ // }
15
14
 
16
- //let legendValues: ItemColor[] = [];
15
+ const legendValues: ItemColor[] = [];
17
16
 
18
17
  // eslint-disable-next-line
19
- function legend(g: any) {
18
+ function legend(g: any) {
20
19
  function drawLegend() {
21
20
  // Code to fill the color
22
21
  // Styling for color selector legend
23
- if (isSelectorLegend) {
24
- g.selectAll("g.legendCells")
25
- .data(itemColor)
26
- .enter()
27
- .append("g")
28
- .append("rect");
22
+ //if (isSelectorLegend) {
23
+ g.selectAll("g.legendCells")
24
+ .data(itemColor)
25
+ .enter()
26
+ .append("g")
27
+ .append("rect")
28
+ .attr("class", "rectLabel")
29
+ .style("cursor", "pointer")
30
+ .style("pointer-events", "all");
31
+ g.selectAll("rect")
32
+ .attr("height", 1)
33
+ .attr("width", 1)
34
+ .style("fill", function (d: Record<string, unknown>) {
35
+ return d["color"];
36
+ });
37
+ if (horizontal && !isSelectorLegend) {
38
+ g.selectAll("rect")
39
+ .attr("x", function (d: number, i: number) {
40
+ console.log(d)
41
+ return i;
42
+ })
43
+ .attr("y", 0);
44
+ } else if (!horizontal && !isSelectorLegend) {
29
45
  g.selectAll("rect")
30
- .attr("x", function (d: number, i: any) {
46
+ .attr("y", function (d: number, i: number) {
31
47
  console.log(d)
32
48
  return i;
33
49
  })
34
- .attr("y", 0)
35
- .attr("height", 1)
36
- .attr("width", 1)
37
- .style("fill", function (d: Record<string, unknown>) {
38
- return d["color"];
50
+ .attr("x", 0);
51
+ } else if (horizontal == true && isSelectorLegend) {
52
+ g.selectAll("rect")
53
+ .attr("x", function (d: number, i: number) {
54
+ console.log(d)
55
+ return i;
39
56
  })
40
- // Display the labels for legend
41
- g.selectAll("g")
42
- .style("background", "grey")
43
- .append("text")
44
- .attr("class", "breakLabels")
45
- .style("font-size", "0.4")
46
- //.attr("x", cellWidth + cellPadding)
47
- //.attr("y", 5 + cellHeight / 2)
48
- .attr("x", function (d: any, i: any) {
57
+ .attr("y", 0);
58
+ } else if (horizontal == false && isSelectorLegend) {
59
+ g.selectAll("rect")
60
+ .attr("y", function (d: number, i: number) {
49
61
  console.log(d)
50
- return i + "." + 25
62
+ return i;
51
63
  })
52
- .attr("y", 1.5)
53
- .text(function (d: any, i: any) {
64
+ .attr("x", 0);
65
+ } else {
66
+ g.selectAll("rect")
67
+ .attr("x", function (d: number, i: number) {
54
68
  console.log(d)
55
69
  return i;
56
70
  })
71
+ .attr("y", 0);
57
72
  }
73
+
74
+ // Display the labels for legend
75
+ // g.selectAll("g")
76
+ // .style("background", "grey")
77
+ // .append("text")
78
+ // .attr("class", "breakLabels")
79
+ // .style("font-size", "0.4")
80
+ // //.attr("x", cellWidth + cellPadding)
81
+ // //.attr("y", 5 + cellHeight / 2)
82
+ // .attr("x", function (d: any, i: any) {
83
+ // //console.log(d)
84
+ // return i + "." + 25
85
+ // })
86
+ // .attr("y", 1.5)
87
+ // .text(function (d: any, i: any) {
88
+ // //console.log(d)
89
+ // return i;
90
+ // })
91
+ //}
58
92
  // styling for main legend
59
- else {
60
- g.selectAll("g.legendCells")
61
- .append("rect")
62
- .attr("height", cellHeight)
63
- .attr("width", cellWidth)
64
- .style("fill", function (d: Record<string, unknown>) {
65
- return d["color"];
66
- });
67
- // Alighment of cell in straight line
68
- g.selectAll("g.legendCells").attr(
69
- "transform",
70
- function (_d: Record<string, unknown>, i: number) {
71
- return (
72
- "translate(0," + i * (cellHeight + cellPadding) + ")"
73
- //"translate(0," + i + ")"
74
- );
75
- }
76
- );
77
- }
93
+ // else {
94
+ // itemColor.forEach((item, index) => {
95
+ // legendValues[index].color = item.color;
96
+ // });
97
+ // g.selectAll("g.legendCells")
98
+ // .append("text")
99
+ // .attr("class", "breakLabels")
100
+ // .style("fill", "#6F6F6F")
101
+ // .attr("x", cellWidth + cellPadding)
102
+ // .attr("y", 5 + cellHeight / 2)
103
+ // .text(function (d: Record<string, unknown>, i:any) {
104
+ // return d['label'];
105
+ // });
106
+ // g.selectAll("g.legendCells")
107
+ // .style("cursor", "pointer")
108
+ // .append("rect")
109
+ // .attr("height", cellHeight)
110
+ // .attr("width", cellWidth)
111
+ // .style("fill", function (d: Record<string, unknown>) {
112
+ // //console.log('d', d)
113
+ // return d["color"];
114
+ // })
115
+
116
+ // // Alighment of cell in straight line
117
+ // g.selectAll("g.legendCells").attr(
118
+ // "transform",
119
+ // function (_d: Record<string, unknown>, i: number) {
120
+ // return (
121
+ // "translate(0," + i * (cellHeight + cellPadding) + ")"
122
+ // //"translate(0," + i + ")"
123
+ // );
124
+ // }
125
+ // );
126
+ // }
78
127
  }
79
128
 
80
129
  // display the discrete legend
81
- if (!isSelectorLegend) {
82
- g.selectAll("g.legendCells")
83
- .data(itemColor)
84
- .enter()
85
- .append("g")
86
- .attr("class", "legendCells")
87
- }
88
-
130
+ // if (!isSelectorLegend) {
131
+ // // console.log('itemcolor', itemColor)
132
+ // g.selectAll("g.legendCells")
133
+ // .data(legendValues)
134
+ // .enter()
135
+ // .append("g")
136
+ // .attr("class", "legendCells")
137
+ // }
138
+
89
139
  drawLegend();
90
140
  }
91
141
  // eslint-disable-next-line
92
- // legend.inputScale = function (newScale: any) {
93
- // // eslint-disable-next-line
94
- // let scale: any = {};
95
- // scale = newScale;
96
-
97
- // scale.domain().forEach(function (el: any) {
98
- // const cellObject = { color: scale(el), label: el };
99
- // legendValues.push(cellObject);
100
- // });
101
- // return this;
102
- // };
142
+ legend.inputScale = function (newScale: any) {
143
+ // eslint-disable-next-line
144
+ let scale: any = {};
145
+ scale = newScale;
146
+
147
+ scale.domain().forEach(function (el: any) {
148
+ const cellObject = { color: scale(el), label: el };
149
+ legendValues.push(cellObject);
150
+ });
151
+ return this;
152
+ };
103
153
 
104
154
  return legend;
105
155
  }
package/tsconfig.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "compilerOptions": {
3
3
  "outDir": "dist",
4
4
  "module": "es6",
5
- "target": "es6",
5
+ "target": "es5",
6
6
  "sourceMap": true,
7
7
  "allowJs": true,
8
8
  "jsx": "react",