@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,13 +7,41 @@ 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 { RGBToHex, colorsArray } from "../Utils/continousLegend";
13
40
  import { select, scaleLinear, scaleSequential, axisBottom, axisRight } from "d3";
14
- export const ContinuousLegend = ({ min, max, dataObjectName, position, colorName, colorTables, horizontal, updateLegend, }) => {
15
- const divRef = useRef(null);
16
- React.useEffect(() => {
41
+ export var ContinuousLegend = function (_a) {
42
+ var min = _a.min, max = _a.max, dataObjectName = _a.dataObjectName, position = _a.position, colorName = _a.colorName, colorTables = _a.colorTables, horizontal = _a.horizontal, updateLegend = _a.updateLegend;
43
+ var divRef = useRef(null);
44
+ React.useEffect(function () {
17
45
  if (divRef.current) {
18
46
  continuousLegend();
19
47
  }
@@ -24,162 +52,169 @@ export const ContinuousLegend = ({ min, max, dataObjectName, position, colorName
24
52
  };
25
53
  }, [min, max, colorName, colorTables, horizontal, updateLegend]);
26
54
  function continuousLegend() {
27
- return __awaiter(this, void 0, void 0, function* () {
28
- const itemColor = [];
29
- let dataSet;
30
- try {
31
- // fix for dash wrapper
32
- if (typeof colorTables === "string") {
33
- let res = yield fetch(colorTables);
34
- dataSet = yield res.json();
35
- }
36
- // Return the matched colors array from color.tables.json file
37
- let legendColors = typeof colorTables === "string" ?
38
- colorsArray(colorName, dataSet)
39
- :
40
- colorsArray(colorName, colorTables);
41
- // Update color of legend based on color selector scales
42
- // data is passed on click upon color scales
43
- if (updateLegend) {
44
- // legend using color table data
45
- if (updateLegend.color) {
46
- legendColors = updateLegend.color;
47
- }
48
- // legend using d3 data
49
- else if (updateLegend.length > 0) {
50
- legendColors = updateLegend;
51
- }
52
- }
53
- // main continuous legend
54
- else {
55
- legendColors;
56
- }
57
- legendColors.forEach((value) => {
58
- // return the color and offset needed to draw the legend
59
- itemColor.push({
60
- offset: RGBToHex(value).offset,
61
- color: RGBToHex(value).color,
62
- });
63
- });
64
- const colorScale = scaleSequential().domain([min, max]);
65
- // append a defs (for definition) element to your SVG
66
- const svgLegend = select(divRef.current)
67
- .append("svg")
68
- .style("background-color", "#ffffffcc")
69
- .style("border-radius", "5px");
70
- const defs = svgLegend.append("defs");
71
- let linearGradient;
72
- // vertical legend
73
- if (!horizontal) {
74
- svgLegend
75
- // .style("transform", "rotate(270deg)")
76
- // .style("margin-top", "80px");
77
- .attr("width", "100")
78
- .attr("height", "150");
79
- linearGradient = defs
80
- .append("linearGradient")
81
- .attr("id", "linear-gradient")
82
- .attr("x1", "0%")
83
- .attr("x2", "0%")
84
- .attr("y1", "0%")
85
- .attr("y2", "100%"); //since it's a vertical linear gradient
86
- }
87
- // horizontal legend
88
- else {
89
- svgLegend
90
- .attr("width", "220")
91
- .attr("height", "165");
92
- // append a linearGradient element to the defs and give it a unique id
93
- linearGradient = defs
94
- .append("linearGradient")
95
- .attr("id", "linear-gradient")
96
- .attr("x1", "0%")
97
- .attr("x2", "100%") //since it's a horizontal linear gradient
98
- .attr("y1", "0%")
99
- .attr("y2", "0%");
55
+ return __awaiter(this, void 0, void 0, function () {
56
+ var itemColor, dataSet, res, legendColors, colorScale, svgLegend, defs, linearGradient, xLeg, yLeg, horizontalAxisLeg, VerticalAxisLeg, error_1;
57
+ return __generator(this, function (_a) {
58
+ switch (_a.label) {
59
+ case 0:
60
+ itemColor = [];
61
+ _a.label = 1;
62
+ case 1:
63
+ _a.trys.push([1, 5, , 6]);
64
+ if (!(typeof colorTables === "string")) return [3 /*break*/, 4];
65
+ return [4 /*yield*/, fetch(colorTables)];
66
+ case 2:
67
+ res = _a.sent();
68
+ return [4 /*yield*/, res.json()];
69
+ case 3:
70
+ dataSet = _a.sent();
71
+ _a.label = 4;
72
+ case 4:
73
+ legendColors = typeof colorTables === "string" ?
74
+ colorsArray(colorName, dataSet)
75
+ :
76
+ colorsArray(colorName, colorTables);
77
+ // Update color of legend based on color selector scales
78
+ // data is passed on click upon color scales
79
+ if (updateLegend) {
80
+ // legend using color table data
81
+ if (updateLegend.color) {
82
+ legendColors = updateLegend.color;
83
+ }
84
+ // legend using d3 data
85
+ else if (updateLegend.arrayData) {
86
+ legendColors = updateLegend.arrayData;
87
+ }
88
+ }
89
+ // main continuous legend
90
+ else {
91
+ legendColors;
92
+ }
93
+ legendColors.forEach(function (value) {
94
+ // return the color and offset needed to draw the legend
95
+ itemColor.push({
96
+ offset: RGBToHex(value).offset,
97
+ color: RGBToHex(value).color,
98
+ });
99
+ });
100
+ colorScale = scaleSequential().domain([min, max]);
101
+ svgLegend = select(divRef.current)
102
+ .append("svg")
103
+ .style("background-color", "#ffffffcc")
104
+ .style("border-radius", "5px");
105
+ defs = svgLegend.append("defs");
106
+ linearGradient = void 0;
107
+ // vertical legend
108
+ if (!horizontal) {
109
+ svgLegend
110
+ // .style("transform", "rotate(270deg)")
111
+ // .style("margin-top", "80px");
112
+ .attr("width", "100")
113
+ .attr("height", "190");
114
+ linearGradient = defs
115
+ .append("linearGradient")
116
+ .attr("id", "linear-gradient")
117
+ .attr("x1", "0%")
118
+ .attr("x2", "0%")
119
+ .attr("y1", "0%")
120
+ .attr("y2", "100%"); //since it's a vertical linear gradient
121
+ }
122
+ // horizontal legend
123
+ else {
124
+ svgLegend.attr("width", "200").attr("height", "90");
125
+ // append a linearGradient element to the defs and give it a unique id
126
+ linearGradient = defs
127
+ .append("linearGradient")
128
+ .attr("id", "linear-gradient")
129
+ .attr("x1", "0%")
130
+ .attr("x2", "100%") //since it's a horizontal linear gradient
131
+ .attr("y1", "0%")
132
+ .attr("y2", "0%");
133
+ }
134
+ // append multiple color stops by using D3's data/enter step
135
+ linearGradient
136
+ .selectAll("stop")
137
+ .data(itemColor)
138
+ .enter()
139
+ .append("stop")
140
+ .attr("offset", function (data) {
141
+ return data.offset + "%";
142
+ })
143
+ .attr("stop-color", function (data) {
144
+ return data.color;
145
+ });
146
+ // append title
147
+ svgLegend
148
+ .append("text")
149
+ .attr("class", "legendTitle")
150
+ .attr("x", 25)
151
+ .attr("y", 20)
152
+ .style("text-anchor", "left")
153
+ .text(dataObjectName);
154
+ // vertical legend
155
+ if (!horizontal) {
156
+ // draw the rectangle and fill with gradient
157
+ svgLegend
158
+ .append("rect")
159
+ .attr("x", 25)
160
+ .attr("y", 30)
161
+ .attr("width", 25)
162
+ .attr("height", "150")
163
+ .style("fill", "url(#linear-gradient)");
164
+ }
165
+ // horizontal legend
166
+ else {
167
+ // draw the rectangle and fill with gradient
168
+ svgLegend
169
+ .append("rect")
170
+ .attr("x", 25)
171
+ .attr("y", 30)
172
+ .attr("width", "150")
173
+ .attr("height", 25)
174
+ .style("fill", "url(#linear-gradient)");
175
+ }
176
+ xLeg = scaleLinear().domain([min, max]).range([10, 158]);
177
+ yLeg = scaleLinear().domain([min, max]).range([10, 158]);
178
+ horizontalAxisLeg = axisBottom(xLeg).tickValues(colorScale.domain());
179
+ VerticalAxisLeg = axisRight(yLeg)
180
+ .tickSize(24)
181
+ .tickValues(colorScale.domain());
182
+ if (horizontal) {
183
+ svgLegend
184
+ .attr("class", "axis")
185
+ .append("g")
186
+ .attr("transform", "translate(15, 55)")
187
+ .style("font-size", "10px")
188
+ .style("font-weight", "700")
189
+ .call(horizontalAxisLeg)
190
+ .style("height", 25);
191
+ }
192
+ else {
193
+ svgLegend
194
+ .attr("class", "axis")
195
+ .append("g")
196
+ .attr("transform", "translate(25, 20)")
197
+ .style("font-size", "10px")
198
+ .style("font-weight", "700")
199
+ .call(VerticalAxisLeg);
200
+ }
201
+ return [3 /*break*/, 6];
202
+ case 5:
203
+ error_1 = _a.sent();
204
+ console.error(error_1);
205
+ return [3 /*break*/, 6];
206
+ case 6: return [2 /*return*/];
100
207
  }
101
- // append multiple color stops by using D3's data/enter step
102
- linearGradient
103
- .selectAll("stop")
104
- .data(itemColor)
105
- .enter()
106
- .append("stop")
107
- .attr("offset", function (data) {
108
- return data.offset + "%";
109
- })
110
- .attr("stop-color", function (data) {
111
- return data.color;
112
- });
113
- // append title
114
- svgLegend
115
- .append("text")
116
- .attr("class", "legendTitle")
117
- .attr("x", 25)
118
- .attr("y", 20)
119
- .style("text-anchor", "left")
120
- .text(dataObjectName);
121
- // vertical legend
122
- if (!horizontal) {
123
- // draw the rectangle and fill with gradient
124
- svgLegend
125
- .append("rect")
126
- .attr("x", 25)
127
- .attr("y", 30)
128
- .attr("width", 25)
129
- .attr("height", "150")
130
- .style("fill", "url(#linear-gradient)");
131
- }
132
- // horizontal legend
133
- else {
134
- // draw the rectangle and fill with gradient
135
- svgLegend
136
- .append("rect")
137
- .attr("x", 25)
138
- .attr("y", 30)
139
- .attr("width", "150")
140
- .attr("height", 25)
141
- .style("fill", "url(#linear-gradient)");
142
- }
143
- //create tick marks
144
- // range varies the size of the axis
145
- const xLeg = scaleLinear().domain([min, max]).range([10, 158]);
146
- const yLeg = scaleLinear().domain([min, max]).range([10, 127]);
147
- const horizontalAxisLeg = axisBottom(xLeg).tickValues(colorScale.domain());
148
- var VerticalAxisLeg = axisRight(yLeg).tickSize(24).tickValues(colorScale.domain());
149
- if (horizontal) {
150
- svgLegend
151
- .attr("class", "axis")
152
- .append("g")
153
- .attr("transform", "translate(15, 55)")
154
- .style("font-size", "10px")
155
- .style("font-weight", "700")
156
- .call(horizontalAxisLeg)
157
- .style("height", 25);
158
- }
159
- else {
160
- svgLegend
161
- .attr("class", "axis")
162
- .append("g")
163
- .attr("transform", "translate(25, 20)")
164
- .style("font-size", "10px")
165
- .style("font-weight", "700")
166
- .call(VerticalAxisLeg);
167
- }
168
- }
169
- catch (error) {
170
- console.error(error);
171
- }
208
+ });
172
209
  });
173
210
  }
174
211
  return (React.createElement("div", { style: {
175
212
  position: "absolute",
176
- right: position ? position[0] : ' ',
177
- top: position ? position[1] : ' ',
213
+ right: position ? position[0] : " ",
214
+ top: position ? position[1] : " ",
215
+ zIndex: 999,
178
216
  } },
179
- React.createElement("div", { id: "legend", ref: divRef, style: {
180
- width: horizontal ? "220px" : "100px",
181
- height: horizontal ? "165px" : "150px",
182
- } })));
217
+ React.createElement("div", { id: "legend", ref: divRef })));
183
218
  };
184
219
  ContinuousLegend.defaultProps = {
185
220
  position: [5, 10],
@@ -1 +1 @@
1
- {"version":3,"file":"ContinuousLegend.js","sourceRoot":"","sources":["../../../src/component/Legend/ContinuousLegend.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAmBjF,MAAM,CAAC,MAAM,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G;YACjC,MAAM,EAAE,GAAG;SACd;QAED,6BAAK,EAAE,EAAC,QAAQ,EAAC,GAAG,EAAE,MAAM,GAAQ,CAClC,CACT,CAAC;AACN,CAAC,CAAC;AAEF,gBAAgB,CAAC,YAAY,GAAG;IAC5B,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;CACpB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { colorTablesArray } from "../ColorTableTypes";
3
- declare type colorLegendProps = {
3
+ interface colorLegendProps {
4
4
  discreteData: {
5
5
  objects: Record<string, [number[], number]>;
6
6
  };
@@ -10,7 +10,7 @@ declare type colorLegendProps = {
10
10
  colorTables: colorTablesArray | string;
11
11
  horizontal?: boolean | null;
12
12
  updateLegend?: any;
13
- };
13
+ }
14
14
  export declare const DiscreteColorLegend: React.FC<colorLegendProps>;
15
15
  export declare function colorTableData(colorName: string, colorTables: colorTablesArray): [number, number, number, number][];
16
16
  export declare function RGBToHex(rgb: number[]): string;