@emerson-eps/color-tables 0.2.10 → 0.2.13
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/dist/component/ColorSelector/ColorSelectorAccordion.js +2 -2
- package/dist/component/ColorSelector/ColorSelectorAccordion.js.map +1 -1
- package/dist/component/ColorSelector/ColorSelectorComponent.d.ts +0 -3
- package/dist/component/ColorSelector/ColorSelectorComponent.js +5 -15
- package/dist/component/ColorSelector/ColorSelectorComponent.js.map +1 -1
- package/dist/component/ColorSelector/ColorSelectorWrapper.d.ts +0 -1
- package/dist/component/ColorSelector/ColorSelectorWrapper.js +13 -12
- package/dist/component/ColorSelector/ColorSelectorWrapper.js.map +1 -1
- package/dist/component/Legend/ColorLegend.js +11 -3
- package/dist/component/Legend/ColorLegend.js.map +1 -1
- package/dist/component/Legend/ContinuousLegend.d.ts +1 -1
- package/dist/component/Legend/ContinuousLegend.js +18 -4
- package/dist/component/Legend/ContinuousLegend.js.map +1 -1
- package/dist/component/Legend/DiscreteLegend.d.ts +1 -2
- package/dist/component/Legend/DiscreteLegend.js +31 -34
- package/dist/component/Legend/DiscreteLegend.js.map +1 -1
- package/dist/component/{ColorTableTypes.d.ts → Utils/ColorTableTypes.d.ts} +0 -0
- package/dist/component/{ColorTableTypes.js → Utils/ColorTableTypes.js} +0 -0
- package/dist/component/Utils/ColorTableTypes.js.map +1 -0
- package/dist/component/Utils/continousLegend.d.ts +2 -2
- package/dist/component/Utils/continousLegend.js.map +1 -1
- package/dist/component/Utils/discreteLegend.js +9 -78
- package/dist/component/Utils/discreteLegend.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/stories/ColorLegends/{SingleComponent/Single.stories.d.ts → LegendWithSelector/LegendSelector.stories.d.ts} +1 -1
- package/dist/stories/ColorLegends/{SingleComponent/Single.stories.js → LegendWithSelector/LegendSelector.stories.js} +5 -5
- package/dist/stories/ColorLegends/LegendWithSelector/LegendSelector.stories.js.map +1 -0
- package/package.json +1 -1
- package/src/component/ColorSelector/ColorSelectorAccordion.tsx +2 -2
- package/src/component/ColorSelector/ColorSelectorComponent.tsx +5 -22
- package/src/component/ColorSelector/ColorSelectorWrapper.tsx +49 -48
- package/src/component/Legend/ColorLegend.tsx +20 -3
- package/src/component/Legend/ContinuousLegend.tsx +18 -5
- package/src/component/Legend/DiscreteLegend.tsx +36 -67
- package/src/component/{ColorTableTypes.ts → Utils/ColorTableTypes.ts} +0 -0
- package/src/component/Utils/continousLegend.ts +3 -3
- package/src/component/Utils/discreteLegend.ts +9 -83
- package/src/index.ts +2 -3
- package/src/stories/ColorLegends/{SingleComponent/Single.stories.jsx → LegendWithSelector/LegendSelector.stories.jsx} +4 -4
- package/tsconfig.json +2 -2
- package/dist/component/ColorTableTypes.js.map +0 -1
- package/dist/stories/ColorLegends/LegendWithSelector/DiscreteLegendWithSelector.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/LegendWithSelector/DiscreteLegendWithSelector.stories.js +0 -52
- package/dist/stories/ColorLegends/LegendWithSelector/DiscreteLegendWithSelector.stories.js.map +0 -1
- package/dist/stories/ColorLegends/LegendWithSelector/LegendWithSelector.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/LegendWithSelector/LegendWithSelector.stories.js +0 -38
- package/dist/stories/ColorLegends/LegendWithSelector/LegendWithSelector.stories.js.map +0 -1
- package/dist/stories/ColorLegends/SingleComponent/Single.stories.js.map +0 -1
- package/src/stories/ColorLegends/LegendWithSelector/DiscreteLegendWithSelector.stories.jsx +0 -44
- package/src/stories/ColorLegends/LegendWithSelector/LegendWithSelector.stories.jsx +0 -30
|
@@ -16,12 +16,12 @@ export var ColorSelectorAccordion = function (props) {
|
|
|
16
16
|
React.createElement(Accordion.Item, null,
|
|
17
17
|
React.createElement(Accordion.Header, null, "Geologic Color Scale"),
|
|
18
18
|
React.createElement(Accordion.Panel, null,
|
|
19
|
-
React.createElement(ColorSelectorWrapper, { useColorTableColors: true,
|
|
19
|
+
React.createElement(ColorSelectorWrapper, { useColorTableColors: true, colorScaleObject: props })))),
|
|
20
20
|
React.createElement(Accordion, null,
|
|
21
21
|
React.createElement(Accordion.Item, null,
|
|
22
22
|
React.createElement(Accordion.Header, null, "D3 Color Scale"),
|
|
23
23
|
React.createElement(Accordion.Panel, null,
|
|
24
|
-
React.createElement(ColorSelectorWrapper, {
|
|
24
|
+
React.createElement(ColorSelectorWrapper, { useColorTableColors: false, colorScaleObject: props })))),
|
|
25
25
|
React.createElement(Accordion, null,
|
|
26
26
|
React.createElement(Accordion.Item, null,
|
|
27
27
|
React.createElement(Accordion.Header, null, "Custom Color Scale"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorSelectorAccordion.js","sourceRoot":"","sources":["../../../src/component/ColorSelector/ColorSelectorAccordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAG,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,CAAC,IAAM,sBAAsB,GAAG,UAAC,KAAU;IAC7C,OAAO,CACH,6BAAK,SAAS,EAAC,WAAW,EAAC,KAAK,EAAE,EAAC,KAAK,EAAE,OAAO;YACjD,QAAQ,EAAE,UAAU;YACpB,MAAM,EAAE,CAAC;YACT,GAAG,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;YAClC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;SAClC;QACG,oBAAC,SAAS;YACN,oBAAC,SAAS,CAAC,IAAI,IAAC,UAAU;gBACtB,oBAAC,SAAS,CAAC,MAAM,uBAEE;gBACnB,oBAAC,SAAS,CAAC,KAAK;oBACZ,oBAAC,SAAS;wBACN,oBAAC,SAAS,CAAC,IAAI;4BACX,oBAAC,SAAS,CAAC,MAAM,+BAEE;4BACnB,oBAAC,SAAS,CAAC,KAAK;gCACZ,oBAAC,oBAAoB,IAAC,mBAAmB,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"ColorSelectorAccordion.js","sourceRoot":"","sources":["../../../src/component/ColorSelector/ColorSelectorAccordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAG,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,CAAC,IAAM,sBAAsB,GAAG,UAAC,KAAU;IAC7C,OAAO,CACH,6BAAK,SAAS,EAAC,WAAW,EAAC,KAAK,EAAE,EAAC,KAAK,EAAE,OAAO;YACjD,QAAQ,EAAE,UAAU;YACpB,MAAM,EAAE,CAAC;YACT,GAAG,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;YAClC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;SAClC;QACG,oBAAC,SAAS;YACN,oBAAC,SAAS,CAAC,IAAI,IAAC,UAAU;gBACtB,oBAAC,SAAS,CAAC,MAAM,uBAEE;gBACnB,oBAAC,SAAS,CAAC,KAAK;oBACZ,oBAAC,SAAS;wBACN,oBAAC,SAAS,CAAC,IAAI;4BACX,oBAAC,SAAS,CAAC,MAAM,+BAEE;4BACnB,oBAAC,SAAS,CAAC,KAAK;gCACZ,oBAAC,oBAAoB,IAAC,mBAAmB,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,GAAG,CAC7D,CACL,CACT;oBACZ,oBAAC,SAAS;wBACN,oBAAC,SAAS,CAAC,IAAI;4BACX,oBAAC,SAAS,CAAC,MAAM,yBAEE;4BACnB,oBAAC,SAAS,CAAC,KAAK;gCACZ,oBAAC,oBAAoB,IAAC,mBAAmB,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,GAAG,CAC9D,CACL,CACT;oBACZ,oBAAC,SAAS;wBACN,oBAAC,SAAS,CAAC,IAAI;4BACX,oBAAC,SAAS,CAAC,MAAM,6BAEE;4BACnB,oBAAC,SAAS,CAAC,KAAK,yBAEE,CACL,CACT,CACE,CACL,CACT,CACV,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { colorTablesArray } from "../ColorTableTypes";
|
|
3
2
|
declare type legendProps = {
|
|
4
3
|
position: number[];
|
|
5
4
|
colorsObject?: any;
|
|
@@ -9,8 +8,6 @@ declare type legendProps = {
|
|
|
9
8
|
useDiscColorTable?: boolean;
|
|
10
9
|
valueIndex?: any;
|
|
11
10
|
colorScaleData: any;
|
|
12
|
-
getColorMapname?: any | null;
|
|
13
11
|
};
|
|
14
12
|
export declare const ColorSelectorComponent: React.FC<legendProps>;
|
|
15
|
-
export declare function colorTableData(colorName: string, colorTables: colorTablesArray): [number, number, number, number][];
|
|
16
13
|
export {};
|
|
@@ -7,9 +7,7 @@ import * as d3 from "d3";
|
|
|
7
7
|
import discreteLegendUtil from "../Utils/discreteLegend";
|
|
8
8
|
import { color } from "d3-color";
|
|
9
9
|
export var ColorSelectorComponent = function (_a) {
|
|
10
|
-
var
|
|
11
|
-
// position,
|
|
12
|
-
colorsObject = _a.colorsObject, legendColor = _a.legendColor, legendColorName = _a.legendColorName, useContColorTable = _a.useContColorTable, useDiscColorTable = _a.useDiscColorTable, valueIndex = _a.valueIndex, colorScaleData = _a.colorScaleData;
|
|
10
|
+
var colorsObject = _a.colorsObject, legendColor = _a.legendColor, legendColorName = _a.legendColorName, useContColorTable = _a.useContColorTable, useDiscColorTable = _a.useDiscColorTable, valueIndex = _a.valueIndex, colorScaleData = _a.colorScaleData;
|
|
13
11
|
var divRef = useRef(null);
|
|
14
12
|
// create an array of steps based on the color scale
|
|
15
13
|
// returns an array of evenly-spaced numbers. Returns the integers from zero to the specified end minus one.
|
|
@@ -27,7 +25,7 @@ export var ColorSelectorComponent = function (_a) {
|
|
|
27
25
|
var handleChange = React.useCallback(function () {
|
|
28
26
|
// continous legend with colortable colors
|
|
29
27
|
if (colorsObject && Object.keys(colorsObject).length > 0 && useContColorTable) {
|
|
30
|
-
colorScaleData(colorsObject, true);
|
|
28
|
+
colorScaleData ? colorScaleData(colorsObject, true) : null;
|
|
31
29
|
}
|
|
32
30
|
// continous legend with d3 colors
|
|
33
31
|
else if (data && !useContColorTable) {
|
|
@@ -36,15 +34,15 @@ export var ColorSelectorComponent = function (_a) {
|
|
|
36
34
|
var _a, _b, _c;
|
|
37
35
|
arrayData_1.push([0 + "." + colorsObject.value, (_a = color(colorsObject.color)) === null || _a === void 0 ? void 0 : _a.rgb().r, (_b = color(colorsObject.color)) === null || _b === void 0 ? void 0 : _b.rgb().g, (_c = color(colorsObject.color)) === null || _c === void 0 ? void 0 : _c.rgb().b]);
|
|
38
36
|
});
|
|
39
|
-
colorScaleData({ arrayData: arrayData_1, legendColorName: legendColorName }, true);
|
|
37
|
+
colorScaleData ? colorScaleData({ arrayData: arrayData_1, legendColorName: legendColorName }, true) : null;
|
|
40
38
|
}
|
|
41
39
|
// discrete legend with colortable colors
|
|
42
40
|
else if (colorsObject && Object.keys(colorsObject).length > 0 && useDiscColorTable) {
|
|
43
|
-
colorScaleData(colorsObject, false);
|
|
41
|
+
colorScaleData ? colorScaleData(colorsObject, false) : null;
|
|
44
42
|
}
|
|
45
43
|
// discrete legend with d3 colors
|
|
46
44
|
else {
|
|
47
|
-
colorScaleData({ colorsObject: colorsObject, legendColorName: legendColorName }, false);
|
|
45
|
+
colorScaleData ? colorScaleData({ colorsObject: colorsObject, legendColorName: legendColorName }, false) : null;
|
|
48
46
|
}
|
|
49
47
|
}, []);
|
|
50
48
|
React.useEffect(function () {
|
|
@@ -125,7 +123,6 @@ export var ColorSelectorComponent = function (_a) {
|
|
|
125
123
|
.attr("y", 15)
|
|
126
124
|
.style("font-size", "smaller")
|
|
127
125
|
.style("font-weight", "900")
|
|
128
|
-
// .attr("textLength","5em")
|
|
129
126
|
.text(colorsObject.name);
|
|
130
127
|
// draw the rectangle and fill with gradient
|
|
131
128
|
svgLegend
|
|
@@ -261,11 +258,4 @@ export var ColorSelectorComponent = function (_a) {
|
|
|
261
258
|
return (React.createElement("div", null,
|
|
262
259
|
React.createElement("div", { id: "legend", style: { height: 30 }, ref: divRef, onClick: handleChange })));
|
|
263
260
|
};
|
|
264
|
-
// Based on name return the colors array from color.tables.json file
|
|
265
|
-
export function colorTableData(colorName, colorTables) {
|
|
266
|
-
var colorTableData = colorTables.filter(function (value) {
|
|
267
|
-
return value.name.toLowerCase() == colorName.toLowerCase();
|
|
268
|
-
});
|
|
269
|
-
return colorTableData.length > 0 ? colorTableData[0].colors : [];
|
|
270
|
-
}
|
|
271
261
|
//# sourceMappingURL=ColorSelectorComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorSelectorComponent.js","sourceRoot":"","sources":["../../../src/component/ColorSelector/ColorSelectorComponent.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,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAC,MAAM,IAAI,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"ColorSelectorComponent.js","sourceRoot":"","sources":["../../../src/component/ColorSelector/ColorSelectorComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,E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ACH;QACI,6BAAK,EAAE,EAAC,QAAQ,EAAC,KAAK,EAAE,EAAC,MAAM,EAAE,EAAE,EAAC,EAChC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAQ,CAC5C,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
2
|
+
var colorTables = require("../color-tables.json");
|
|
3
3
|
import { d3ColorScales } from "../Utils/d3ColorScale";
|
|
4
4
|
import { ColorSelectorComponent } from "./ColorSelectorComponent";
|
|
5
5
|
var position = [16, 206];
|
|
@@ -36,11 +36,20 @@ d3discreteData.forEach(function (element) {
|
|
|
36
36
|
discreteD3ColorData.push({ color: element.colors, name: element.name });
|
|
37
37
|
});
|
|
38
38
|
export var ColorSelectorWrapper = function (_a) {
|
|
39
|
-
var useColorTableColors = _a.useColorTableColors,
|
|
39
|
+
var useColorTableColors = _a.useColorTableColors, colorScaleObject = _a.colorScaleObject;
|
|
40
40
|
var continuousLegend;
|
|
41
41
|
var discreteLegend;
|
|
42
|
+
// return continuous and discrete legend which uses d3 data
|
|
43
|
+
if (!useColorTableColors) {
|
|
44
|
+
continuousLegend = continuosD3ColorData.map(function (val, key) {
|
|
45
|
+
return React.createElement(ColorSelectorComponent, { position: position + key, legendColor: val.color, legendColorName: val.name, useContColorTable: false, valueIndex: key + "0", colorScaleData: colorScaleObject.colorScaleObject });
|
|
46
|
+
});
|
|
47
|
+
discreteLegend = d3discreteData.map(function (val, key) {
|
|
48
|
+
return React.createElement(ColorSelectorComponent, { position: position + key, colorsObject: val.colors, legendColorName: val.name, useDiscColorTable: false, colorScaleData: colorScaleObject.colorScaleObject });
|
|
49
|
+
});
|
|
50
|
+
}
|
|
42
51
|
// return continuous and discrete legend which uses colortable data
|
|
43
|
-
if (useColorTableColors) {
|
|
52
|
+
else if (useColorTableColors) {
|
|
44
53
|
continuousLegend = continuosColorData.map(function (value, key) {
|
|
45
54
|
return React.createElement("div", null,
|
|
46
55
|
React.createElement(ColorSelectorComponent, { position: position + key, colorsObject: value, useContColorTable: true, valueIndex: key, colorScaleData: colorScaleObject.colorScaleObject }));
|
|
@@ -49,15 +58,7 @@ export var ColorSelectorWrapper = function (_a) {
|
|
|
49
58
|
return React.createElement(ColorSelectorComponent, { position: position + key, colorsObject: discreteColorData[key], legendColorName: val.name, useDiscColorTable: true, colorScaleData: colorScaleObject.colorScaleObject });
|
|
50
59
|
});
|
|
51
60
|
}
|
|
52
|
-
//
|
|
53
|
-
if (useD3Colors) {
|
|
54
|
-
continuousLegend = continuosD3ColorData.map(function (val, key) {
|
|
55
|
-
return React.createElement(ColorSelectorComponent, { position: position + key, legendColor: val.color, legendColorName: val.name, useContColorTable: false, valueIndex: key + "0", colorScaleData: colorScaleObject.colorScaleObject });
|
|
56
|
-
});
|
|
57
|
-
discreteLegend = d3discreteData.map(function (val, key) {
|
|
58
|
-
return React.createElement(ColorSelectorComponent, { position: position + key, colorsObject: val.colors, legendColorName: val.name, useDiscColorTable: false, colorScaleData: colorScaleObject.colorScaleObject });
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
+
//}
|
|
61
62
|
return (React.createElement("div", { className: "legendWrapper", style: { height: 200, overflow: "auto", display: "flex", flexDirection: "column", overflowX: "hidden" } },
|
|
62
63
|
continuousLegend,
|
|
63
64
|
discreteLegend));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorSelectorWrapper.js","sourceRoot":"","sources":["../../../src/component/ColorSelector/ColorSelectorWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,
|
|
1
|
+
{"version":3,"file":"ColorSelectorWrapper.js","sourceRoot":"","sources":["../../../src/component/ColorSelector/ColorSelectorWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,IAAM,WAAW,GAAG,OAAO,CAAC,sBAAsB,CAAC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AAiB,EAAE,KAAK,EACxB,cAAc,EAAE,gBAAgB,CAAC,gBAAgB,GACnD,CAAA;QACd,CAAC,CAAC,CAAC;KACN;IAED,mEAAmE;SAC9D,IAAI,mBAAmB,EAAE;QAC1B,gBAAgB,GAAI,kBAAkB,CAAC,GAAG,CAAC,UAAC,KAAU,EAAE,GAAQ;YAC5D,OAAO;gBACK,oBAAC,sBAAsB,IACnB,QAAQ,EAAE,QAAQ,GAAG,GAAG,EACxB,YAAY,EAAE,KAAK,EACnB,iBAAiB,EAAE,IAAI,EACvB,UAAU,EAAE,GAAG,EACf,cAAc,EAAE,gBAAgB,CAAC,gBAAgB,GACnD,CACJ,CAAA;QACd,CAAC,CAAC,CAAC;QAEH,cAAc,GAAG,iBAAiB,CAAC,GAAG,CAAC,UAAC,GAAQ,EAAE,GAAQ;YACtD,OAAO,oBAAC,sBAAsB,IAClB,QAAQ,EAAE,QAAQ,GAAG,GAAG,EACxB,YAAY,EAAE,iBAAiB,CAAC,GAAG,CAAC,EACpC,eAAe,EAAE,GAAG,CAAC,IAAI,EACzB,iBAAiB,EAAE,IAAI,EACvB,cAAc,EAAE,gBAAgB,CAAC,gBAAgB,GACnD,CAAA;QACd,CAAC,CAAC,CAAC;KACN;IACL,GAAG;IAEH,OAAO,CACH,6BAAK,SAAS,EAAC,eAAe,EAC1B,KAAK,EAAE,EAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAC;QAEpG,gBAAgB;QAChB,cAAc,CACb,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { DiscreteColorLegend } from "./DiscreteLegend";
|
|
|
3
3
|
import { ContinuousLegend } from "./ContinuousLegend";
|
|
4
4
|
import { useCallback } from "react";
|
|
5
5
|
import { ColorSelectorAccordion } from "../ColorSelector/ColorSelectorAccordion";
|
|
6
|
+
import { d3ColorScales } from "../Utils/d3ColorScale";
|
|
6
7
|
// Todo: Adapt it for other layers too
|
|
7
8
|
export var ColorLegend = function (_a) {
|
|
8
9
|
var position = _a.position, horizontal = _a.horizontal, colorTables = _a.colorTables, min = _a.min, max = _a.max, dataObjectName = _a.dataObjectName, colorName = _a.colorName, discreteData = _a.discreteData, getColorMapname = _a.getColorMapname;
|
|
@@ -11,7 +12,14 @@ export var ColorLegend = function (_a) {
|
|
|
11
12
|
setIsToggled(true);
|
|
12
13
|
}, []);
|
|
13
14
|
var _c = React.useState([]), updateLegend = _c[0], setUpdateLegendColor = _c[1];
|
|
14
|
-
var
|
|
15
|
+
var isColortableColors = colorTables.find(function (value) {
|
|
16
|
+
return (value === null || value === void 0 ? void 0 : value.name) == colorName;
|
|
17
|
+
});
|
|
18
|
+
var isD3Colors = d3ColorScales.find(function (value) {
|
|
19
|
+
return (value === null || value === void 0 ? void 0 : value.name) == colorName;
|
|
20
|
+
});
|
|
21
|
+
var _d = React.useState((isColortableColors || isD3Colors) &&
|
|
22
|
+
((isColortableColors === null || isColortableColors === void 0 ? void 0 : isColortableColors.discrete) == false || (isD3Colors === null || isD3Colors === void 0 ? void 0 : isD3Colors.discrete) == false) ? true : false), isCont = _d[0], setIsCont = _d[1];
|
|
15
23
|
// Get new colorscale from colorselector and update legend
|
|
16
24
|
var colorScaleObject = React.useCallback(function (data, value) {
|
|
17
25
|
// update color map layer
|
|
@@ -27,8 +35,8 @@ export var ColorLegend = function (_a) {
|
|
|
27
35
|
}, []);
|
|
28
36
|
return (React.createElement("div", null,
|
|
29
37
|
React.createElement("div", { onClick: handleClick },
|
|
30
|
-
isCont && (React.createElement(ContinuousLegend, { min: min, max: max, dataObjectName: dataObjectName, position: position, colorName: colorName, colorTables: colorTables, horizontal: horizontal, updateLegend: updateLegend })),
|
|
31
|
-
|
|
38
|
+
isCont == true && (React.createElement(ContinuousLegend, { min: min, max: max, dataObjectName: dataObjectName, position: position, colorName: colorName, colorTables: colorTables, horizontal: horizontal, updateLegend: updateLegend })),
|
|
39
|
+
isCont == false && (React.createElement(DiscreteColorLegend, { discreteData: discreteData, dataObjectName: dataObjectName, position: position, colorName: colorName, colorTables: colorTables, horizontal: horizontal, updateLegend: updateLegend }))),
|
|
32
40
|
React.createElement("div", null, isToggled && (React.createElement(ColorSelectorAccordion, { colorScaleObject: colorScaleObject, isHorizontal: horizontal })))));
|
|
33
41
|
};
|
|
34
42
|
//# sourceMappingURL=ColorLegend.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorLegend.js","sourceRoot":"","sources":["../../../src/component/Legend/ColorLegend.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAC,WAAW,EAAC,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"ColorLegend.js","sourceRoot":"","sources":["../../../src/component/Legend/ColorLegend.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAC,WAAW,EAAC,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAcpD,sCAAsC;AACtC,MAAM,CAAC,IAAM,WAAW,GAA+B,UAAC,EAUrC;QATf,QAAQ,cAAA,EACR,UAAU,gBAAA,EACV,WAAW,iBAAA,EACX,GAAG,SAAA,EACH,GAAG,SAAA,EACH,cAAc,oBAAA,EACd,SAAS,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D,gBAAgB;aACX,IAAI,eAAe,EAAE;YACtB,eAAe,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;SACzC;QACD,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAC3B,SAAS,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACH;QACI,6BAAK,OAAO,EAAE,WAAW;YACpB,MAAM,IAAI,IAAI,IAAI,CACf,oBAAC,gBAAgB,IACb,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,GAC5B,CACL;YACA,MAAM,IAAI,KAAK,IAAI,CAChB,oBAAC,mBAAmB,IAChB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,GAC5B,CACL,CACC;QACN,iCACK,SAAS,IAAI,CACV,oBAAC,sBAAsB,IAAC,gBAAgB,EAAE,gBAAgB,EAAE,YAAY,EAAE,UAAU,GAAI,CAC3F,CACC,CACJ,CAET,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -38,6 +38,9 @@ import * as React from "react";
|
|
|
38
38
|
import { useRef } from "react";
|
|
39
39
|
import { RGBToHex, colorsArray } from "../Utils/continousLegend";
|
|
40
40
|
import { select, scaleLinear, scaleSequential, axisBottom, axisRight } from "d3";
|
|
41
|
+
import { d3ColorScales } from "../Utils/d3ColorScale";
|
|
42
|
+
import { color } from "d3-color";
|
|
43
|
+
import { range } from "d3";
|
|
41
44
|
export var ContinuousLegend = function (_a) {
|
|
42
45
|
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
46
|
var divRef = useRef(null);
|
|
@@ -53,7 +56,7 @@ export var ContinuousLegend = function (_a) {
|
|
|
53
56
|
}, [min, max, colorName, colorTables, horizontal, updateLegend]);
|
|
54
57
|
function continuousLegend() {
|
|
55
58
|
return __awaiter(this, void 0, void 0, function () {
|
|
56
|
-
var itemColor, dataSet, res, legendColors, colorScale, svgLegend, defs, linearGradient, xLeg, yLeg, horizontalAxisLeg, VerticalAxisLeg, error_1;
|
|
59
|
+
var itemColor, dataSet, res, legendColors, arrayData_1, d3ColorArrays_1, data, colorScale, svgLegend, defs, linearGradient, xLeg, yLeg, horizontalAxisLeg, VerticalAxisLeg, error_1;
|
|
57
60
|
return __generator(this, function (_a) {
|
|
58
61
|
switch (_a.label) {
|
|
59
62
|
case 0:
|
|
@@ -76,7 +79,7 @@ export var ContinuousLegend = function (_a) {
|
|
|
76
79
|
colorsArray(colorName, colorTables);
|
|
77
80
|
// Update color of legend based on color selector scales
|
|
78
81
|
// data is passed on click upon color scales
|
|
79
|
-
if (updateLegend) {
|
|
82
|
+
if (updateLegend && Object.keys(updateLegend).length > 0) {
|
|
80
83
|
// legend using color table data
|
|
81
84
|
if (updateLegend.color) {
|
|
82
85
|
legendColors = updateLegend.color;
|
|
@@ -86,9 +89,20 @@ export var ContinuousLegend = function (_a) {
|
|
|
86
89
|
legendColors = updateLegend.arrayData;
|
|
87
90
|
}
|
|
88
91
|
}
|
|
89
|
-
// main continuous legend
|
|
92
|
+
// main continuous legend for colortable colors
|
|
93
|
+
if (legendColors.length > 0) {
|
|
94
|
+
legendColors = legendColors;
|
|
95
|
+
}
|
|
96
|
+
// main continuous legend for d3 colors
|
|
90
97
|
else {
|
|
91
|
-
|
|
98
|
+
arrayData_1 = [];
|
|
99
|
+
d3ColorArrays_1 = colorsArray(colorName, d3ColorScales);
|
|
100
|
+
data = range(10).map(function (d) { return ({ color: d3ColorArrays_1(d / 10) }); });
|
|
101
|
+
data.forEach(function (colorsObject, index) {
|
|
102
|
+
var _a, _b, _c;
|
|
103
|
+
arrayData_1.push([0 + "." + index, (_a = color(colorsObject.color)) === null || _a === void 0 ? void 0 : _a.rgb().r, (_b = color(colorsObject.color)) === null || _b === void 0 ? void 0 : _b.rgb().g, (_c = color(colorsObject.color)) === null || _c === void 0 ? void 0 : _c.rgb().b]);
|
|
104
|
+
});
|
|
105
|
+
legendColors = arrayData_1;
|
|
92
106
|
}
|
|
93
107
|
legendColors.forEach(function (value) {
|
|
94
108
|
// return the color and offset needed to draw the legend
|
|
@@ -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;
|
|
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;AAEjF,OAAO,EAAC,aAAa,EAAC,MAAM,uBAA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CAAC;iCACrB,MAAM,CAAC,GAAG,CAAC;iCACX,IAAI,CAAC,WAAW,EAAE,mBAAmB,CAAC;iCACtC,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC;iCAC1B,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC;iCAC3B,IAAI,CAAC,eAAe,CAAC,CAAC;yBAC9B;;;;wBAED,OAAO,CAAC,KAAK,CAAC,OAAK,CAAC,CAAC;;;;;;KAE5B;IAED,OAAO,CACH,6BACI,KAAK,EAAE;YACH,QAAQ,EAAE,UAAU;YACpB,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;YACnC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;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,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { colorTablesArray } from "../ColorTableTypes";
|
|
2
|
+
import { colorTablesArray } from "../Utils/ColorTableTypes";
|
|
3
3
|
declare type colorLegendProps = {
|
|
4
4
|
discreteData: {
|
|
5
5
|
objects: Record<string, [number[], number]>;
|
|
@@ -12,6 +12,5 @@ declare type colorLegendProps = {
|
|
|
12
12
|
updateLegend?: any;
|
|
13
13
|
};
|
|
14
14
|
export declare const DiscreteColorLegend: React.FC<colorLegendProps>;
|
|
15
|
-
export declare function colorTableData(colorName: string, colorTables: colorTablesArray): [number, number, number, number][];
|
|
16
15
|
export declare function RGBToHex(rgb: number[]): string;
|
|
17
16
|
export {};
|
|
@@ -38,13 +38,13 @@ import * as React from "react";
|
|
|
38
38
|
import { useRef } from "react";
|
|
39
39
|
import discreteLegendUtil from "../Utils/discreteLegend";
|
|
40
40
|
import { select, scaleOrdinal } from "d3";
|
|
41
|
+
import { colorsArray } from "../Utils/continousLegend";
|
|
42
|
+
import { d3ColorScales } from "../Utils/d3ColorScale";
|
|
41
43
|
export var DiscreteColorLegend = function (_a) {
|
|
42
44
|
var discreteData = _a.discreteData, dataObjectName = _a.dataObjectName, position = _a.position, colorName = _a.colorName, colorTables = _a.colorTables, horizontal = _a.horizontal, updateLegend = _a.updateLegend;
|
|
43
45
|
var divRef = useRef(null);
|
|
44
46
|
var itemName = [];
|
|
45
47
|
var itemColor = [];
|
|
46
|
-
var testColor = [];
|
|
47
|
-
var testName = [];
|
|
48
48
|
React.useEffect(function () {
|
|
49
49
|
if (divRef.current) {
|
|
50
50
|
select(divRef.current).select("div").remove();
|
|
@@ -58,7 +58,7 @@ export var DiscreteColorLegend = function (_a) {
|
|
|
58
58
|
}, [discreteData, colorName, colorTables, horizontal, updateLegend]);
|
|
59
59
|
function discreteLegend() {
|
|
60
60
|
return __awaiter(this, void 0, void 0, function () {
|
|
61
|
-
var dataSet, useSelectorLegend, res,
|
|
61
|
+
var dataSet, useSelectorLegend, res, arrayOfColors_1, d3ColorArrays_1, ordinalValues, colorLegend, currentDiv, totalRect, svgLegend, error_1;
|
|
62
62
|
return __generator(this, function (_a) {
|
|
63
63
|
switch (_a.label) {
|
|
64
64
|
case 0:
|
|
@@ -75,34 +75,44 @@ export var DiscreteColorLegend = function (_a) {
|
|
|
75
75
|
dataSet = _a.sent();
|
|
76
76
|
_a.label = 4;
|
|
77
77
|
case 4:
|
|
78
|
-
|
|
79
|
-
?
|
|
80
|
-
:
|
|
81
|
-
|
|
78
|
+
arrayOfColors_1 = typeof colorTables === "string"
|
|
79
|
+
? colorsArray(colorName, dataSet)
|
|
80
|
+
: colorsArray(colorName, colorTables);
|
|
81
|
+
d3ColorArrays_1 = colorsArray(colorName, d3ColorScales);
|
|
82
82
|
// Main discrete legend
|
|
83
83
|
if (!updateLegend || updateLegend.length == 0) {
|
|
84
84
|
Object.keys(discreteData).forEach(function (key) {
|
|
85
85
|
//eslint-disable-next-line
|
|
86
86
|
var code = discreteData[key][1];
|
|
87
|
-
//
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
itemColor.push({
|
|
93
|
-
color: RGBToHex(matchedColorsArrays),
|
|
87
|
+
// for colortable colors
|
|
88
|
+
if (arrayOfColors_1.length > 0) {
|
|
89
|
+
//compare the first value in colorarray(colortable) and code from discreteData
|
|
90
|
+
var matchedColorsArrays_1 = arrayOfColors_1.find(function (value) {
|
|
91
|
+
return value[0] == code;
|
|
94
92
|
});
|
|
95
|
-
|
|
93
|
+
if (matchedColorsArrays_1)
|
|
94
|
+
itemColor.push({
|
|
95
|
+
color: RGBToHex(matchedColorsArrays_1),
|
|
96
|
+
name: key
|
|
97
|
+
});
|
|
98
|
+
itemName.push(key);
|
|
99
|
+
}
|
|
100
|
+
// for d3 colors
|
|
101
|
+
else {
|
|
102
|
+
var matchedColorsArrays = d3ColorArrays_1.find(function (value, index) {
|
|
103
|
+
return index == code;
|
|
104
|
+
});
|
|
105
|
+
if (matchedColorsArrays)
|
|
106
|
+
itemColor.push({ color: matchedColorsArrays });
|
|
107
|
+
}
|
|
96
108
|
});
|
|
97
109
|
useSelectorLegend = false;
|
|
98
110
|
}
|
|
99
111
|
// Discrete legend using Colortable colors
|
|
100
112
|
else if (updateLegend === null || updateLegend === void 0 ? void 0 : updateLegend.color) {
|
|
101
113
|
updateLegend.color.forEach(function (key) {
|
|
102
|
-
|
|
114
|
+
itemColor.push({ color: RGBToHex(key) });
|
|
103
115
|
});
|
|
104
|
-
itemColor = testColor;
|
|
105
|
-
itemName = testName;
|
|
106
116
|
useSelectorLegend = true;
|
|
107
117
|
}
|
|
108
118
|
// Discrete legend using d3 colors
|
|
@@ -110,12 +120,12 @@ export var DiscreteColorLegend = function (_a) {
|
|
|
110
120
|
updateLegend.colorsObject.forEach(function (key) {
|
|
111
121
|
itemColor.push({ color: key });
|
|
112
122
|
});
|
|
113
|
-
//itemColor = itemColor;
|
|
114
123
|
itemName = updateLegend.legendColorName;
|
|
115
124
|
useSelectorLegend = true;
|
|
116
125
|
}
|
|
117
126
|
ordinalValues = scaleOrdinal().domain(itemName);
|
|
118
|
-
colorLegend = discreteLegendUtil(itemColor, useSelectorLegend, horizontal)
|
|
127
|
+
colorLegend = discreteLegendUtil(itemColor, useSelectorLegend, horizontal)
|
|
128
|
+
.inputScale(ordinalValues);
|
|
119
129
|
currentDiv = select(divRef.current);
|
|
120
130
|
totalRect = void 0;
|
|
121
131
|
// append the title
|
|
@@ -128,12 +138,6 @@ export var DiscreteColorLegend = function (_a) {
|
|
|
128
138
|
svgLegend = currentDiv
|
|
129
139
|
.style("margin", "5px")
|
|
130
140
|
.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
141
|
.call(colorLegend);
|
|
138
142
|
// Style for main horizontal legend
|
|
139
143
|
if (!useSelectorLegend) {
|
|
@@ -183,17 +187,10 @@ export var DiscreteColorLegend = function (_a) {
|
|
|
183
187
|
top: position ? position[1] : " ",
|
|
184
188
|
backgroundColor: "#ffffffcc",
|
|
185
189
|
borderRadius: "5px",
|
|
186
|
-
zIndex:
|
|
190
|
+
zIndex: 999,
|
|
187
191
|
} },
|
|
188
192
|
React.createElement("div", { id: "legend", ref: divRef })));
|
|
189
193
|
};
|
|
190
|
-
// Based on name return the colors array from color.tables.json file
|
|
191
|
-
export function colorTableData(colorName, colorTables) {
|
|
192
|
-
var colorTableData = colorTables.filter(function (value) {
|
|
193
|
-
return value.name.toLowerCase() == colorName.toLowerCase();
|
|
194
|
-
});
|
|
195
|
-
return colorTableData.length > 0 ? colorTableData[0].colors : [];
|
|
196
|
-
}
|
|
197
194
|
export function RGBToHex(rgb) {
|
|
198
195
|
var r = rgb[1].toString(16), g = rgb[2].toString(16), b = rgb[3].toString(16);
|
|
199
196
|
if (r.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,YAAY,EAAE,MAAM,IAAI,CAAC;
|
|
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,YAAY,EAAE,MAAM,IAAI,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAiBpD,MAAM,CAAC,IAAM,mBAAmB,GAA+B,UAAC,EAQ7C;QAPf,YAAY,kBAAA,EACZ,cAAc,oBAAA,EACd,QAAQ,cAAA,EACR,SAAS,eAAA,EACT,WAAW,iBAAA,EACX,UAAU,gBAAA,EACV,YAAY,kBAAA;IAEZ,IAAM,MAAM,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC5C,IAAI,QAAQ,GAAa,EAAE,CAAC;IAC5B,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AC,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"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorTableTypes.js","sourceRoot":"","sources":["../../../src/component/Utils/ColorTableTypes.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { colorTablesArray } from "../ColorTableTypes";
|
|
2
|
-
export declare function colorsArray(colorName: string, colorTables:
|
|
1
|
+
import { colorTablesArray } from "../Utils/ColorTableTypes";
|
|
2
|
+
export declare function colorsArray(colorName: string, colorTables: any): any;
|
|
3
3
|
export declare function rgbValues(point: number, colorName: string, colorTables: colorTablesArray): number[] | {
|
|
4
4
|
r: number;
|
|
5
5
|
g: number;
|
|
@@ -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,CAA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