@emerson-eps/color-tables 0.2.4 → 0.2.5
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/.vscode/settings.json +3 -0
- package/dist/component/ColorSelector/ColorSelectorAccordion.js +1 -1
- package/dist/component/ColorSelector/ColorSelectorAccordion.js.map +1 -1
- package/dist/component/ColorSelector/ColorSelectorComponent.js +46 -45
- package/dist/component/ColorSelector/ColorSelectorComponent.js.map +1 -1
- package/dist/component/ColorSelector/ColorSelectorWrapper.js +21 -20
- package/dist/component/ColorSelector/ColorSelectorWrapper.js.map +1 -1
- package/dist/component/Legend/ColorLegend.js +7 -6
- package/dist/component/Legend/ColorLegend.js.map +1 -1
- package/dist/component/Legend/ContinuousLegend.js +185 -147
- package/dist/component/Legend/ContinuousLegend.js.map +1 -1
- package/dist/component/Legend/DiscreteLegend.js +154 -113
- package/dist/component/Legend/DiscreteLegend.js.map +1 -1
- package/dist/component/Utils/continousLegend.js +14 -12
- package/dist/component/Utils/continousLegend.js.map +1 -1
- package/dist/component/Utils/d3ColorScale.js +1 -1
- package/dist/component/Utils/d3ColorScale.js.map +1 -1
- package/dist/component/Utils/discreteLegend.js +1 -1
- package/dist/component/Utils/discreteLegend.js.map +1 -1
- package/dist/stories/ColorLegends/ColorSelector/Selector.stories.js +2 -2
- package/dist/stories/ColorLegends/ColorSelector/Selector.stories.js.map +1 -1
- package/dist/stories/ColorLegends/ContinousLegends/MD.stories.js +27 -16
- package/dist/stories/ColorLegends/ContinousLegends/MD.stories.js.map +1 -1
- package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.js +27 -16
- package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.js.map +1 -1
- package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.js +27 -16
- package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.js.map +1 -1
- package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.js +27 -16
- package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.js.map +1 -1
- package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.js +27 -16
- package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.js.map +1 -1
- package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.js +27 -16
- package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.js.map +1 -1
- package/dist/stories/ColorLegends/ContinousLegends/SW.stories.js +27 -16
- package/dist/stories/ColorLegends/ContinousLegends/SW.stories.js.map +1 -1
- package/dist/stories/ColorLegends/DiscreteLegends/Facies.stories.js +25 -14
- package/dist/stories/ColorLegends/DiscreteLegends/Facies.stories.js.map +1 -1
- package/dist/stories/ColorLegends/DiscreteLegends/FaciesNoCalcite.stories.js +25 -14
- package/dist/stories/ColorLegends/DiscreteLegends/FaciesNoCalcite.stories.js.map +1 -1
- package/dist/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.js +25 -14
- package/dist/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.js.map +1 -1
- package/dist/stories/ColorLegends/DiscreteLegends/FaultProximityFlag.stories.js +25 -14
- package/dist/stories/ColorLegends/DiscreteLegends/FaultProximityFlag.stories.js.map +1 -1
- package/dist/stories/ColorLegends/DiscreteLegends/RDE.stories.js +25 -14
- package/dist/stories/ColorLegends/DiscreteLegends/RDE.stories.js.map +1 -1
- package/dist/stories/ColorLegends/DiscreteLegends/RDE_Orig.stories.js +25 -14
- package/dist/stories/ColorLegends/DiscreteLegends/RDE_Orig.stories.js.map +1 -1
- package/dist/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.js +25 -14
- package/dist/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.js.map +1 -1
- package/dist/stories/ColorLegends/DiscreteLegends/Zonelog.stories.js +25 -14
- package/dist/stories/ColorLegends/DiscreteLegends/Zonelog.stories.js.map +1 -1
- package/dist/stories/ColorLegends/LegendWithSelector/DiscreteLegendWithSelector.stories.js +25 -14
- package/dist/stories/ColorLegends/LegendWithSelector/DiscreteLegendWithSelector.stories.js.map +1 -1
- package/dist/stories/ColorLegends/LegendWithSelector/LegendWithSelector.stories.js +27 -16
- package/dist/stories/ColorLegends/LegendWithSelector/LegendWithSelector.stories.js.map +1 -1
- package/dist/stories/ColorLegends/SingleComponent/Single.stories.js +29 -18
- package/dist/stories/ColorLegends/SingleComponent/Single.stories.js.map +1 -1
- package/package.json +2 -1
- package/src/component/Legend/ContinuousLegend.tsx +5 -2
- package/src/component/Legend/DiscreteLegend.tsx +2 -1
- package/tsconfig.json +1 -1
|
@@ -7,17 +7,45 @@ 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
40
|
import { select } from "d3";
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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) {
|
|
22
50
|
discreteLegend();
|
|
23
51
|
}
|
|
@@ -27,111 +55,122 @@ export const DiscreteColorLegend = ({ discreteData, dataObjectName, position, co
|
|
|
27
55
|
};
|
|
28
56
|
}, [discreteData, colorName, colorTables, horizontal, updateLegend]);
|
|
29
57
|
function discreteLegend() {
|
|
30
|
-
return __awaiter(this, void 0, void 0, function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
58
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
59
|
+
var dataSet, discreteFlag, res, colorsArray_1, colorLegend, legendLength, calcLegendHeight, selectedLegend, svgLegend, totalRect, error_1;
|
|
60
|
+
return __generator(this, function (_a) {
|
|
61
|
+
switch (_a.label) {
|
|
62
|
+
case 0:
|
|
63
|
+
discreteFlag = false;
|
|
64
|
+
_a.label = 1;
|
|
65
|
+
case 1:
|
|
66
|
+
_a.trys.push([1, 5, , 6]);
|
|
67
|
+
if (!(typeof colorTables === "string")) return [3 /*break*/, 4];
|
|
68
|
+
return [4 /*yield*/, fetch(colorTables)];
|
|
69
|
+
case 2:
|
|
70
|
+
res = _a.sent();
|
|
71
|
+
return [4 /*yield*/, res.json()];
|
|
72
|
+
case 3:
|
|
73
|
+
dataSet = _a.sent();
|
|
74
|
+
_a.label = 4;
|
|
75
|
+
case 4:
|
|
76
|
+
colorsArray_1 = typeof colorTables === "string" ?
|
|
77
|
+
colorTableData(colorName, dataSet)
|
|
78
|
+
:
|
|
79
|
+
colorTableData(colorName, colorTables);
|
|
80
|
+
// Main discrete legend
|
|
81
|
+
if (!updateLegend) {
|
|
82
|
+
Object.keys(discreteData).forEach(function (key) {
|
|
83
|
+
//eslint-disable-next-line
|
|
84
|
+
var code = discreteData[key][1];
|
|
85
|
+
//compare the first value in colorarray(colortable) and code from discreteData
|
|
86
|
+
var matchedColorsArrays = colorsArray_1.find(function (value) {
|
|
87
|
+
return value[0] == code;
|
|
88
|
+
});
|
|
89
|
+
if (matchedColorsArrays)
|
|
90
|
+
itemColor.push({ color: RGBToHex(matchedColorsArrays) });
|
|
91
|
+
itemName.push(key);
|
|
92
|
+
});
|
|
93
|
+
discreteFlag = false;
|
|
94
|
+
}
|
|
95
|
+
// Discrete legend using Colortable colors
|
|
96
|
+
else if (updateLegend && updateLegend.color) {
|
|
97
|
+
// Object.keys(discreteData).forEach((key) => {
|
|
98
|
+
// //eslint-disable-next-line
|
|
99
|
+
// let code = (discreteData as { [key: string]: any })[key][1]
|
|
100
|
+
// //compare the first value in colorarray(colortable) and code from discreteData
|
|
101
|
+
// const matchedColorsArrays = updateLegend.color.find((value: number[]) => {
|
|
102
|
+
// return value[0] == code;
|
|
103
|
+
// });
|
|
104
|
+
// if (matchedColorsArrays) {
|
|
105
|
+
// testColor.push({color: RGBToHex(matchedColorsArrays)});
|
|
106
|
+
// testName.push(key);
|
|
107
|
+
// }
|
|
108
|
+
// });
|
|
109
|
+
//let color = updateLegend;
|
|
110
|
+
updateLegend.color.forEach(function (key) {
|
|
111
|
+
testColor.push({ color: RGBToHex(key) });
|
|
112
|
+
});
|
|
113
|
+
itemColor = testColor;
|
|
114
|
+
itemName = testName;
|
|
115
|
+
discreteFlag = true;
|
|
116
|
+
}
|
|
117
|
+
// Discrete legend using d3 colors
|
|
118
|
+
else {
|
|
119
|
+
updateLegend.colorsObject.forEach(function (key) {
|
|
120
|
+
itemColor.push({ color: key });
|
|
121
|
+
});
|
|
122
|
+
itemColor = itemColor;
|
|
123
|
+
itemName = updateLegend.legendColorName;
|
|
124
|
+
discreteFlag = true;
|
|
125
|
+
}
|
|
126
|
+
colorLegend = discreteLegendUtil(itemColor, discreteFlag);
|
|
127
|
+
legendLength = itemColor.length;
|
|
128
|
+
calcLegendHeight = 22 * legendLength + 4 * legendLength;
|
|
129
|
+
selectedLegend = select(divRef.current);
|
|
130
|
+
selectedLegend
|
|
131
|
+
.append("div")
|
|
132
|
+
.text(dataObjectName)
|
|
133
|
+
.attr("y", 10)
|
|
134
|
+
.style("margin-bottom", "5px");
|
|
135
|
+
if (horizontal && !discreteFlag)
|
|
136
|
+
selectedLegend.style("height", 150 + "px");
|
|
137
|
+
svgLegend = selectedLegend
|
|
138
|
+
.style("margin-right", "41px")
|
|
139
|
+
.style("margin-top", "5px")
|
|
140
|
+
.append("svg")
|
|
141
|
+
.call(colorLegend);
|
|
142
|
+
if (colorLegend && !horizontal) {
|
|
143
|
+
svgLegend
|
|
144
|
+
.attr("height", calcLegendHeight + "px")
|
|
145
|
+
.attr("width", 220 + "px");
|
|
146
|
+
}
|
|
147
|
+
else if (!discreteFlag && horizontal) {
|
|
148
|
+
svgLegend
|
|
149
|
+
.style("transform", "rotate(90deg)")
|
|
150
|
+
.attr("height", calcLegendHeight + "px")
|
|
151
|
+
.attr("width", calcLegendHeight + "px");
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
if (updateLegend.color) {
|
|
155
|
+
totalRect = updateLegend.color.length;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
totalRect = updateLegend.colorsObject.length;
|
|
159
|
+
}
|
|
160
|
+
svgLegend.attr("viewBox", "0 0 ".concat(totalRect, " 2"))
|
|
161
|
+
.attr("preserveAspectRatio", "none")
|
|
162
|
+
.style("font-size", ".5")
|
|
163
|
+
.attr("height", "50px")
|
|
164
|
+
.attr("width", "150px");
|
|
165
|
+
}
|
|
166
|
+
return [3 /*break*/, 6];
|
|
167
|
+
case 5:
|
|
168
|
+
error_1 = _a.sent();
|
|
169
|
+
console.error(error_1);
|
|
170
|
+
return [3 /*break*/, 6];
|
|
171
|
+
case 6: return [2 /*return*/];
|
|
88
172
|
}
|
|
89
|
-
|
|
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
|
-
}
|
|
173
|
+
});
|
|
135
174
|
});
|
|
136
175
|
}
|
|
137
176
|
return (React.createElement("div", { style: {
|
|
@@ -145,11 +184,13 @@ export const DiscreteColorLegend = ({ discreteData, dataObjectName, position, co
|
|
|
145
184
|
};
|
|
146
185
|
// Based on name return the colors array from color.tables.json file
|
|
147
186
|
export function colorTableData(colorName, colorTables) {
|
|
148
|
-
|
|
187
|
+
var colorTableData = colorTables.filter(function (value) {
|
|
188
|
+
return value.name.toLowerCase() == colorName.toLowerCase();
|
|
189
|
+
});
|
|
149
190
|
return colorTableData.length > 0 ? colorTableData[0].colors : [];
|
|
150
191
|
}
|
|
151
192
|
export function RGBToHex(rgb) {
|
|
152
|
-
|
|
193
|
+
var r = rgb[1].toString(16), g = rgb[2].toString(16), b = rgb[3].toString(16);
|
|
153
194
|
if (r.length == 1)
|
|
154
195
|
r = "0" + r;
|
|
155
196
|
if (g.length == 1)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiscreteLegend.js","sourceRoot":"","sources":["../../../src/component/Legend/DiscreteLegend.tsx"],"names":[],"mappings":"
|
|
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,IAAM,mBAAmB,GAA+B,UAAC,EAQ7C;QAPf,YAAY,kBAAA,EACZ,cAAc,oBAAA,EACd,QAAQ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AAC,CAAC,CAAC,EAAE,CAAC;AACrE,CAAC;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
|
-
|
|
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
|
-
|
|
13
|
+
var colorTableColors = colorsArray(colorName, colorTables);
|
|
12
14
|
// compare the point and first value from colorTableColors
|
|
13
|
-
|
|
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
|
-
|
|
25
|
+
var index = colorTableColors.findIndex(function (value) {
|
|
24
26
|
return value[0] > point;
|
|
25
27
|
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
var firstColorArray = colorTableColors[index - 1];
|
|
29
|
+
var secondColorArray = colorTableColors[index];
|
|
28
30
|
if ((firstColorArray || secondColorArray) != undefined) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
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,IAAM,cAAc,GAAG,WAAW,CAAC,MAAM,CACrC,UAAC,KAAqB;QAClB,OAAA,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,SAAS,CAAC,WAAW,EAAE;IAAnD,CAAmD,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,IAAM,gBAAgB,GAAG,WAAW,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAC7D,0DAA0D;IAC1D,IAAM,WAAW,GAAG,gBAAgB,CAAC,IAAI,CACrC,UAAC,KAAuC;QACpC,OAAO,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC,CACJ,CAAC;IAEF,0EAA0E;IAC1E,IAAI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CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACxC,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,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 +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,
|
|
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,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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,"file":"discreteLegend.js","sourceRoot":"","sources":["../../../src/component/Utils/discreteLegend.ts"],"names":[],"mappings":"AAIA,2BAA2B;AAC3B,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,SAAsB,EAAE,gBAA0B;IACzF,IAAI,SAAS,GAAG,EAAE,CAAC;IACnB,IAAI,UAAU,GAAG,EAAE,CAAC;IACpB,
|
|
1
|
+
{"version":3,"file":"discreteLegend.js","sourceRoot":"","sources":["../../../src/component/Utils/discreteLegend.ts"],"names":[],"mappings":"AAIA,2BAA2B;AAC3B,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,SAAsB,EAAE,gBAA0B;IACzF,IAAI,SAAS,GAAG,EAAE,CAAC;IACnB,IAAI,UAAU,GAAG,EAAE,CAAC;IACpB,IAAM,WAAW,GAAG,CAAC,CAAC;IAEtB,IAAI,gBAAgB,EAAE;QAClB,SAAS,GAAG,EAAE,CAAC;QACf,UAAU,GAAG,EAAE,CAAC;KACnB;IAED,qCAAqC;IAErC,2BAA2B;IAC3B,SAAS,MAAM,CAAC,CAAM;QAClB,SAAS,UAAU;YACf,yBAAyB;YACzB,oCAAoC;YACpC,IAAI,gBAAgB,EAAE;gBAClB,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC;qBACvB,IAAI,CAAC,SAAS,CAAC;qBACf,KAAK,EAAE;qBACP,MAAM,CAAC,GAAG,CAAC;qBACX,MAAM,CAAC,MAAM,CAAC,CAAC;gBACpB,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC;qBACd,IAAI,CAAC,GAAG,EAAE,UAAU,CAAS,EAAE,CAAM;oBAClC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;oBACd,OAAO,CAAC,CAAC;gBACb,CAAC,CAAC;qBACD,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;qBACZ,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;qBACjB,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;qBAChB,KAAK,CAA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AAC;gBACN,CAAC,CACJ,CAAC;aACL;QACL,CAAC;QAED,8BAA8B;QAC9B,IAAI,CAAC,gBAAgB,EAAE;YACnB,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC;iBAC3B,IAAI,CAAC,SAAS,CAAC;iBACf,KAAK,EAAE;iBACP,MAAM,CAAC,GAAG,CAAC;iBACX,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,CAAA;SAChC;QAED,UAAU,EAAE,CAAC;IACjB,CAAC;IACD,2BAA2B;IAC3B,iDAAiD;IACjD,kCAAkC;IAClC,2BAA2B;IAC3B,wBAAwB;IAExB,kDAAkD;IAClD,8DAA8D;IAC9D,yCAAyC;IACzC,UAAU;IACV,mBAAmB;IACnB,KAAK;IAEL,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -4,8 +4,8 @@ export default {
|
|
|
4
4
|
component: ColorSelectorAccordion,
|
|
5
5
|
title: "Legends/ColorSelector",
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
var Template = function (args) {
|
|
8
8
|
return React.createElement(ColorSelectorAccordion, null);
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export var selectorTemplate = Template.bind({});
|
|
11
11
|
//# sourceMappingURL=Selector.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selector.stories.js","sourceRoot":"","sources":["../../../../src/stories/ColorLegends/ColorSelector/Selector.stories.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,yDAAyD,CAAC;AACjG,eAAe;IACX,SAAS,EAAE,sBAAsB;IACjC,KAAK,EAAE,uBAAuB;CACjC,CAAC;AAEF,
|
|
1
|
+
{"version":3,"file":"Selector.stories.js","sourceRoot":"","sources":["../../../../src/stories/ColorLegends/ColorSelector/Selector.stories.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,yDAAyD,CAAC;AACjG,eAAe;IACX,SAAS,EAAE,sBAAsB;IACjC,KAAK,EAAE,uBAAuB;CACjC,CAAC;AAEF,IAAM,QAAQ,GAAG,UAAC,IAAI;IAClB,OAAO,oBAAC,sBAAsB,OAAG,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,gBAAgB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
import React from "react";
|
|
2
13
|
import { ContinuousLegend } from "../../../component/Legend/ContinuousLegend";
|
|
3
14
|
export default {
|
|
@@ -5,23 +16,23 @@ export default {
|
|
|
5
16
|
title: "Legends/ContinousLegend",
|
|
6
17
|
};
|
|
7
18
|
import colorTables from "../../../component/color-tables.json";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return React.createElement(ContinuousLegend,
|
|
19
|
+
var min = 2918;
|
|
20
|
+
var max = 4770;
|
|
21
|
+
var dataObjectName = "Wells / MD";
|
|
22
|
+
var position = [16, 10];
|
|
23
|
+
var horizontal = true;
|
|
24
|
+
var colorName = "Time/Depth";
|
|
25
|
+
var Template = function (args) {
|
|
26
|
+
return React.createElement(ContinuousLegend, __assign({}, args));
|
|
16
27
|
};
|
|
17
|
-
export
|
|
28
|
+
export var MDTemplate = Template.bind({});
|
|
18
29
|
MDTemplate.args = {
|
|
19
|
-
min,
|
|
20
|
-
max,
|
|
21
|
-
dataObjectName,
|
|
22
|
-
position,
|
|
23
|
-
colorName,
|
|
24
|
-
colorTables,
|
|
25
|
-
horizontal,
|
|
30
|
+
min: min,
|
|
31
|
+
max: max,
|
|
32
|
+
dataObjectName: dataObjectName,
|
|
33
|
+
position: position,
|
|
34
|
+
colorName: colorName,
|
|
35
|
+
colorTables: colorTables,
|
|
36
|
+
horizontal: horizontal,
|
|
26
37
|
};
|
|
27
38
|
//# sourceMappingURL=MD.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MD.stories.js","sourceRoot":"","sources":["../../../../src/stories/ColorLegends/ContinousLegends/MD.stories.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAC;AAC5E,eAAe;IACX,SAAS,EAAE,gBAAgB;IAC3B,KAAK,EAAE,yBAAyB;CACnC,CAAC;AACF,OAAO,WAAW,MAAM,sCAAsC,CAAC;AAE/D,
|
|
1
|
+
{"version":3,"file":"MD.stories.js","sourceRoot":"","sources":["../../../../src/stories/ColorLegends/ContinousLegends/MD.stories.jsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAC;AAC5E,eAAe;IACX,SAAS,EAAE,gBAAgB;IAC3B,KAAK,EAAE,yBAAyB;CACnC,CAAC;AACF,OAAO,WAAW,MAAM,sCAAsC,CAAC;AAE/D,IAAM,GAAG,GAAG,IAAI,CAAC;AACjB,IAAM,GAAG,GAAG,IAAI,CAAC;AACjB,IAAM,cAAc,GAAG,YAAY,CAAC;AACpC,IAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC1B,IAAM,UAAU,GAAG,IAAI,CAAC;AACxB,IAAM,SAAS,GAAG,YAAY,CAAC;AAE/B,IAAM,QAAQ,GAAG,UAAC,IAAI;IAClB,OAAO,oBAAC,gBAAgB,eAAK,IAAI,EAAI,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5C,UAAU,CAAC,IAAI,GAAG;IACd,GAAG,KAAA;IACH,GAAG,KAAA;IACH,cAAc,gBAAA;IACd,QAAQ,UAAA;IACR,SAAS,WAAA;IACT,WAAW,aAAA;IACX,UAAU,YAAA;CACb,CAAC"}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
import React from "react";
|
|
2
13
|
import { ContinuousLegend } from "../../../component/Legend/ContinuousLegend";
|
|
3
14
|
export default {
|
|
@@ -5,23 +16,23 @@ export default {
|
|
|
5
16
|
title: "Legends/ContinousLegend",
|
|
6
17
|
};
|
|
7
18
|
import colorTables from "../../../component/color-tables.json";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return React.createElement(ContinuousLegend,
|
|
19
|
+
var min = 0;
|
|
20
|
+
var max = 1;
|
|
21
|
+
var dataObjectName = "Wells / NTG";
|
|
22
|
+
var position = [16, 10];
|
|
23
|
+
var horizontal = true;
|
|
24
|
+
var colorName = "Rainbow";
|
|
25
|
+
var Template = function (args) {
|
|
26
|
+
return React.createElement(ContinuousLegend, __assign({}, args));
|
|
16
27
|
};
|
|
17
|
-
export
|
|
28
|
+
export var NTGTemplate = Template.bind({});
|
|
18
29
|
NTGTemplate.args = {
|
|
19
|
-
min,
|
|
20
|
-
max,
|
|
21
|
-
dataObjectName,
|
|
22
|
-
position,
|
|
23
|
-
colorName,
|
|
24
|
-
colorTables,
|
|
25
|
-
horizontal,
|
|
30
|
+
min: min,
|
|
31
|
+
max: max,
|
|
32
|
+
dataObjectName: dataObjectName,
|
|
33
|
+
position: position,
|
|
34
|
+
colorName: colorName,
|
|
35
|
+
colorTables: colorTables,
|
|
36
|
+
horizontal: horizontal,
|
|
26
37
|
};
|
|
27
38
|
//# sourceMappingURL=NTG.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NTG.stories.js","sourceRoot":"","sources":["../../../../src/stories/ColorLegends/ContinousLegends/NTG.stories.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAC;AAC5E,eAAe;IACX,SAAS,EAAE,gBAAgB;IAC3B,KAAK,EAAE,yBAAyB;CACnC,CAAC;AACF,OAAO,WAAW,MAAM,sCAAsC,CAAC;AAE/D,
|
|
1
|
+
{"version":3,"file":"NTG.stories.js","sourceRoot":"","sources":["../../../../src/stories/ColorLegends/ContinousLegends/NTG.stories.jsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAC;AAC5E,eAAe;IACX,SAAS,EAAE,gBAAgB;IAC3B,KAAK,EAAE,yBAAyB;CACnC,CAAC;AACF,OAAO,WAAW,MAAM,sCAAsC,CAAC;AAE/D,IAAM,GAAG,GAAG,CAAC,CAAC;AACd,IAAM,GAAG,GAAG,CAAC,CAAC;AACd,IAAM,cAAc,GAAG,aAAa,CAAC;AACrC,IAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC1B,IAAM,UAAU,GAAG,IAAI,CAAC;AACxB,IAAM,SAAS,GAAG,SAAS,CAAC;AAE5B,IAAM,QAAQ,GAAG,UAAC,IAAI;IAClB,OAAO,oBAAC,gBAAgB,eAAK,IAAI,EAAI,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC7C,WAAW,CAAC,IAAI,GAAG;IACf,GAAG,KAAA;IACH,GAAG,KAAA;IACH,cAAc,gBAAA;IACd,QAAQ,UAAA;IACR,SAAS,WAAA;IACT,WAAW,aAAA;IACX,UAAU,YAAA;CACb,CAAC"}
|