@emerson-eps/color-tables 0.2.13 → 0.2.16
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 +1 -2
- package/dist/component/ColorSelector/ColorSelectorComponent.js +3 -3
- package/dist/component/ColorSelector/ColorSelectorComponent.js.map +1 -1
- package/dist/component/ColorSelector/ColorSelectorWrapper.d.ts +6 -1
- package/dist/component/ColorSelector/ColorSelectorWrapper.js +7 -8
- package/dist/component/ColorSelector/ColorSelectorWrapper.js.map +1 -1
- package/dist/component/Legend/ColorLegend.js +2 -2
- package/dist/component/Legend/ColorLegend.js.map +1 -1
- package/dist/component/Legend/ContinuousLegend.d.ts +1 -1
- package/dist/component/Legend/ContinuousLegend.js.map +1 -1
- package/dist/component/Legend/DiscreteLegend.d.ts +1 -1
- package/dist/component/Legend/DiscreteLegend.js +1 -1
- package/dist/component/Legend/DiscreteLegend.js.map +1 -1
- package/dist/component/Utils/continousLegend.d.ts +1 -1
- package/dist/component/{Utils/ColorTableTypes.d.ts → colorTableTypes.d.ts} +0 -0
- package/dist/component/colorTableTypes.js +2 -0
- package/dist/component/colorTableTypes.js.map +1 -0
- package/dist/index.d.ts +4 -6
- package/dist/index.js +3 -5
- package/dist/index.js.map +1 -1
- package/package.json +6 -3
- package/.storybook/main.js +0 -11
- package/.storybook/preview.js +0 -9
- package/.vscode/settings.json +0 -3
- package/dist/component/Utils/ColorTableTypes.js +0 -2
- package/dist/component/Utils/ColorTableTypes.js.map +0 -1
- package/dist/stories/ColorLegends/ColorSelector/Selector.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/ColorSelector/Selector.stories.js +0 -11
- package/dist/stories/ColorLegends/ColorSelector/Selector.stories.js.map +0 -1
- package/dist/stories/ColorLegends/ContinousLegends/MD.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/ContinousLegends/MD.stories.js +0 -38
- package/dist/stories/ColorLegends/ContinousLegends/MD.stories.js.map +0 -1
- package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.js +0 -38
- package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.js.map +0 -1
- package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.js +0 -38
- package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.js.map +0 -1
- package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.js +0 -38
- package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.js.map +0 -1
- package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.js +0 -38
- package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.js.map +0 -1
- package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.js +0 -38
- package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.js.map +0 -1
- package/dist/stories/ColorLegends/ContinousLegends/SW.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/ContinousLegends/SW.stories.js +0 -38
- package/dist/stories/ColorLegends/ContinousLegends/SW.stories.js.map +0 -1
- package/dist/stories/ColorLegends/DiscreteLegends/Facies.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/DiscreteLegends/Facies.stories.js +0 -47
- package/dist/stories/ColorLegends/DiscreteLegends/Facies.stories.js.map +0 -1
- package/dist/stories/ColorLegends/DiscreteLegends/FaciesNoCalcite.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/DiscreteLegends/FaciesNoCalcite.stories.js +0 -47
- package/dist/stories/ColorLegends/DiscreteLegends/FaciesNoCalcite.stories.js.map +0 -1
- package/dist/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.js +0 -39
- package/dist/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.js.map +0 -1
- package/dist/stories/ColorLegends/DiscreteLegends/FaultProximityFlag.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/DiscreteLegends/FaultProximityFlag.stories.js +0 -39
- package/dist/stories/ColorLegends/DiscreteLegends/FaultProximityFlag.stories.js.map +0 -1
- package/dist/stories/ColorLegends/DiscreteLegends/RDE.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/DiscreteLegends/RDE.stories.js +0 -42
- package/dist/stories/ColorLegends/DiscreteLegends/RDE.stories.js.map +0 -1
- package/dist/stories/ColorLegends/DiscreteLegends/RDE_Orig.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/DiscreteLegends/RDE_Orig.stories.js +0 -53
- package/dist/stories/ColorLegends/DiscreteLegends/RDE_Orig.stories.js.map +0 -1
- package/dist/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.js +0 -42
- package/dist/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.js.map +0 -1
- package/dist/stories/ColorLegends/DiscreteLegends/Zonelog.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/DiscreteLegends/Zonelog.stories.js +0 -52
- package/dist/stories/ColorLegends/DiscreteLegends/Zonelog.stories.js.map +0 -1
- package/dist/stories/ColorLegends/LegendWithSelector/LegendSelector.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/LegendWithSelector/LegendSelector.stories.js +0 -58
- package/dist/stories/ColorLegends/LegendWithSelector/LegendSelector.stories.js.map +0 -1
- package/src/component/ColorSelector/ColorSelectorAccordion.tsx +0 -54
- package/src/component/ColorSelector/ColorSelectorComponent.tsx +0 -312
- package/src/component/ColorSelector/ColorSelectorWrapper.tsx +0 -119
- package/src/component/Legend/ColorLegend.tsx +0 -106
- package/src/component/Legend/ContinuousLegend.tsx +0 -233
- package/src/component/Legend/DiscreteLegend.tsx +0 -206
- package/src/component/Utils/ColorTableTypes.ts +0 -6
- package/src/component/Utils/continousLegend.ts +0 -73
- package/src/component/Utils/d3ColorScale.ts +0 -84
- package/src/component/Utils/discreteLegend.ts +0 -81
- package/src/component/color-tables.json +0 -203
- package/src/custom.d.ts +0 -1
- package/src/index.ts +0 -26
- package/src/stories/ColorLegends/ColorSelector/Selector.stories.jsx +0 -12
- package/src/stories/ColorLegends/ContinousLegends/MD.stories.jsx +0 -29
- package/src/stories/ColorLegends/ContinousLegends/NTG.stories.jsx +0 -29
- package/src/stories/ColorLegends/ContinousLegends/PermTot.stories.jsx +0 -29
- package/src/stories/ColorLegends/ContinousLegends/Permeability.stories.jsx +0 -29
- package/src/stories/ColorLegends/ContinousLegends/PoroTot.stories.jsx +0 -29
- package/src/stories/ColorLegends/ContinousLegends/Porosity.stories.jsx +0 -29
- package/src/stories/ColorLegends/ContinousLegends/SW.stories.jsx +0 -29
- package/src/stories/ColorLegends/DiscreteLegends/Facies.stories.jsx +0 -39
- package/src/stories/ColorLegends/DiscreteLegends/FaciesNoCalcite.stories.jsx +0 -39
- package/src/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.jsx +0 -31
- package/src/stories/ColorLegends/DiscreteLegends/FaultProximityFlag.stories.jsx +0 -31
- package/src/stories/ColorLegends/DiscreteLegends/RDE.stories.jsx +0 -34
- package/src/stories/ColorLegends/DiscreteLegends/RDE_Orig.stories.jsx +0 -45
- package/src/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.jsx +0 -34
- package/src/stories/ColorLegends/DiscreteLegends/Zonelog.stories.jsx +0 -46
- package/src/stories/ColorLegends/LegendWithSelector/LegendSelector.stories.jsx +0 -51
- package/tsconfig.json +0 -23
|
@@ -1,42 +0,0 @@
|
|
|
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
|
-
};
|
|
12
|
-
import React from "react";
|
|
13
|
-
import { DiscreteColorLegend } from "../../../component/Legend/DiscreteLegend";
|
|
14
|
-
import colorTables from "../../../component/color-tables.json";
|
|
15
|
-
export default {
|
|
16
|
-
component: DiscreteColorLegend,
|
|
17
|
-
title: "Legends/DiscreteColorLegend",
|
|
18
|
-
};
|
|
19
|
-
var discreteData = {
|
|
20
|
-
"0": [[], 0],
|
|
21
|
-
"4": [[], 4],
|
|
22
|
-
"UPPER": [[], 1],
|
|
23
|
-
"MID": [[], 2],
|
|
24
|
-
"LOWER": [[], 3]
|
|
25
|
-
};
|
|
26
|
-
var dataObjectName = "Wells / ZONE_MAIN";
|
|
27
|
-
var position = [16, 10];
|
|
28
|
-
var horizontal = true;
|
|
29
|
-
var colorName = "Stratigraphy";
|
|
30
|
-
var Template = function (args) {
|
|
31
|
-
return React.createElement(DiscreteColorLegend, __assign({}, args));
|
|
32
|
-
};
|
|
33
|
-
export var ZoneMainTemplate = Template.bind({});
|
|
34
|
-
ZoneMainTemplate.args = {
|
|
35
|
-
discreteData: discreteData,
|
|
36
|
-
dataObjectName: dataObjectName,
|
|
37
|
-
position: position,
|
|
38
|
-
colorName: colorName,
|
|
39
|
-
colorTables: colorTables,
|
|
40
|
-
horizontal: horizontal,
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=ZoneMain.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ZoneMain.stories.js","sourceRoot":"","sources":["../../../../src/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.jsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,mBAAmB,EAAC,MAAM,0CAA0C,CAAC;AAC7E,OAAO,WAAW,MAAM,sCAAsC,CAAC;AAE/D,eAAe;IACX,SAAS,EAAE,mBAAmB;IAC9B,KAAK,EAAE,6BAA6B;CACvC,CAAC;AAEF,IAAM,YAAY,GAAG;IACjB,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACZ,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACZ,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAChB,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACd,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;CACnB,CAAC;AACF,IAAM,cAAc,GAAG,mBAAmB,CAAC;AAC3C,IAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC1B,IAAM,UAAU,GAAG,IAAI,CAAC;AACxB,IAAM,SAAS,GAAG,cAAc,CAAC;AAEjC,IAAM,QAAQ,GAAG,UAAC,IAAI;IAClB,OAAO,oBAAC,mBAAmB,eAAK,IAAI,EAAI,CAAC;AAC7C,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,gBAAgB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAClD,gBAAgB,CAAC,IAAI,GAAG;IACpB,YAAY,cAAA;IACZ,cAAc,gBAAA;IACd,QAAQ,UAAA;IACR,SAAS,WAAA;IACT,WAAW,aAAA;IACX,UAAU,YAAA;CACb,CAAC"}
|
|
@@ -1,52 +0,0 @@
|
|
|
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
|
-
};
|
|
12
|
-
import React from "react";
|
|
13
|
-
import { DiscreteColorLegend } from "../../../component/Legend/DiscreteLegend";
|
|
14
|
-
import colorTables from "../../../component/color-tables.json";
|
|
15
|
-
export default {
|
|
16
|
-
component: DiscreteColorLegend,
|
|
17
|
-
title: "Legends/DiscreteColorLegend",
|
|
18
|
-
};
|
|
19
|
-
var discreteData = {
|
|
20
|
-
"Above_BCU": [[], 0],
|
|
21
|
-
"ABOVE": [[], 1],
|
|
22
|
-
"H12": [[], 2],
|
|
23
|
-
"H11": [[], 3],
|
|
24
|
-
"H10": [[], 4],
|
|
25
|
-
"H9": [[], 5],
|
|
26
|
-
"H8": [[], 6],
|
|
27
|
-
"H7": [[], 7],
|
|
28
|
-
"H6": [[], 8],
|
|
29
|
-
"H5": [[], 9],
|
|
30
|
-
"H4": [[], 10],
|
|
31
|
-
"H3": [[], 11],
|
|
32
|
-
"H2": [[], 12],
|
|
33
|
-
"H1": [[], 13],
|
|
34
|
-
"BELOW": [[], 14]
|
|
35
|
-
};
|
|
36
|
-
var dataObjectName = "Wells / ZONELOG";
|
|
37
|
-
var position = [16, 10];
|
|
38
|
-
var horizontal = true;
|
|
39
|
-
var colorName = "Stratigraphy";
|
|
40
|
-
var Template = function (args) {
|
|
41
|
-
return React.createElement(DiscreteColorLegend, __assign({}, args));
|
|
42
|
-
};
|
|
43
|
-
export var ZonelogTemplate = Template.bind({});
|
|
44
|
-
ZonelogTemplate.args = {
|
|
45
|
-
discreteData: discreteData,
|
|
46
|
-
dataObjectName: dataObjectName,
|
|
47
|
-
position: position,
|
|
48
|
-
colorName: colorName,
|
|
49
|
-
colorTables: colorTables,
|
|
50
|
-
horizontal: horizontal,
|
|
51
|
-
};
|
|
52
|
-
//# sourceMappingURL=Zonelog.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Zonelog.stories.js","sourceRoot":"","sources":["../../../../src/stories/ColorLegends/DiscreteLegends/Zonelog.stories.jsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,mBAAmB,EAAC,MAAM,0CAA0C,CAAC;AAC7E,OAAO,WAAW,MAAM,sCAAsC,CAAC;AAE/D,eAAe;IACX,SAAS,EAAE,mBAAmB;IAC9B,KAAK,EAAE,6BAA6B;CACvC,CAAC;AAEF,IAAM,YAAY,GAAG;IACjB,WAAW,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACpB,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAChB,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACd,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACd,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACd,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACb,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACb,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACb,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACb,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACb,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IACd,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IACd,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IACd,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IACd,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;CACpB,CAAC;AACF,IAAM,cAAc,GAAG,iBAAiB,CAAC;AACzC,IAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC1B,IAAM,UAAU,GAAG,IAAI,CAAC;AACxB,IAAM,SAAS,GAAG,cAAc,CAAC;AAEjC,IAAM,QAAQ,GAAG,UAAC,IAAI;IAClB,OAAO,oBAAC,mBAAmB,eAAK,IAAI,EAAI,CAAC;AAC7C,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,eAAe,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACjD,eAAe,CAAC,IAAI,GAAG;IACnB,YAAY,cAAA;IACZ,cAAc,gBAAA;IACd,QAAQ,UAAA;IACR,SAAS,WAAA;IACT,WAAW,aAAA;IACX,UAAU,YAAA;CACb,CAAC"}
|
|
@@ -1,58 +0,0 @@
|
|
|
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
|
-
};
|
|
12
|
-
import React from "react";
|
|
13
|
-
import colorTables from "../../../component/color-tables.json";
|
|
14
|
-
import { ColorLegend } from "../../../component/Legend/ColorLegend";
|
|
15
|
-
export default {
|
|
16
|
-
component: ColorLegend,
|
|
17
|
-
title: "Legends/LegendWithColorSelector",
|
|
18
|
-
};
|
|
19
|
-
// prop for continous legend
|
|
20
|
-
var min = 0;
|
|
21
|
-
var max = 0.35;
|
|
22
|
-
var dataObjectName = "Legend";
|
|
23
|
-
var position = [16, 10];
|
|
24
|
-
var horizontal = true;
|
|
25
|
-
var colorName = "Rainbow";
|
|
26
|
-
// prop for discrete data
|
|
27
|
-
var discreteData = {
|
|
28
|
-
"Above_BCU": [[], 0],
|
|
29
|
-
"ABOVE": [[], 1],
|
|
30
|
-
"H12": [[], 2],
|
|
31
|
-
"H11": [[], 3],
|
|
32
|
-
"H10": [[], 4],
|
|
33
|
-
"H9": [[], 5],
|
|
34
|
-
"H8": [[], 6],
|
|
35
|
-
"H7": [[], 7],
|
|
36
|
-
"H6": [[], 8],
|
|
37
|
-
"H5": [[], 9],
|
|
38
|
-
"H4": [[], 10],
|
|
39
|
-
"H3": [[], 11],
|
|
40
|
-
"H2": [[], 12],
|
|
41
|
-
"H1": [[], 13],
|
|
42
|
-
"BELOW": [[], 14]
|
|
43
|
-
};
|
|
44
|
-
var Template = function (args) {
|
|
45
|
-
return React.createElement(ColorLegend, __assign({}, args));
|
|
46
|
-
};
|
|
47
|
-
export var LegendWithColorSelector = Template.bind({});
|
|
48
|
-
LegendWithColorSelector.args = {
|
|
49
|
-
min: min,
|
|
50
|
-
max: max,
|
|
51
|
-
dataObjectName: dataObjectName,
|
|
52
|
-
position: position,
|
|
53
|
-
horizontal: horizontal,
|
|
54
|
-
colorName: colorName,
|
|
55
|
-
colorTables: colorTables,
|
|
56
|
-
discreteData: discreteData,
|
|
57
|
-
};
|
|
58
|
-
//# sourceMappingURL=LegendSelector.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LegendSelector.stories.js","sourceRoot":"","sources":["../../../../src/stories/ColorLegends/LegendWithSelector/LegendSelector.stories.jsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,WAAW,MAAM,sCAAsC,CAAC;AAC/D,OAAO,EAAC,WAAW,EAAC,MAAM,uCAAuC,CAAC;AAElE,eAAe;IACX,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,iCAAiC;CAC3C,CAAC;AAEF,4BAA4B;AAC5B,IAAM,GAAG,GAAG,CAAC,CAAC;AACd,IAAM,GAAG,GAAG,IAAI,CAAC;AACjB,IAAM,cAAc,GAAG,QAAQ,CAAC;AAChC,IAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC1B,IAAM,UAAU,GAAG,IAAI,CAAC;AACxB,IAAM,SAAS,GAAG,SAAS,CAAC;AAE5B,yBAAyB;AACzB,IAAM,YAAY,GAAG;IACjB,WAAW,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACpB,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAChB,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACd,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACd,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACd,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACb,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACb,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACb,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACb,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACb,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IACd,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IACd,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IACd,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IACd,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;CACpB,CAAC;AAEF,IAAM,QAAQ,GAAG,UAAC,IAAI;IAClB,OAAO,oBAAC,WAAW,eAAK,IAAI,EAAI,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,uBAAuB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzD,uBAAuB,CAAC,IAAI,GAAG;IAC3B,GAAG,KAAA;IACH,GAAG,KAAA;IACH,cAAc,gBAAA;IACd,QAAQ,UAAA;IACR,UAAU,YAAA;IACV,SAAS,WAAA;IACT,WAAW,aAAA;IACX,YAAY,cAAA;CACf,CAAC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Accordion } from "@equinor/eds-core-react";
|
|
3
|
-
import { ColorSelectorWrapper } from "./ColorSelectorWrapper";
|
|
4
|
-
|
|
5
|
-
export const ColorSelectorAccordion = (props: any) => {
|
|
6
|
-
return (
|
|
7
|
-
<div className="Container" style={{width: "316px",
|
|
8
|
-
position: "absolute",
|
|
9
|
-
zIndex: 1,
|
|
10
|
-
top: props.isHorizontal ? 100 : 30,
|
|
11
|
-
right: props.isHorizontal ? 5 : 165,
|
|
12
|
-
}}>
|
|
13
|
-
<Accordion >
|
|
14
|
-
<Accordion.Item isExpanded>
|
|
15
|
-
<Accordion.Header>
|
|
16
|
-
Color Scales
|
|
17
|
-
</Accordion.Header>
|
|
18
|
-
<Accordion.Panel>
|
|
19
|
-
<Accordion >
|
|
20
|
-
<Accordion.Item>
|
|
21
|
-
<Accordion.Header>
|
|
22
|
-
Geologic Color Scale
|
|
23
|
-
</Accordion.Header>
|
|
24
|
-
<Accordion.Panel>
|
|
25
|
-
<ColorSelectorWrapper useColorTableColors={true} colorScaleObject={props}/>
|
|
26
|
-
</Accordion.Panel>
|
|
27
|
-
</Accordion.Item>
|
|
28
|
-
</Accordion>
|
|
29
|
-
<Accordion >
|
|
30
|
-
<Accordion.Item>
|
|
31
|
-
<Accordion.Header>
|
|
32
|
-
D3 Color Scale
|
|
33
|
-
</Accordion.Header>
|
|
34
|
-
<Accordion.Panel>
|
|
35
|
-
<ColorSelectorWrapper useColorTableColors={false} colorScaleObject={props}/>
|
|
36
|
-
</Accordion.Panel>
|
|
37
|
-
</Accordion.Item>
|
|
38
|
-
</Accordion>
|
|
39
|
-
<Accordion >
|
|
40
|
-
<Accordion.Item>
|
|
41
|
-
<Accordion.Header>
|
|
42
|
-
Custom Color Scale
|
|
43
|
-
</Accordion.Header>
|
|
44
|
-
<Accordion.Panel>
|
|
45
|
-
Custom Content
|
|
46
|
-
</Accordion.Panel>
|
|
47
|
-
</Accordion.Item>
|
|
48
|
-
</Accordion>
|
|
49
|
-
</Accordion.Panel>
|
|
50
|
-
</Accordion.Item>
|
|
51
|
-
</Accordion>
|
|
52
|
-
</div>
|
|
53
|
-
);
|
|
54
|
-
};
|
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { useRef } from "react";
|
|
3
|
-
import { RGBToHex } from "../Utils/continousLegend";
|
|
4
|
-
import {d3ColorScales} from "../Utils/d3ColorScale";
|
|
5
|
-
import { select, range} from "d3";
|
|
6
|
-
import * as d3 from "d3";
|
|
7
|
-
import discreteLegendUtil from "../Utils/discreteLegend";
|
|
8
|
-
import { color } from "d3-color";
|
|
9
|
-
|
|
10
|
-
declare type legendProps = {
|
|
11
|
-
position: number[];
|
|
12
|
-
colorsObject?: any;
|
|
13
|
-
legendColor?: any;
|
|
14
|
-
legendColorName?: string | undefined;
|
|
15
|
-
useContColorTable?: boolean;
|
|
16
|
-
useDiscColorTable?: boolean;
|
|
17
|
-
valueIndex?: any;
|
|
18
|
-
colorScaleData: any;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
declare type ItemColor = {
|
|
22
|
-
color: string;
|
|
23
|
-
offset?: number;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export const ColorSelectorComponent: React.FC<legendProps> = ({
|
|
27
|
-
colorsObject,
|
|
28
|
-
legendColor,
|
|
29
|
-
legendColorName,
|
|
30
|
-
useContColorTable,
|
|
31
|
-
useDiscColorTable,
|
|
32
|
-
valueIndex,
|
|
33
|
-
colorScaleData,
|
|
34
|
-
}: legendProps) => {
|
|
35
|
-
|
|
36
|
-
const divRef = useRef<HTMLDivElement>(null);
|
|
37
|
-
// create an array of steps based on the color scale
|
|
38
|
-
// returns an array of evenly-spaced numbers. Returns the integers from zero to the specified end minus one.
|
|
39
|
-
// d3.range(start, stop, step)
|
|
40
|
-
let data: any;
|
|
41
|
-
var extent: any
|
|
42
|
-
if (legendColor) {
|
|
43
|
-
data = range(10).map((d) => ({
|
|
44
|
-
color: legendColor(d / 10),
|
|
45
|
-
value: d,
|
|
46
|
-
}));
|
|
47
|
-
// get the array's min and max value
|
|
48
|
-
extent = d3.extent(data, (d: any) => d?.value);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const handleChange = React.useCallback(() => {
|
|
52
|
-
// continous legend with colortable colors
|
|
53
|
-
if (colorsObject && Object.keys(colorsObject).length > 0 && useContColorTable) {
|
|
54
|
-
colorScaleData ? colorScaleData(colorsObject, true) : null;
|
|
55
|
-
}
|
|
56
|
-
// continous legend with d3 colors
|
|
57
|
-
else if (data && !useContColorTable) {
|
|
58
|
-
const arrayData: any = []
|
|
59
|
-
data.forEach((colorsObject: any) => {
|
|
60
|
-
arrayData.push([0 + "." + colorsObject.value, color(colorsObject.color)?.rgb().r, color(colorsObject.color)?.rgb().g, color(colorsObject.color)?.rgb().b])
|
|
61
|
-
});
|
|
62
|
-
colorScaleData ? colorScaleData({ arrayData, legendColorName }, true) : null;
|
|
63
|
-
}
|
|
64
|
-
// discrete legend with colortable colors
|
|
65
|
-
else if (colorsObject && Object.keys(colorsObject).length > 0 && useDiscColorTable) {
|
|
66
|
-
colorScaleData ? colorScaleData(colorsObject, false) : null;
|
|
67
|
-
}
|
|
68
|
-
// discrete legend with d3 colors
|
|
69
|
-
else {
|
|
70
|
-
colorScaleData ? colorScaleData({colorsObject, legendColorName}, false) : null;
|
|
71
|
-
}
|
|
72
|
-
}, []);
|
|
73
|
-
|
|
74
|
-
React.useEffect(() => {
|
|
75
|
-
// continuous legend using color table colors
|
|
76
|
-
if (useContColorTable == true && divRef.current) {
|
|
77
|
-
contColortableLegend();
|
|
78
|
-
return function cleanup() {
|
|
79
|
-
select(divRef.current).select("svg").remove();
|
|
80
|
-
select(divRef.current).select("div").remove();
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
// discrete legend using color table colors
|
|
84
|
-
if (useDiscColorTable == true && divRef.current) {
|
|
85
|
-
discColorTableLegend();
|
|
86
|
-
return function cleanup() {
|
|
87
|
-
select(divRef.current).select("div").remove();
|
|
88
|
-
select(divRef.current).select("svg").remove();
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
// discrete legend using d3 colors
|
|
92
|
-
if (useDiscColorTable == false && divRef.current) {
|
|
93
|
-
discD3legend();
|
|
94
|
-
return function cleanup() {
|
|
95
|
-
select(divRef.current).select("div").remove();
|
|
96
|
-
select(divRef.current).select("svg").remove();
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
// continuous legend using d3 colors
|
|
100
|
-
else if (useContColorTable == false && divRef.current) {
|
|
101
|
-
contD3Legend();
|
|
102
|
-
return function cleanup() {
|
|
103
|
-
select(divRef.current).select("svg").remove();
|
|
104
|
-
select(divRef.current).select("div").remove();
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
}, [useContColorTable]);
|
|
108
|
-
|
|
109
|
-
// continuous legend using color table colors (using linear gradiend)
|
|
110
|
-
function contColortableLegend() {
|
|
111
|
-
const itemColor: ItemColor[] = [];
|
|
112
|
-
|
|
113
|
-
colorsObject.color.forEach((value: [number, number, number, number]) => {
|
|
114
|
-
// return the color and offset needed to draw the legend
|
|
115
|
-
itemColor.push({
|
|
116
|
-
offset: RGBToHex(value).offset,
|
|
117
|
-
color: RGBToHex(value).color,
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
// append a defs (for definition) element to your SVG
|
|
122
|
-
const svgLegend = select(divRef.current)
|
|
123
|
-
.append("svg")
|
|
124
|
-
.style("height", "30px")
|
|
125
|
-
|
|
126
|
-
const defs = svgLegend.append("defs");
|
|
127
|
-
const currentIndex = "linear-gradient-" + valueIndex;
|
|
128
|
-
// append a linearGradient element to the defs and give it a unique id
|
|
129
|
-
const linearGradient = defs
|
|
130
|
-
.append("linearGradient")
|
|
131
|
-
.attr("id", currentIndex)
|
|
132
|
-
.attr("x1", "0%")
|
|
133
|
-
.attr("x2", "100%") //since it's a horizontal linear gradient
|
|
134
|
-
.attr("y1", "0%")
|
|
135
|
-
.attr("y2", "0%");
|
|
136
|
-
// append multiple color stops by using D3's data/enter step
|
|
137
|
-
|
|
138
|
-
linearGradient
|
|
139
|
-
.selectAll("stop")
|
|
140
|
-
.data(itemColor)
|
|
141
|
-
.enter()
|
|
142
|
-
.append("stop")
|
|
143
|
-
.attr("offset", function (data) {
|
|
144
|
-
return data.offset + "%";
|
|
145
|
-
})
|
|
146
|
-
.attr("stop-color", function (data) {
|
|
147
|
-
return data.color;
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
// append title
|
|
151
|
-
svgLegend
|
|
152
|
-
.append("text")
|
|
153
|
-
.attr("id", "legendTitle")
|
|
154
|
-
.attr("x", 0)
|
|
155
|
-
.attr("y", 15)
|
|
156
|
-
.style("font-size", "smaller")
|
|
157
|
-
.style("font-weight", "900")
|
|
158
|
-
.text(colorsObject.name);
|
|
159
|
-
|
|
160
|
-
// draw the rectangle and fill with gradient
|
|
161
|
-
svgLegend
|
|
162
|
-
.append("rect")
|
|
163
|
-
.attr("x", 85)
|
|
164
|
-
.attr("y", 5)
|
|
165
|
-
.attr("width", "110")
|
|
166
|
-
.attr("height", 20)
|
|
167
|
-
.style("fill", "url(#"+currentIndex+")");
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
// continuous legend using d3 colors (using linear gradiend)
|
|
171
|
-
function contD3Legend() {
|
|
172
|
-
const itemColor: any = [];
|
|
173
|
-
|
|
174
|
-
d3ColorScales.forEach((value: any) => {
|
|
175
|
-
// return the color and offset needed to draw the legend
|
|
176
|
-
itemColor.push(value.colors);
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
// append a defs (for definition) element to your SVG
|
|
180
|
-
const svgLegend = select(divRef.current)
|
|
181
|
-
.append("svg")
|
|
182
|
-
.style("height", "50px")
|
|
183
|
-
|
|
184
|
-
const defs = svgLegend.append("defs");
|
|
185
|
-
const currentIndex = "linear-gradient-" + valueIndex;
|
|
186
|
-
// append a linearGradient element to the defs and give it a unique id
|
|
187
|
-
const linearGradient = defs
|
|
188
|
-
.append("linearGradient")
|
|
189
|
-
.attr("id", currentIndex)
|
|
190
|
-
.attr("x1", "0%")
|
|
191
|
-
.attr("x2", "100%") //since it's a horizontal linear gradient
|
|
192
|
-
.attr("y1", "0%")
|
|
193
|
-
.attr("y2", "0%");
|
|
194
|
-
|
|
195
|
-
// append multiple color stops by using D3's data/enter step
|
|
196
|
-
linearGradient.selectAll("stop")
|
|
197
|
-
.data(data)
|
|
198
|
-
.enter().append("stop")
|
|
199
|
-
.attr("offset", (d: any) => ((d.value - extent[0]) / (extent[1] - extent[0]) * 100) + "%")
|
|
200
|
-
.attr("stop-color", (d: any) => d.color);
|
|
201
|
-
|
|
202
|
-
// append title
|
|
203
|
-
svgLegend
|
|
204
|
-
.append("text")
|
|
205
|
-
.attr("id", "legendTitle")
|
|
206
|
-
.attr("x", 0)
|
|
207
|
-
.attr("y", 15)
|
|
208
|
-
.style("font-size", "smaller")
|
|
209
|
-
.style("font-weight", "900")
|
|
210
|
-
.text(legendColorName ? legendColorName : '');
|
|
211
|
-
|
|
212
|
-
// draw the rectangle and fill with gradient
|
|
213
|
-
svgLegend
|
|
214
|
-
.append("rect")
|
|
215
|
-
.attr("x", 85)
|
|
216
|
-
.attr("y", 5)
|
|
217
|
-
.attr("width", "110")
|
|
218
|
-
.attr("height", 20)
|
|
219
|
-
.style("fill", "url(#"+currentIndex+")");
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// discrete legend using color table colors
|
|
223
|
-
function discColorTableLegend() {
|
|
224
|
-
const itemColor: ItemColor[] = [];
|
|
225
|
-
const itemName: any = [];
|
|
226
|
-
|
|
227
|
-
colorsObject.color.forEach((element: any, key: any) => {
|
|
228
|
-
itemColor.push({color: RGBToHex(element)});
|
|
229
|
-
itemName.push(key);
|
|
230
|
-
})
|
|
231
|
-
|
|
232
|
-
function RGBToHex(rgb: number[]) {
|
|
233
|
-
let r = rgb[1].toString(16),
|
|
234
|
-
g = rgb[2].toString(16),
|
|
235
|
-
b = rgb[3].toString(16);
|
|
236
|
-
if (r.length == 1) r = "0" + r;
|
|
237
|
-
if (g.length == 1) g = "0" + g;
|
|
238
|
-
if (b.length == 1) b = "0" + b;
|
|
239
|
-
return "#" + r + g + b;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
//const ordinalValues = scaleOrdinal().domain(itemName);
|
|
243
|
-
let count = itemName.length
|
|
244
|
-
const colorLegend = discreteLegendUtil(itemColor, true)
|
|
245
|
-
//const calcLegendHeight = 22 * itemColor.length + 4 * itemColor.length;
|
|
246
|
-
const selectedLegend = select(divRef.current);
|
|
247
|
-
// colorname as label for the legend (ex: facies)
|
|
248
|
-
selectedLegend
|
|
249
|
-
.append("label")
|
|
250
|
-
.text(legendColorName ? legendColorName : '')
|
|
251
|
-
.attr("y", 7)
|
|
252
|
-
.style("float", "left")
|
|
253
|
-
.style("width", "15px")
|
|
254
|
-
.style("margin", "10px 0px")
|
|
255
|
-
.style("white-space", "nowrap")
|
|
256
|
-
.style("font-size", "smaller")
|
|
257
|
-
.style("font-weight", "900")
|
|
258
|
-
|
|
259
|
-
selectedLegend
|
|
260
|
-
.append("svg")
|
|
261
|
-
.style("margin-top", "13px")
|
|
262
|
-
.style("margin-left", "70px")
|
|
263
|
-
.attr("viewBox", `0 0 ${count} 1`)
|
|
264
|
-
.attr("preserveAspectRatio", "none")
|
|
265
|
-
|
|
266
|
-
.style("width", "109px")
|
|
267
|
-
.style("height", "20px")
|
|
268
|
-
.call(colorLegend);
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
// discrete legend using d3 colors
|
|
272
|
-
function discD3legend() {
|
|
273
|
-
const itemName: any = [];
|
|
274
|
-
const itemColor: any = [];
|
|
275
|
-
colorsObject.forEach((element: any, key: any) => {
|
|
276
|
-
itemColor.push({color: element});
|
|
277
|
-
itemName.push(key);
|
|
278
|
-
});
|
|
279
|
-
//const ordinalValues = scaleOrdinal(colorsObject).domain(itemName);
|
|
280
|
-
const count = itemName.length
|
|
281
|
-
const discreteLegend = discreteLegendUtil(itemColor, true);
|
|
282
|
-
select("svg").append("g").attr("transform", "translate(50,70)").attr("class", "legend").call(discreteLegend);
|
|
283
|
-
const selectedLegend = select(divRef.current);
|
|
284
|
-
selectedLegend
|
|
285
|
-
.append("text")
|
|
286
|
-
.text(legendColorName ? legendColorName : '')
|
|
287
|
-
.attr("y", 7)
|
|
288
|
-
.style("float", "left")
|
|
289
|
-
.style("width", "15px")
|
|
290
|
-
.style("margin", "10px 0px")
|
|
291
|
-
.style("font-size", "smaller")
|
|
292
|
-
.style("font-weight", "900");
|
|
293
|
-
selectedLegend
|
|
294
|
-
.append("svg")
|
|
295
|
-
.style("margin-top", "13px")
|
|
296
|
-
.style("margin-left", "70px")
|
|
297
|
-
.style("background", "grey")
|
|
298
|
-
.attr("viewBox", `0 0 ${count} 1`)
|
|
299
|
-
.attr("preserveAspectRatio", "none")
|
|
300
|
-
|
|
301
|
-
.style("width", "109px")
|
|
302
|
-
.style("height", "20px")
|
|
303
|
-
.call(discreteLegend);
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
return (
|
|
307
|
-
<div>
|
|
308
|
-
<div id="legend" style={{height: 30}}
|
|
309
|
-
ref={divRef} onClick={handleChange}></div>
|
|
310
|
-
</div>
|
|
311
|
-
);
|
|
312
|
-
};
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
const colorTables = require("../color-tables.json");
|
|
3
|
-
import {d3ColorScales} from "../Utils/d3ColorScale";
|
|
4
|
-
import {ColorSelectorComponent} from "./ColorSelectorComponent";
|
|
5
|
-
|
|
6
|
-
const position = [16, 206];
|
|
7
|
-
const continuosColorData: any = [];
|
|
8
|
-
const continuosD3ColorData: any = [];
|
|
9
|
-
const discreteColorData: any = [];
|
|
10
|
-
const discreteD3ColorData: any = [];
|
|
11
|
-
|
|
12
|
-
declare type legendProps = {
|
|
13
|
-
useColorTableColors: boolean,
|
|
14
|
-
colorScaleObject: any
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// Continuous legend using color table data
|
|
18
|
-
const colorTableContinuousData = colorTables.filter((element: any) => {
|
|
19
|
-
return element.discrete == false;
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
colorTableContinuousData.forEach((element: any) => {
|
|
23
|
-
continuosColorData.push({color: element.colors, name: element.name});
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
// Continuous legend using d3 data
|
|
27
|
-
const d3continuousData = d3ColorScales.filter((element: any) => {
|
|
28
|
-
return element.discrete == false;
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
d3continuousData.forEach((element: any) => {
|
|
32
|
-
continuosD3ColorData.push({color: element.colors, name: element.name});
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
// Discrete legend using color table data
|
|
36
|
-
const discreteData = colorTables.filter((element: any) => {
|
|
37
|
-
return element.discrete == true;
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
discreteData.forEach((element: any) => {
|
|
41
|
-
discreteColorData.push({color: element.colors, name: element.name});
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
// Discrete legend using d3 data
|
|
45
|
-
const d3discreteData = d3ColorScales.filter((element: any) => {
|
|
46
|
-
return element.discrete == true;
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
d3discreteData.forEach((element: any) => {
|
|
50
|
-
discreteD3ColorData.push({color: element.colors, name: element.name});
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
export const ColorSelectorWrapper: React.FC<legendProps> = ({
|
|
54
|
-
useColorTableColors,
|
|
55
|
-
colorScaleObject,
|
|
56
|
-
}: legendProps) => {
|
|
57
|
-
let continuousLegend;
|
|
58
|
-
let discreteLegend;
|
|
59
|
-
|
|
60
|
-
// return continuous and discrete legend which uses d3 data
|
|
61
|
-
if (!useColorTableColors) {
|
|
62
|
-
|
|
63
|
-
continuousLegend = continuosD3ColorData.map((val: any, key: any) => {
|
|
64
|
-
return <ColorSelectorComponent
|
|
65
|
-
position={position + key}
|
|
66
|
-
legendColor={val.color}
|
|
67
|
-
legendColorName={val.name}
|
|
68
|
-
useContColorTable={false}
|
|
69
|
-
valueIndex={key + "0"}
|
|
70
|
-
colorScaleData={colorScaleObject.colorScaleObject}
|
|
71
|
-
/>
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
discreteLegend = d3discreteData.map((val: any, key: any) => {
|
|
75
|
-
return <ColorSelectorComponent
|
|
76
|
-
position={position + key}
|
|
77
|
-
colorsObject={val.colors}
|
|
78
|
-
legendColorName={val.name}
|
|
79
|
-
useDiscColorTable={false}
|
|
80
|
-
colorScaleData={colorScaleObject.colorScaleObject}
|
|
81
|
-
/>
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// return continuous and discrete legend which uses colortable data
|
|
86
|
-
else if (useColorTableColors) {
|
|
87
|
-
continuousLegend = continuosColorData.map((value: any, key: any) => {
|
|
88
|
-
return <div>
|
|
89
|
-
<ColorSelectorComponent
|
|
90
|
-
position={position + key}
|
|
91
|
-
colorsObject={value}
|
|
92
|
-
useContColorTable={true}
|
|
93
|
-
valueIndex={key}
|
|
94
|
-
colorScaleData={colorScaleObject.colorScaleObject}
|
|
95
|
-
/>
|
|
96
|
-
</div>
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
discreteLegend = discreteColorData.map((val: any, key: any) => {
|
|
100
|
-
return <ColorSelectorComponent
|
|
101
|
-
position={position + key}
|
|
102
|
-
colorsObject={discreteColorData[key]}
|
|
103
|
-
legendColorName={val.name}
|
|
104
|
-
useDiscColorTable={true}
|
|
105
|
-
colorScaleData={colorScaleObject.colorScaleObject}
|
|
106
|
-
/>
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
//}
|
|
110
|
-
|
|
111
|
-
return (
|
|
112
|
-
<div className="legendWrapper"
|
|
113
|
-
style={{height: 200, overflow: "auto", display: "flex", flexDirection: "column", overflowX: "hidden"}}
|
|
114
|
-
>
|
|
115
|
-
{continuousLegend}
|
|
116
|
-
{discreteLegend}
|
|
117
|
-
</div>
|
|
118
|
-
);
|
|
119
|
-
};
|