@emerson-eps/color-tables 0.4.5 → 0.4.6
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 +11 -2
- package/dist/component/ColorSelector/ColorSelectorAccordion.js.map +1 -1
- package/dist/component/ColorSelector/ColorSelectorWrapper.d.ts +5 -3
- package/dist/component/ColorSelector/ColorSelectorWrapper.js +68 -43
- package/dist/component/ColorSelector/ColorSelectorWrapper.js.map +1 -1
- package/dist/component/Legend/ColorLegend.js +16 -7
- package/dist/component/Legend/ColorLegend.js.map +1 -1
- package/dist/component/Legend/ContinuousLegend.d.ts +1 -0
- package/dist/component/Legend/ContinuousLegend.js +31 -28
- package/dist/component/Legend/ContinuousLegend.js.map +1 -1
- package/dist/component/Legend/ContinuousLegend.stories.d.ts +1 -0
- package/dist/component/Utils/legendCommonFunction.stories.d.ts +1 -0
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ export var ColorSelectorAccordion = function (props) {
|
|
|
10
10
|
right: props.isHorizontal ? 5 : 165,
|
|
11
11
|
} },
|
|
12
12
|
React.createElement(Accordion, null,
|
|
13
|
-
React.createElement(Accordion.Item,
|
|
13
|
+
React.createElement(Accordion.Item, null,
|
|
14
14
|
React.createElement(Accordion.Header, null, "Color Scales"),
|
|
15
15
|
React.createElement(Accordion.Panel, null,
|
|
16
16
|
React.createElement(Accordion, null,
|
|
@@ -22,6 +22,15 @@ export var ColorSelectorAccordion = function (props) {
|
|
|
22
22
|
React.createElement(Accordion.Item, null,
|
|
23
23
|
React.createElement(Accordion.Header, null, "D3 Color Scale"),
|
|
24
24
|
React.createElement(Accordion.Panel, null,
|
|
25
|
-
React.createElement(ColorSelectorWrapper, { useColorTableColors: false, newColorScaleData: props === null || props === void 0 ? void 0 : props.newColorScaleData, colorTables: props === null || props === void 0 ? void 0 : props.colorTables })))))))
|
|
25
|
+
React.createElement(ColorSelectorWrapper, { useColorTableColors: false, newColorScaleData: props === null || props === void 0 ? void 0 : props.newColorScaleData, colorTables: props === null || props === void 0 ? void 0 : props.colorTables }))))))),
|
|
26
|
+
React.createElement(Accordion, null,
|
|
27
|
+
React.createElement(Accordion.Item, null,
|
|
28
|
+
React.createElement(Accordion.Header, null, "Color Sampling"),
|
|
29
|
+
React.createElement(Accordion.Panel, null,
|
|
30
|
+
React.createElement(Accordion, null,
|
|
31
|
+
React.createElement(Accordion.Item, null,
|
|
32
|
+
React.createElement(Accordion.Header, null, "Interpolation"),
|
|
33
|
+
React.createElement(Accordion.Panel, null,
|
|
34
|
+
React.createElement(ColorSelectorWrapper, { useSampling: true, getSample: props === null || props === void 0 ? void 0 : props.getSample })))))))));
|
|
26
35
|
};
|
|
27
36
|
//# sourceMappingURL=ColorSelectorAccordion.js.map
|
|
@@ -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,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,CAAC,IAAM,sBAAsB,GAAG,UAAC,KAAU;IAC/C,OAAO,CACL,6BACE,SAAS,EAAC,WAAW,EACrB,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;YACd,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;SACpC;QAED,oBAAC,SAAS;YACR,oBAAC,SAAS,CAAC,IAAI
|
|
1
|
+
{"version":3,"file":"ColorSelectorAccordion.js","sourceRoot":"","sources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AiB,EAC3C,WAAW,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,WAAW,GAC/B,CACc,CACH,CACP,CACI,CACH,CACP;QACZ,oBAAC,SAAS;YACR,oBAAC,SAAS,CAAC,IAAI;gBACb,oBAAC,SAAS,CAAC,MAAM,yBAAkC;gBACnD,oBAAC,SAAS,CAAC,KAAK;oBACd,oBAAC,SAAS;wBACR,oBAAC,SAAS,CAAC,IAAI;4BACb,oBAAC,SAAS,CAAC,MAAM,wBAAiC;4BAClD,oBAAC,SAAS,CAAC,KAAK;gCACd,oBAAC,oBAAoB,IACnB,WAAW,EAAE,IAAI,EACjB,SAAS,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,GAC3B,CACc,CACH,CACP,CACI,CACH,CACP,CACR,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -5,9 +5,11 @@ export declare type colorScaleObj = {
|
|
|
5
5
|
};
|
|
6
6
|
export declare type colorScaleArray = Array<colorScaleObj>;
|
|
7
7
|
declare type legendProps = {
|
|
8
|
-
useColorTableColors
|
|
9
|
-
newColorScaleData
|
|
10
|
-
colorTables
|
|
8
|
+
useColorTableColors?: boolean;
|
|
9
|
+
newColorScaleData?: any;
|
|
10
|
+
colorTables?: any;
|
|
11
|
+
useSampling?: boolean;
|
|
12
|
+
getSample?: any;
|
|
11
13
|
};
|
|
12
14
|
export declare const ColorSelectorWrapper: React.FC<legendProps>;
|
|
13
15
|
export {};
|
|
@@ -2,60 +2,85 @@ import * as React from "react";
|
|
|
2
2
|
import { d3ColorScales } from "../Utils/d3ColorScale";
|
|
3
3
|
import { ColorSelectorComponent } from "./ColorSelectorComponent";
|
|
4
4
|
export var ColorSelectorWrapper = function (_a) {
|
|
5
|
-
var useColorTableColors = _a.useColorTableColors, newColorScaleData = _a.newColorScaleData, colorTables = _a.colorTables;
|
|
5
|
+
var useColorTableColors = _a.useColorTableColors, newColorScaleData = _a.newColorScaleData, colorTables = _a.colorTables, useSampling = _a.useSampling, getSample = _a.getSample;
|
|
6
6
|
var continuousLegend;
|
|
7
7
|
var discreteLegend;
|
|
8
8
|
var continuosColorData = [];
|
|
9
9
|
var continuosD3ColorData = [];
|
|
10
10
|
var discreteColorData = [];
|
|
11
11
|
var discreteD3ColorData = [];
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
continuosD3ColorData.push({ color: element.colors, name: element.name });
|
|
25
|
-
});
|
|
26
|
-
// Discrete legend using color table data
|
|
27
|
-
var discreteData = colorTables.filter(function (element) {
|
|
28
|
-
return element.discrete === true;
|
|
29
|
-
});
|
|
30
|
-
discreteData.forEach(function (element) {
|
|
31
|
-
discreteColorData.push({ color: element.colors, name: element.name });
|
|
32
|
-
});
|
|
33
|
-
// Discrete legend using d3 data
|
|
34
|
-
var d3discreteData = d3ColorScales.filter(function (element) {
|
|
35
|
-
return element.discrete === true;
|
|
36
|
-
});
|
|
37
|
-
d3discreteData.forEach(function (element) {
|
|
38
|
-
discreteD3ColorData.push({ color: element.colors, name: element.name });
|
|
39
|
-
});
|
|
40
|
-
// return continuous and discrete legend which uses d3 data
|
|
41
|
-
if (!useColorTableColors) {
|
|
42
|
-
continuousLegend = continuosD3ColorData.map(function (val, index) {
|
|
43
|
-
return (React.createElement(ColorSelectorComponent, { legendColor: val.color, legendColorName: val.name, useContColorTable: false, uniqueId: index, colorScaleData: newColorScaleData, key: index }));
|
|
12
|
+
var onChangeData = React.useCallback(function (e) {
|
|
13
|
+
if (e.value === "Linear") {
|
|
14
|
+
getSample("Linear");
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
getSample("Logarithm");
|
|
18
|
+
}
|
|
19
|
+
}, [getSample]);
|
|
20
|
+
if (!useSampling) {
|
|
21
|
+
// Continuous legend using color table data
|
|
22
|
+
var colorTableContinuousData = colorTables.filter(function (element) {
|
|
23
|
+
return element.discrete === false;
|
|
44
24
|
});
|
|
45
|
-
|
|
46
|
-
|
|
25
|
+
colorTableContinuousData.forEach(function (element) {
|
|
26
|
+
continuosColorData.push({ color: element.colors, name: element.name });
|
|
47
27
|
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
28
|
+
// Continuous legend using d3 data
|
|
29
|
+
var d3continuousData = d3ColorScales.filter(function (element) {
|
|
30
|
+
return element.discrete === false;
|
|
31
|
+
});
|
|
32
|
+
d3continuousData.forEach(function (element) {
|
|
33
|
+
continuosD3ColorData.push({ color: element.colors, name: element.name });
|
|
34
|
+
});
|
|
35
|
+
// Discrete legend using color table data
|
|
36
|
+
var discreteData = colorTables.filter(function (element) {
|
|
37
|
+
return element.discrete === true;
|
|
53
38
|
});
|
|
54
|
-
|
|
55
|
-
|
|
39
|
+
discreteData.forEach(function (element) {
|
|
40
|
+
discreteColorData.push({ color: element.colors, name: element.name });
|
|
56
41
|
});
|
|
42
|
+
// Discrete legend using d3 data
|
|
43
|
+
var d3discreteData = d3ColorScales.filter(function (element) {
|
|
44
|
+
return element.discrete === true;
|
|
45
|
+
});
|
|
46
|
+
d3discreteData.forEach(function (element) {
|
|
47
|
+
discreteD3ColorData.push({ color: element.colors, name: element.name });
|
|
48
|
+
});
|
|
49
|
+
// return continuous and discrete legend which uses d3 data
|
|
50
|
+
if (!useColorTableColors) {
|
|
51
|
+
continuousLegend = continuosD3ColorData.map(function (val, index) {
|
|
52
|
+
return (React.createElement(ColorSelectorComponent, { legendColor: val.color, legendColorName: val.name, useContColorTable: false, uniqueId: index, colorScaleData: newColorScaleData, key: index }));
|
|
53
|
+
});
|
|
54
|
+
discreteLegend = d3discreteData.map(function (val, index) {
|
|
55
|
+
return (React.createElement(ColorSelectorComponent, { colorsObject: val.colors, legendColorName: val.name, useDiscColorTable: false, colorScaleData: newColorScaleData, key: index }));
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
// return continuous and discrete legend which uses colortable data
|
|
59
|
+
if (useColorTableColors) {
|
|
60
|
+
continuousLegend = continuosColorData.map(function (value, index) {
|
|
61
|
+
return (React.createElement(ColorSelectorComponent, { colorsObject: value, useContColorTable: true, uniqueId: index, colorScaleData: newColorScaleData, key: index }));
|
|
62
|
+
});
|
|
63
|
+
discreteLegend = discreteColorData.map(function (val, index) {
|
|
64
|
+
return (React.createElement(ColorSelectorComponent, { colorsObject: discreteColorData[index], legendColorName: val.name, useDiscColorTable: true, colorScaleData: newColorScaleData, key: index }));
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
else if (useSampling) {
|
|
69
|
+
// eslint-disable-next-line
|
|
70
|
+
{
|
|
71
|
+
// eslint-disable-next-line
|
|
72
|
+
useSampling;
|
|
73
|
+
}
|
|
74
|
+
return (React.createElement("div", { onChange: function (ev) {
|
|
75
|
+
onChangeData(ev.target);
|
|
76
|
+
} },
|
|
77
|
+
React.createElement("input", { type: "radio", value: "Linear", name: "legend", defaultChecked: true }),
|
|
78
|
+
" ",
|
|
79
|
+
"Linear ",
|
|
80
|
+
React.createElement("br", null),
|
|
81
|
+
React.createElement("input", { type: "radio", value: "Logarithm", name: "legend" }),
|
|
82
|
+
" Logarithm"));
|
|
57
83
|
}
|
|
58
|
-
//}
|
|
59
84
|
return (React.createElement("div", { className: "legendWrapper", style: {
|
|
60
85
|
height: 200,
|
|
61
86
|
overflow: "auto",
|
|
@@ -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,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"ColorSelector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,CAAC;YAED,+BAAO,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAC,QAAQ,EAAC,cAAc,SAAG;YAAC,GAAG;;YAC/D,+BAAM;YACb,+BAAO,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,WAAW,EAAC,IAAI,EAAC,QAAQ,GAAG;yBAClD,CACP,CAAC;KACH;IAED,OAAO,CACL,6BACE,SAAS,EAAC,eAAe,EACzB,KAAK,EAAE;YACL,MAAM,EAAE,GAAG;YACX,QAAQ,EAAE,MAAM;YAChB,OAAO,EAAE,MAAM;YACf,aAAa,EAAE,QAAQ;YACvB,SAAS,EAAE,QAAQ;SACpB;QAEA,gBAAgB;QAChB,cAAc,CACX,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -10,22 +10,23 @@ export var ColorLegend = function (_a) {
|
|
|
10
10
|
var generateUniqueId = Math.ceil(Math.random() * 9999).toString();
|
|
11
11
|
var divRef = useRef(null);
|
|
12
12
|
var _b = React.useState(false), isOpen = _b[0], setIsOpen = _b[1];
|
|
13
|
+
var _c = React.useState(true), isLinear = _c[0], setLinear = _c[1];
|
|
13
14
|
var toggleColorSelector = useCallback(function () {
|
|
14
15
|
if (divRef && divRef.current) {
|
|
15
16
|
isOpen ? setIsOpen(false) : setIsOpen(true);
|
|
16
17
|
}
|
|
17
18
|
}, [isOpen]);
|
|
18
|
-
var
|
|
19
|
+
var _d = React.useState([]), getColorScaleData = _d[0], setGetColorScaleData = _d[1];
|
|
19
20
|
var isColortableColors = colorTables.find(function (value) {
|
|
20
|
-
return (value === null || value === void 0 ? void 0 : value.name) === colorName
|
|
21
|
+
return (value === null || value === void 0 ? void 0 : value.name) === colorName;
|
|
21
22
|
});
|
|
22
23
|
var isD3Colors = d3ColorScales.find(function (value) {
|
|
23
|
-
return (value === null || value === void 0 ? void 0 : value.name) === colorName
|
|
24
|
+
return (value === null || value === void 0 ? void 0 : value.name) === colorName;
|
|
24
25
|
});
|
|
25
|
-
var
|
|
26
|
+
var _e = React.useState((isColortableColors || isD3Colors) &&
|
|
26
27
|
((isColortableColors === null || isColortableColors === void 0 ? void 0 : isColortableColors.discrete) === false || (isD3Colors === null || isD3Colors === void 0 ? void 0 : isD3Colors.discrete) === false)
|
|
27
28
|
? true
|
|
28
|
-
: false), isCont =
|
|
29
|
+
: false), isCont = _e[0], setIsCont = _e[1];
|
|
29
30
|
// Get new colorscale from colorselector and update legend
|
|
30
31
|
var getSelectedColorScale = React.useCallback(function (data, value) {
|
|
31
32
|
// update color map layer
|
|
@@ -39,10 +40,18 @@ export var ColorLegend = function (_a) {
|
|
|
39
40
|
setGetColorScaleData(data);
|
|
40
41
|
setIsCont(value);
|
|
41
42
|
}, [getColorName]);
|
|
43
|
+
var getSampling = React.useCallback(function (data) {
|
|
44
|
+
if (data === "Logarithm") {
|
|
45
|
+
setLinear(false);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
setLinear(true);
|
|
49
|
+
}
|
|
50
|
+
}, []);
|
|
42
51
|
return (React.createElement("div", null,
|
|
43
52
|
React.createElement("div", { ref: divRef, onClick: toggleColorSelector },
|
|
44
|
-
isCont === true && (React.createElement(ContinuousLegend, { min: min, max: max, dataObjectName: dataObjectName, position: position, colorName: colorName, horizontal: horizontal, getColorScaleData: getColorScaleData, id: generateUniqueId, colorTables: colorTables, reverseRange: reverseRange })),
|
|
53
|
+
isCont === true && (React.createElement(ContinuousLegend, { min: min, max: max, dataObjectName: dataObjectName, position: position, colorName: colorName, horizontal: horizontal, getColorScaleData: getColorScaleData, id: generateUniqueId, colorTables: colorTables, reverseRange: reverseRange, isLinear: isLinear })),
|
|
45
54
|
isCont === false && (React.createElement(DiscreteColorLegend, { discreteData: discreteData, dataObjectName: dataObjectName, position: position, colorName: colorName, horizontal: horizontal, getColorScaleData: getColorScaleData, id: generateUniqueId, colorTables: colorTables }))),
|
|
46
|
-
React.createElement("div", null, isOpen && (React.createElement(ColorSelectorAccordion, { newColorScaleData: getSelectedColorScale, isHorizontal: horizontal, colorTables: colorTables })))));
|
|
55
|
+
React.createElement("div", null, isOpen && (React.createElement(ColorSelectorAccordion, { newColorScaleData: getSelectedColorScale, isHorizontal: horizontal, colorTables: colorTables, getSample: getSampling })))));
|
|
47
56
|
};
|
|
48
57
|
//# 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,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAgBtD,sCAAsC;AACtC,MAAM,CAAC,IAAM,WAAW,GAA+B,UAAC,EAWrC;QAVjB,QAAQ,cAAA,EACR,UAAU,gBAAA,EACV,WAAW,iBAAA,EACX,GAAG,SAAA,EACH,GAAG,SAAA,EACH,cAAc,oBAAA,EACd,SAAS,eAAA,EACT,YAAY,kBAAA,EACZ,YAAY,kBAAA,EACZ,YAAY,kBAAA;IAEZ,IAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;IACpE,IAAM,MAAM,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IACtC,IAAA,KAAsB,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAA1C,MAAM,QAAA,EAAE,SAAS,QAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"ColorLegend.js","sourceRoot":"","sources":["../../../src/component/Legend/ColorL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AAI,IAAI,KAAK,WAAW,EAAE;YACxB,SAAS,CAAC,KAAK,CAAC,CAAC;SAClB;aAAM;YACL,SAAS,CAAC,IAAI,CAAC,CAAC;SACjB;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,CACL;QACE,6BAAK,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB;YAC3C,MAAM,KAAK,IAAI,IAAI,CAClB,oBAAC,gBAAgB,IACf,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,EAAE,EAAE,gBAAgB,EACpB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,GAClB,CACH;YACA,MAAM,KAAK,KAAK,IAAI,CACnB,oBAAC,mBAAmB,IAClB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,EAAE,EAAE,gBAAgB,EACpB,WAAW,EAAE,WAAW,GACxB,CACH,CACG;QACN,iCACG,MAAM,IAAI,CACT,oBAAC,sBAAsB,IACrB,iBAAiB,EAAE,qBAAqB,EACxC,YAAY,EAAE,UAAU,EACxB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,WAAW,GACtB,CACH,CACG,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -37,13 +37,13 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
import * as React from "react";
|
|
38
38
|
import { useRef } from "react";
|
|
39
39
|
import { RGBToHex, colorsArray, RGBToHexValue, } from "../Utils/legendCommonFunction";
|
|
40
|
-
import { select, scaleLinear,
|
|
40
|
+
import { select, scaleLinear, scaleSymlog, axisBottom, axisRight } from "d3";
|
|
41
41
|
import { d3ColorScales } from "../Utils/d3ColorScale";
|
|
42
42
|
import { color } from "d3-color";
|
|
43
43
|
import { range } from "d3";
|
|
44
44
|
import defaultColorTables from "../color-tables.json";
|
|
45
45
|
export var ContinuousLegend = function (_a) {
|
|
46
|
-
var min = _a.min, max = _a.max, dataObjectName = _a.dataObjectName, position = _a.position, _b = _a.colorName, colorName = _b === void 0 ? "Rainbow" : _b, horizontal = _a.horizontal, getColorScaleData = _a.getColorScaleData, id = _a.id, _c = _a.colorTables, colorTables = _c === void 0 ? defaultColorTables : _c, colorMapFunction = _a.colorMapFunction, reverseRange = _a.reverseRange;
|
|
46
|
+
var min = _a.min, max = _a.max, dataObjectName = _a.dataObjectName, position = _a.position, _b = _a.colorName, colorName = _b === void 0 ? "Rainbow" : _b, horizontal = _a.horizontal, getColorScaleData = _a.getColorScaleData, id = _a.id, _c = _a.colorTables, colorTables = _c === void 0 ? defaultColorTables : _c, colorMapFunction = _a.colorMapFunction, reverseRange = _a.reverseRange, _d = _a.isLinear, isLinear = _d === void 0 ? true : _d;
|
|
47
47
|
var generateUniqueId = Math.ceil(Math.random() * 9999).toString();
|
|
48
48
|
var divRef = useRef(null);
|
|
49
49
|
React.useEffect(function () {
|
|
@@ -54,7 +54,7 @@ export var ContinuousLegend = function (_a) {
|
|
|
54
54
|
}
|
|
55
55
|
function continuousLegend() {
|
|
56
56
|
return __awaiter(this, void 0, void 0, function () {
|
|
57
|
-
var itemColor, dataSet, res, legendColors,
|
|
57
|
+
var itemColor, dataSet, res, legendColors, arrayData_1, d3ColorArrays_1, data, getColorTableScale_1, maxValue_1, rgbValue, i, value, width, colorScale_1, svgLegend, linearGradient, xLeg, yLeg, horizontalAxisLeg, VerticalAxisLeg, error_1;
|
|
58
58
|
return __generator(this, function (_a) {
|
|
59
59
|
switch (_a.label) {
|
|
60
60
|
case 0:
|
|
@@ -86,11 +86,8 @@ export var ContinuousLegend = function (_a) {
|
|
|
86
86
|
legendColors = getColorScaleData.arrayData;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
isD3Colors = d3ColorScales.find(function (value) {
|
|
90
|
-
return (value === null || value === void 0 ? void 0 : value.name) === colorName;
|
|
91
|
-
});
|
|
92
89
|
// main continuous legend for d3 colors
|
|
93
|
-
if (
|
|
90
|
+
if (legendColors.length === 0) {
|
|
94
91
|
arrayData_1 = [];
|
|
95
92
|
d3ColorArrays_1 = colorsArray(colorName, d3ColorScales);
|
|
96
93
|
data = range(10).map(function (d) { return ({ color: d3ColorArrays_1(d / 10) }); });
|
|
@@ -123,6 +120,9 @@ export var ContinuousLegend = function (_a) {
|
|
|
123
120
|
}
|
|
124
121
|
legendColors = rgbValue;
|
|
125
122
|
}
|
|
123
|
+
// let breakpoint = [0.0, 0.2, 0.4, 0.6, 0.8, 1.0];
|
|
124
|
+
// let itemVale: any
|
|
125
|
+
// breakpoint.forEach(function (item) {itemVale = item});
|
|
126
126
|
legendColors.forEach(function (value) {
|
|
127
127
|
// return the color and offset needed to draw the legend
|
|
128
128
|
itemColor.push({
|
|
@@ -131,26 +131,25 @@ export var ContinuousLegend = function (_a) {
|
|
|
131
131
|
? RGBToHexValue(value, maxValue_1).offset
|
|
132
132
|
: RGBToHex(value).offset,
|
|
133
133
|
color: RGBToHex(value).color,
|
|
134
|
+
testOffset: value[0], // gives the first point
|
|
134
135
|
});
|
|
135
136
|
});
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
width = 150;
|
|
138
|
+
colorScale_1 = isLinear
|
|
139
|
+
? scaleLinear().domain([min, max]).range([0, width])
|
|
140
|
+
: scaleSymlog().domain([min, max]).range([0, width]);
|
|
140
141
|
svgLegend = select(divRef.current)
|
|
141
142
|
.style("margin-right", "2px")
|
|
142
143
|
.style("margin-left", "2px")
|
|
143
144
|
.append("svg")
|
|
144
145
|
.style("background-color", "#ffffffcc")
|
|
145
|
-
.style("border-radius", "5px")
|
|
146
|
-
|
|
147
|
-
svgLegend
|
|
148
|
-
.attr("width", horizontal ? "190" : "77")
|
|
146
|
+
.style("border-radius", "5px")
|
|
147
|
+
.attr("width", horizontal ? width + 50 : "77")
|
|
149
148
|
.attr("height", horizontal ? "70" : "173");
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
linearGradient = svgLegend
|
|
150
|
+
.append("defs")
|
|
152
151
|
.append("linearGradient")
|
|
153
|
-
.attr("id",
|
|
152
|
+
.attr("id", "linear-gradient-" + id + "0");
|
|
154
153
|
// append a linearGradient element to the defs and give it a unique id
|
|
155
154
|
if ((horizontal && !reverseRange) || (!horizontal && reverseRange)) {
|
|
156
155
|
linearGradient
|
|
@@ -174,7 +173,9 @@ export var ContinuousLegend = function (_a) {
|
|
|
174
173
|
.enter()
|
|
175
174
|
.append("stop")
|
|
176
175
|
.attr("offset", function (data) {
|
|
177
|
-
return data.
|
|
176
|
+
// return colorScale(data.testOffset) / 1.5 + "%";
|
|
177
|
+
return colorScale_1(min + data.testOffset * (max - min)) / 1.5 + "%";
|
|
178
|
+
//return (isLinear ? data.offset + "%" : colorScale(min + (data.testOffset * (max - min))) / 4 + "%");
|
|
178
179
|
})
|
|
179
180
|
.attr("stop-color", function (data) {
|
|
180
181
|
return data.color;
|
|
@@ -182,16 +183,17 @@ export var ContinuousLegend = function (_a) {
|
|
|
182
183
|
// draw the rectangle and fill with gradient
|
|
183
184
|
svgLegend
|
|
184
185
|
.append("rect")
|
|
185
|
-
.attr("x",
|
|
186
|
+
.attr("x", 16)
|
|
186
187
|
.attr("y", horizontal ? 30 : 18)
|
|
187
|
-
.attr("width", horizontal ?
|
|
188
|
+
.attr("width", horizontal ? width : 20)
|
|
188
189
|
.attr("height", horizontal ? 20 : "149")
|
|
189
|
-
|
|
190
|
+
// eslint-disable-next-line
|
|
191
|
+
.style("fill", "url(#" + "linear-gradient-" + id + "0" + ")");
|
|
190
192
|
// append title
|
|
191
193
|
svgLegend
|
|
192
194
|
.append("text")
|
|
193
195
|
.attr("x", horizontal ? 25 : -168)
|
|
194
|
-
.attr("y", horizontal ? 20 :
|
|
196
|
+
.attr("y", horizontal ? 20 : 10)
|
|
195
197
|
.style("text-anchor", "left")
|
|
196
198
|
.style("transform", horizontal ? "none" : "left")
|
|
197
199
|
.style("transform", horizontal ? "none" : "rotate(270deg)")
|
|
@@ -200,18 +202,18 @@ export var ContinuousLegend = function (_a) {
|
|
|
200
202
|
.text(dataObjectName);
|
|
201
203
|
xLeg = scaleLinear()
|
|
202
204
|
.domain(reverseRange ? [max, min] : [min, max])
|
|
203
|
-
.range([
|
|
205
|
+
.range([0, width]);
|
|
204
206
|
yLeg = scaleLinear()
|
|
205
207
|
.domain(reverseRange ? [min, max] : [max, min])
|
|
206
|
-
.range([
|
|
207
|
-
horizontalAxisLeg = axisBottom(xLeg).tickValues(
|
|
208
|
+
.range([0, width]);
|
|
209
|
+
horizontalAxisLeg = axisBottom(xLeg).tickValues(colorScale_1.domain());
|
|
208
210
|
VerticalAxisLeg = axisRight(yLeg)
|
|
209
211
|
.tickSize(20)
|
|
210
|
-
.tickValues(
|
|
212
|
+
.tickValues(colorScale_1.domain());
|
|
211
213
|
svgLegend
|
|
212
214
|
.attr("class", "axis")
|
|
213
215
|
.append("g")
|
|
214
|
-
.attr("transform", horizontal ? "translate(16, 50)" : "translate(
|
|
216
|
+
.attr("transform", horizontal ? "translate(16, 50)" : "translate(15.5, 17.5)")
|
|
215
217
|
.style("font-size", "10px")
|
|
216
218
|
.style("font-weight", "700")
|
|
217
219
|
.call(horizontal ? horizontalAxisLeg : VerticalAxisLeg)
|
|
@@ -237,6 +239,7 @@ export var ContinuousLegend = function (_a) {
|
|
|
237
239
|
dataObjectName,
|
|
238
240
|
id,
|
|
239
241
|
reverseRange,
|
|
242
|
+
isLinear,
|
|
240
243
|
]);
|
|
241
244
|
return (React.createElement("div", { style: {
|
|
242
245
|
right: position ? position[0] : " ",
|
|
@@ -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,EACL,QAAQ,EACR,WAAW,EACX,aAAa,GACd,MAAM,+BAA+B,CAAC;AACvC,OAAO,
|
|
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,EACL,QAAQ,EACR,WAAW,EACX,aAAa,GACd,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,CAAC;AAE3B,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAgEtD,MAAM,CAAC,IAAM,gBAAgB,GAAoC,UAAC,EAa1C;QAZtB,GAAG,SAAA,EACH,GAAG,SAAA,EACH,cAAc,oBAAA,EACd,QAAQ,cAAA,EACR,iBAAqB,EAArB,SAAS,mBAAG,SAAS,KAAA,EACrB,UAAU,gBAAA,EACV,iBAAiB,uBAAA,EACjB,EAAE,QAAA,EACF,mBAAoD,EAApD,WAAW,mBAAG,kBAAsC,KAAA,EACpD,gBAAgB,sBAAA,EAChB,YAAY,kBAAA,EACZ,gBAAe,EA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IAAI,CAAC,OAAO,EAAE,MAAM,CAAC;iCACrB,MAAM,CAAC,GAAG,CAAC;iCACX,IAAI,CACH,WAAW,EACX,UAAU,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,uBAAuB,CAC3D;iCACA,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC;iCAC1B,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC;iCAC3B,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,eAAe,CAAC;iCACtD,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;;;;4BAEvB,OAAO,CAAC,KAAK,CAAC,OAAK,CAAC,CAAC;;;;;;SAExB;IACH,CAAC,EAAE;QACD,GAAG;QACH,GAAG;QACH,SAAS;QACT,WAAW;QACX,UAAU;QACV,iBAAiB;QACjB,gBAAgB;QAChB,cAAc;QACd,EAAE;QACF,YAAY;QACZ,QAAQ;KACT,CAAC,CAAC;IACH,OAAO,CACL,6BACE,KAAK,EAAE;YACL,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;SACZ;QAED,6BACE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,wBAAiB,gBAAgB,CAAE,EACjD,GAAG,EAAE,MAAM,GACN,CACH,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,gBAAgB,CAAC,YAAY,GAAG;IAC9B,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;CAClB,CAAC"}
|
|
@@ -12,6 +12,7 @@ declare const _default: ComponentMeta<React.FC<{
|
|
|
12
12
|
colorTables?: import("../colorTableTypes").colorTablesArray;
|
|
13
13
|
colorMapFunction?: any;
|
|
14
14
|
reverseRange?: boolean;
|
|
15
|
+
isLinear?: boolean;
|
|
15
16
|
}>>;
|
|
16
17
|
export default _default;
|
|
17
18
|
export declare const StandardColorTableLibrary: any;
|
|
@@ -12,6 +12,7 @@ declare const _default: ComponentMeta<React.FC<{
|
|
|
12
12
|
colorTables?: import("../colorTableTypes").colorTablesArray;
|
|
13
13
|
colorMapFunction?: any;
|
|
14
14
|
reverseRange?: boolean;
|
|
15
|
+
isLinear?: boolean;
|
|
15
16
|
}>>;
|
|
16
17
|
export default _default;
|
|
17
18
|
export declare const ColorMapFunction: any;
|