@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
@@ -7,18 +7,48 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (_) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
10
37
  import * as React from "react";
11
38
  import { useRef } from "react";
12
39
  import discreteLegendUtil from "../Utils/discreteLegend";
13
- import { select } from "d3";
14
- export const DiscreteColorLegend = ({ discreteData, dataObjectName, position, colorName, colorTables, horizontal, updateLegend, }) => {
15
- const divRef = useRef(null);
16
- let itemName = [];
17
- let itemColor = [];
18
- let testColor = [];
19
- let testName = [];
20
- React.useEffect(() => {
40
+ import { select, scaleOrdinal } from "d3";
41
+ export var DiscreteColorLegend = function (_a) {
42
+ var discreteData = _a.discreteData, dataObjectName = _a.dataObjectName, position = _a.position, colorName = _a.colorName, colorTables = _a.colorTables, horizontal = _a.horizontal, updateLegend = _a.updateLegend;
43
+ var divRef = useRef(null);
44
+ var itemName = [];
45
+ var itemColor = [];
46
+ var testColor = [];
47
+ var testName = [];
48
+ React.useEffect(function () {
21
49
  if (divRef.current) {
50
+ select(divRef.current).select("div").remove();
51
+ select(divRef.current).select("svg").remove();
22
52
  discreteLegend();
23
53
  }
24
54
  return function cleanup() {
@@ -27,129 +57,145 @@ export const DiscreteColorLegend = ({ discreteData, dataObjectName, position, co
27
57
  };
28
58
  }, [discreteData, colorName, colorTables, horizontal, updateLegend]);
29
59
  function discreteLegend() {
30
- return __awaiter(this, void 0, void 0, function* () {
31
- let dataSet;
32
- let discreteFlag = false;
33
- try {
34
- // fix for dash wrapper
35
- if (typeof colorTables === "string") {
36
- let res = yield fetch(colorTables);
37
- dataSet = yield res.json();
38
- }
39
- let colorsArray = typeof colorTables === "string" ?
40
- colorTableData(colorName, dataSet)
41
- :
42
- colorTableData(colorName, colorTables);
43
- // Main discrete legend
44
- if (!updateLegend) {
45
- Object.keys(discreteData).forEach((key) => {
46
- //eslint-disable-next-line
47
- let code = discreteData[key][1];
48
- //compare the first value in colorarray(colortable) and code from discreteData
49
- const matchedColorsArrays = colorsArray.find((value) => {
50
- return value[0] == code;
51
- });
52
- if (matchedColorsArrays)
53
- itemColor.push({ color: RGBToHex(matchedColorsArrays) });
54
- itemName.push(key);
55
- });
56
- discreteFlag = false;
57
- }
58
- // Discrete legend using Colortable colors
59
- else if (updateLegend && updateLegend.color) {
60
- // Object.keys(discreteData).forEach((key) => {
61
- // //eslint-disable-next-line
62
- // let code = (discreteData as { [key: string]: any })[key][1]
63
- // //compare the first value in colorarray(colortable) and code from discreteData
64
- // const matchedColorsArrays = updateLegend.color.find((value: number[]) => {
65
- // return value[0] == code;
66
- // });
67
- // if (matchedColorsArrays) {
68
- // testColor.push({color: RGBToHex(matchedColorsArrays)});
69
- // testName.push(key);
70
- // }
71
- // });
72
- //let color = updateLegend;
73
- updateLegend.color.forEach((key) => {
74
- testColor.push({ color: RGBToHex(key) });
75
- });
76
- itemColor = testColor;
77
- itemName = testName;
78
- discreteFlag = true;
60
+ return __awaiter(this, void 0, void 0, function () {
61
+ var dataSet, useSelectorLegend, res, colorsArray_1, ordinalValues, colorLegend, currentDiv, totalRect, svgLegend, error_1;
62
+ return __generator(this, function (_a) {
63
+ switch (_a.label) {
64
+ case 0:
65
+ useSelectorLegend = false;
66
+ _a.label = 1;
67
+ case 1:
68
+ _a.trys.push([1, 5, , 6]);
69
+ if (!(typeof colorTables === "string")) return [3 /*break*/, 4];
70
+ return [4 /*yield*/, fetch(colorTables)];
71
+ case 2:
72
+ res = _a.sent();
73
+ return [4 /*yield*/, res.json()];
74
+ case 3:
75
+ dataSet = _a.sent();
76
+ _a.label = 4;
77
+ case 4:
78
+ colorsArray_1 = typeof colorTables === "string"
79
+ ? colorTableData(colorName, dataSet)
80
+ : colorTableData(colorName, colorTables);
81
+ console.log('updateLegend', updateLegend);
82
+ // Main discrete legend
83
+ if (!updateLegend || updateLegend.length == 0) {
84
+ Object.keys(discreteData).forEach(function (key) {
85
+ //eslint-disable-next-line
86
+ var code = discreteData[key][1];
87
+ //compare the first value in colorarray(colortable) and code from discreteData
88
+ var matchedColorsArrays = colorsArray_1.find(function (value) {
89
+ return value[0] == code;
90
+ });
91
+ if (matchedColorsArrays)
92
+ itemColor.push({
93
+ color: RGBToHex(matchedColorsArrays),
94
+ });
95
+ itemName.push(key);
96
+ });
97
+ useSelectorLegend = false;
98
+ }
99
+ // Discrete legend using Colortable colors
100
+ else if (updateLegend === null || updateLegend === void 0 ? void 0 : updateLegend.color) {
101
+ updateLegend.color.forEach(function (key) {
102
+ testColor.push({ color: RGBToHex(key) });
103
+ });
104
+ itemColor = testColor;
105
+ itemName = testName;
106
+ useSelectorLegend = true;
107
+ }
108
+ // Discrete legend using d3 colors
109
+ else if (updateLegend === null || updateLegend === void 0 ? void 0 : updateLegend.colorsObject) {
110
+ updateLegend.colorsObject.forEach(function (key) {
111
+ itemColor.push({ color: key });
112
+ });
113
+ //itemColor = itemColor;
114
+ itemName = updateLegend.legendColorName;
115
+ useSelectorLegend = true;
116
+ }
117
+ ordinalValues = scaleOrdinal().domain(itemName);
118
+ colorLegend = discreteLegendUtil(itemColor, useSelectorLegend, horizontal).inputScale(ordinalValues);
119
+ currentDiv = select(divRef.current);
120
+ totalRect = void 0;
121
+ // append the title
122
+ currentDiv
123
+ .append("div")
124
+ .text(dataObjectName)
125
+ .style("color", "grey")
126
+ .attr("y", 10)
127
+ .style("margin-bottom", "5px");
128
+ svgLegend = currentDiv
129
+ .style("margin", "5px")
130
+ .append("svg")
131
+ // .on("mouseover", function () {
132
+ // return tooltip.style("visibility", "visible");
133
+ // })
134
+ // .on("mouseout", function () {
135
+ // return tooltip.style("visibility", "hidden");
136
+ // })
137
+ .call(colorLegend);
138
+ // Style for main horizontal legend
139
+ if (!useSelectorLegend) {
140
+ totalRect = itemColor.length;
141
+ }
142
+ // Style for color selector legend
143
+ else {
144
+ // calculate width for legend using colortable colors
145
+ if (updateLegend === null || updateLegend === void 0 ? void 0 : updateLegend.color) {
146
+ totalRect = updateLegend.color.length;
147
+ }
148
+ // calculate width for legend using d3 colors
149
+ else {
150
+ totalRect = updateLegend.colorsObject.length;
151
+ }
152
+ }
153
+ if (horizontal) {
154
+ svgLegend
155
+ .attr("viewBox", "0 0 ".concat(totalRect, " 2"))
156
+ .attr("preserveAspectRatio", "none")
157
+ .style("font-size", ".4")
158
+ .attr("height", "50px")
159
+ .attr("width", "150px");
160
+ }
161
+ // vertical legend
162
+ else if (!horizontal) {
163
+ svgLegend
164
+ .attr("viewBox", "0 0 4 ".concat(totalRect))
165
+ .attr("preserveAspectRatio", "none")
166
+ .style("font-size", ".4")
167
+ .attr("height", "150px")
168
+ .attr("width", "100px");
169
+ }
170
+ return [3 /*break*/, 6];
171
+ case 5:
172
+ error_1 = _a.sent();
173
+ console.error(error_1);
174
+ return [3 /*break*/, 6];
175
+ case 6: return [2 /*return*/];
79
176
  }
80
- // Discrete legend using d3 colors
81
- else {
82
- updateLegend.colorsObject.forEach((key) => {
83
- itemColor.push({ color: key });
84
- });
85
- itemColor = itemColor;
86
- itemName = updateLegend.legendColorName;
87
- discreteFlag = true;
88
- }
89
- //const ordinalValues = scaleOrdinal().domain(itemName);
90
- const colorLegend = discreteLegendUtil(itemColor, discreteFlag);
91
- const legendLength = itemColor.length;
92
- const calcLegendHeight = 22 * legendLength + 4 * legendLength;
93
- const selectedLegend = select(divRef.current);
94
- selectedLegend
95
- .append("div")
96
- .text(dataObjectName)
97
- .attr("y", 10)
98
- .style("margin-bottom", "5px");
99
- if (horizontal && !discreteFlag)
100
- selectedLegend.style("height", 150 + "px");
101
- const svgLegend = selectedLegend
102
- .style("margin-right", "41px")
103
- .style("margin-top", "5px")
104
- .append("svg")
105
- .call(colorLegend);
106
- if (colorLegend && !horizontal) {
107
- svgLegend
108
- .attr("height", calcLegendHeight + "px")
109
- .attr("width", 220 + "px");
110
- }
111
- else if (!discreteFlag && horizontal) {
112
- svgLegend
113
- .style("transform", "rotate(90deg)")
114
- .attr("height", calcLegendHeight + "px")
115
- .attr("width", calcLegendHeight + "px");
116
- }
117
- else {
118
- var totalRect;
119
- if (updateLegend.color) {
120
- totalRect = updateLegend.color.length;
121
- }
122
- else {
123
- totalRect = updateLegend.colorsObject.length;
124
- }
125
- svgLegend.attr("viewBox", `0 0 ${totalRect} 2`)
126
- .attr("preserveAspectRatio", "none")
127
- .style("font-size", ".5")
128
- .attr("height", "50px")
129
- .attr("width", "150px");
130
- }
131
- }
132
- catch (error) {
133
- console.error(error);
134
- }
177
+ });
135
178
  });
136
179
  }
137
180
  return (React.createElement("div", { style: {
138
181
  position: "absolute",
139
- right: position ? position[0] : ' ',
140
- top: position ? position[1] : ' ',
182
+ right: position ? position[0] : " ",
183
+ top: position ? position[1] : " ",
141
184
  backgroundColor: "#ffffffcc",
142
185
  borderRadius: "5px",
186
+ zIndex: "999 !important",
143
187
  } },
144
188
  React.createElement("div", { id: "legend", ref: divRef })));
145
189
  };
146
190
  // Based on name return the colors array from color.tables.json file
147
191
  export function colorTableData(colorName, colorTables) {
148
- const colorTableData = colorTables.filter((value) => value.name.toLowerCase() == colorName.toLowerCase());
192
+ var colorTableData = colorTables.filter(function (value) {
193
+ return value.name.toLowerCase() == colorName.toLowerCase();
194
+ });
149
195
  return colorTableData.length > 0 ? colorTableData[0].colors : [];
150
196
  }
151
197
  export function RGBToHex(rgb) {
152
- let r = rgb[1].toString(16), g = rgb[2].toString(16), b = rgb[3].toString(16);
198
+ var r = rgb[1].toString(16), g = rgb[2].toString(16), b = rgb[3].toString(16);
153
199
  if (r.length == 1)
154
200
  r = "0" + r;
155
201
  if (g.length == 1)
@@ -1 +1 @@
1
- {"version":3,"file":"DiscreteLegend.js","sourceRoot":"","sources":["../../../src/component/Legend/DiscreteLegend.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAiB5B,MAAM,CAAC,MAAM,mBAAmB,GAA+B,CAAC,EAC5D,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,SAAS,EACT,WAAW,EACX,UAAU,EACV,YAAY,GACG,EAAE,EAAE;IACnB,MAAM,MAAM,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC5C,IAAI,QAAQ,GAAa,EAAE,CAAC;IAC5B,IAAI,SAAS,GAAgB,EAAE,CAAC;IAChC,IAAI,SAAS,GAAgB,EAAE,CAAC;IAChC,IAAI,QAAQ,GAAa,EAAE,CAAC;IAE5B,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,IAAI,MAAM,CAAC,OAAO,EAAE;YAChB,cAAc,EAAE,CAAC;SACpB;QACD,OAAO,SAAS,OAAO;YACnB,MAAM,CAAC,MAAM,CAA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;AAED,MAAM,UAAU,QAAQ,CAAC,GAAa;IAClC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,EACvB,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,EACvB,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC5B,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC;QAAE,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;IAC/B,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC;QAAE,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;IAC/B,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC;QAAE,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;IAC/B,OAAO,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC;AAED,mBAAmB,CAAC,YAAY,GAAG;IAC/B,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;CACpB,CAAC"}
@@ -2,15 +2,17 @@ import { color } from "d3-color";
2
2
  import { interpolateRgb } from "d3-interpolate";
3
3
  // Based on objectName return the colors array from color.tables.json file
4
4
  export function colorsArray(colorName, colorTables) {
5
- const colorTableData = colorTables.filter((value) => value.name.toLowerCase() == colorName.toLowerCase());
5
+ var colorTableData = colorTables.filter(function (value) {
6
+ return value.name.toLowerCase() == colorName.toLowerCase();
7
+ });
6
8
  return colorTableData.length > 0 ? colorTableData[0].colors : [];
7
9
  }
8
10
  // return the colors based on the point
9
11
  export function rgbValues(point, colorName, colorTables) {
10
12
  var _a;
11
- const colorTableColors = colorsArray(colorName, colorTables);
13
+ var colorTableColors = colorsArray(colorName, colorTables);
12
14
  // compare the point and first value from colorTableColors
13
- const colorArrays = colorTableColors.find((value) => {
15
+ var colorArrays = colorTableColors.find(function (value) {
14
16
  return point == value[0];
15
17
  });
16
18
  // if point and value in color table matches then return particular colors
@@ -20,16 +22,16 @@ export function rgbValues(point, colorName, colorTables) {
20
22
  // if no match then need to do interpolation
21
23
  else {
22
24
  // Get index of first match of colortable point greater than point
23
- const index = colorTableColors.findIndex((value) => {
25
+ var index = colorTableColors.findIndex(function (value) {
24
26
  return value[0] > point;
25
27
  });
26
- const firstColorArray = colorTableColors[index - 1];
27
- const secondColorArray = colorTableColors[index];
28
+ var firstColorArray = colorTableColors[index - 1];
29
+ var secondColorArray = colorTableColors[index];
28
30
  if ((firstColorArray || secondColorArray) != undefined) {
29
- const t0 = firstColorArray[0];
30
- const t1 = secondColorArray[0];
31
- const t = (point - t0) / (t1 - t0); // t = 0.0 gives first color, t = 1.0 gives second color.
32
- const interpolatedValues = interpolateRgb(RGBToHex(firstColorArray).color, RGBToHex(secondColorArray).color)(t);
31
+ var t0 = firstColorArray[0];
32
+ var t1 = secondColorArray[0];
33
+ var t = (point - t0) / (t1 - t0); // t = 0.0 gives first color, t = 1.0 gives second color.
34
+ var interpolatedValues = interpolateRgb(RGBToHex(firstColorArray).color, RGBToHex(secondColorArray).color)(t);
33
35
  return (_a = color(interpolatedValues)) === null || _a === void 0 ? void 0 : _a.rgb();
34
36
  }
35
37
  return undefined;
@@ -37,14 +39,14 @@ export function rgbValues(point, colorName, colorTables) {
37
39
  }
38
40
  // return the hex color code and offset
39
41
  export function RGBToHex(rgb) {
40
- let r = Math.round(rgb[1]).toString(16), g = Math.round(rgb[2]).toString(16), b = Math.round(rgb[3]).toString(16);
42
+ var r = Math.round(rgb[1]).toString(16), g = Math.round(rgb[2]).toString(16), b = Math.round(rgb[3]).toString(16);
41
43
  if (r.length == 1)
42
44
  r = "0" + r;
43
45
  if (g.length == 1)
44
46
  g = "0" + g;
45
47
  if (b.length == 1)
46
48
  b = "0" + b;
47
- const offset = rgb[0] * 100.0;
49
+ var offset = rgb[0] * 100.0;
48
50
  return { color: "#" + r + g + b, offset: offset };
49
51
  }
50
52
  //# sourceMappingURL=continousLegend.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"continousLegend.js","sourceRoot":"","sources":["../../../src/component/Utils/continousLegend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAMhD,0EAA0E;AAC1E,MAAM,UAAU,WAAW,CACvB,SAAiB,EACjB,WAA6B;IAE7B,MAAM,cAAc,GAAG,WAAW,CAAC,MAAM,CACrC,CAAC,KAAqB,EAAE,EAAE,CACtB,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,SAAS,CAAC,WAAW,EAAE,CAC1D,CAAC;IACF,OAAO,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;AACrE,CAAC;AAED,uCAAuC;AACvC,MAAM,UAAU,SAAS,CACrB,KAAa,EACb,SAAiB,EACjB,WAA6B;;IAE7B,MAAM,gBAAgB,GAAG,WAAW,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAC7D,0DAA0D;IAC1D,MAAM,WAAW,GAAG,gBAAgB,CAAC,IAAI,CACrC,CAAC,KAAuC,EAAE,EAAE;QACxC,OAAO,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC,CACJ,CAAC;IAEF,0EAA0E;IAC1E,IAAI,WAAW,EAAE;QACb,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KAC/B;IACD,4CAA4C;SACvC;QACD,kEAAkE;QAClE,MAAM,KAAK,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC,KAAe,EAAE,EAAE;YACzD,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;QAC5B,CAAC,CAAC,CAAC;QAEH,MAAM,eAAe,GAAG,gBAAgB,CAAC,KAAK,GAAG,CAAC,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,GAAG,GAAG,CAAC,CAAC;IAC/B,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC;QAAE,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;IAC/B,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC;QAAE,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;IAC/B,IAAM,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;IAE9B,OAAO,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AACtD,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import * as d3 from "d3";
2
- export const d3ColorScales = [
2
+ export var d3ColorScales = [
3
3
  {
4
4
  "name": "Spectral",
5
5
  "discrete": false,
@@ -1 +1 @@
1
- {"version":3,"file":"d3ColorScale.js","sourceRoot":"","sources":["../../../src/component/Utils/d3ColorScale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B;QACE,MAAM,EAAE,UAAU;QAClB,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,EAAE,CAAC,mBAAmB;KACjC;IACD;QACE,MAAM,EAAE,QAAQ;QAChB,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,EAAE,CAAC,iBAAiB;KAC/B;IACD;QACE,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,EAAE,CAAC,eAAe;KAC7B;IACD;QACE,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,EAAE,CAAC,eAAe;KAC7B;IACD;QACE,MAAM,EAAE,SAAS;QACjB,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,EAAE,CAAC,kBAAkB;KAChC;IACD;QACE,MAAM,EAAE,SAAS;QACjB,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,EAAE,CAAC,kBAAkB;KAChC;IACD;QACE,MAAM,EAAE,QAAQ;QAChB,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,EAAE,CAAC,YAAY;KAC1B;IACD;QACE,MAAM,EAAE,OAAO;QACf,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,EAAE,CAAC,WAAW;KACzB;IACD;QACE,MAAM,EAAE,QAAQ;QAChB,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,EAAE,CAAC,YAAY;KAC1B;IACD;QACE,MAAM,EAAE,SAAS;QACjB,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,EAAE,CAAC,aAAa;KAC3B;IACD;QACE,MAAM,EAAE,SAAS;QACjB,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,EAAE,CAAC,aAAa;KAC3B;IACD;QACE,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,EAAE,CAAC,UAAU;KACxB;IACD;QACE,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,EAAE,CAAC,UAAU;KACxB;IACD;QACE,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,EAAE,CAAC,UAAU;KACxB;IACD;QACE,MAAM,EAAE,WAAW;QACnB,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,EAAE,CAAC,eAAe;KAC7B;IACD;QACE,MAAM,EAAE,YAAY;QACpB,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,EAAE,CAAC,gBAAgB;KAC9B;CACF,CAAA"}
1
+ {"version":3,"file":"d3ColorScale.js","sourceRoot":"","sources":["../../../src/component/Utils/d3ColorScale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB,MAAM,CAAC,IAAM,aAAa,GAAG;IAC3B;QACE,MAAM,EAAE,UAAU;QAClB,UAAU,EAAE,KAAK;QACjB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,EAAE,IAAI;QAChB,QAAQ,EAAE,EAAE,CAAC,UAAU;KACxB;IACD;QACE,MAAM,EAAE,WAAW;QACnB,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,EAAE,CAAC,eAAe;KAC7B;IACD;QACE,MAAM,EAAE,YAAY;QACpB,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,EAAE,CAAC,gBAAgB;KAC9B;CACF,CAAA"}
@@ -1,5 +1,5 @@
1
- declare type ItemColor = {
1
+ interface ItemColor {
2
2
  color: any;
3
- };
4
- export default function discreteLegendUtil(itemColor: ItemColor[], isSelectorLegend?: boolean): any;
3
+ }
4
+ export default function discreteLegendUtil(itemColor: ItemColor[], isSelectorLegend?: boolean, horizontal?: any): any;
5
5
  export {};