@emerson-eps/color-tables 0.2.2 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/.vscode/settings.json +3 -0
  2. package/dist/component/ColorSelector/ColorSelectorAccordion.d.ts +2 -0
  3. package/dist/component/ColorSelector/{ColorTableSelectorWrapper.js → ColorSelectorAccordion.js} +12 -7
  4. package/dist/component/ColorSelector/ColorSelectorAccordion.js.map +1 -0
  5. package/dist/component/ColorSelector/ColorSelectorComponent.d.ts +12 -3
  6. package/dist/component/ColorSelector/ColorSelectorComponent.js +255 -51
  7. package/dist/component/ColorSelector/ColorSelectorComponent.js.map +1 -1
  8. package/dist/component/ColorSelector/ColorSelectorWrapper.d.ts +8 -0
  9. package/dist/component/ColorSelector/ColorSelectorWrapper.js +65 -0
  10. package/dist/component/ColorSelector/ColorSelectorWrapper.js.map +1 -0
  11. package/dist/component/Legend/ColorLegend.d.ts +13 -0
  12. package/dist/component/Legend/ColorLegend.js +27 -0
  13. package/dist/component/Legend/ColorLegend.js.map +1 -0
  14. package/dist/component/Legend/ContinuousLegend.d.ts +1 -0
  15. package/dist/component/Legend/ContinuousLegend.js +192 -82
  16. package/dist/component/Legend/ContinuousLegend.js.map +1 -1
  17. package/dist/component/Legend/DiscreteLegend.d.ts +2 -0
  18. package/dist/component/Legend/DiscreteLegend.js +166 -69
  19. package/dist/component/Legend/DiscreteLegend.js.map +1 -1
  20. package/dist/component/Utils/continousLegend.js +14 -12
  21. package/dist/component/Utils/continousLegend.js.map +1 -1
  22. package/dist/component/Utils/d3ColorScale.js +1 -1
  23. package/dist/component/Utils/d3ColorScale.js.map +1 -1
  24. package/dist/component/Utils/discreteLegend.d.ts +1 -1
  25. package/dist/component/Utils/discreteLegend.js +70 -50
  26. package/dist/component/Utils/discreteLegend.js.map +1 -1
  27. package/dist/component/color-tables.json +4 -4
  28. package/dist/stories/ColorLegends/ColorSelector/Selector.stories.d.ts +2 -2
  29. package/dist/stories/ColorLegends/ColorSelector/Selector.stories.js +5 -5
  30. package/dist/stories/ColorLegends/ColorSelector/Selector.stories.js.map +1 -1
  31. package/dist/stories/ColorLegends/ContinousLegends/MD.stories.js +27 -16
  32. package/dist/stories/ColorLegends/ContinousLegends/MD.stories.js.map +1 -1
  33. package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.js +27 -16
  34. package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.js.map +1 -1
  35. package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.js +27 -16
  36. package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.js.map +1 -1
  37. package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.js +27 -16
  38. package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.js.map +1 -1
  39. package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.js +27 -16
  40. package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.js.map +1 -1
  41. package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.js +27 -16
  42. package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.js.map +1 -1
  43. package/dist/stories/ColorLegends/ContinousLegends/SW.stories.js +27 -16
  44. package/dist/stories/ColorLegends/ContinousLegends/SW.stories.js.map +1 -1
  45. package/dist/stories/ColorLegends/DiscreteLegends/Facies.stories.js +35 -24
  46. package/dist/stories/ColorLegends/DiscreteLegends/Facies.stories.js.map +1 -1
  47. package/dist/stories/ColorLegends/DiscreteLegends/FaciesNoCalcite.stories.js +25 -14
  48. package/dist/stories/ColorLegends/DiscreteLegends/FaciesNoCalcite.stories.js.map +1 -1
  49. package/dist/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.js +25 -14
  50. package/dist/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.js.map +1 -1
  51. package/dist/stories/ColorLegends/DiscreteLegends/FaultProximityFlag.stories.js +25 -14
  52. package/dist/stories/ColorLegends/DiscreteLegends/FaultProximityFlag.stories.js.map +1 -1
  53. package/dist/stories/ColorLegends/DiscreteLegends/RDE.stories.js +25 -14
  54. package/dist/stories/ColorLegends/DiscreteLegends/RDE.stories.js.map +1 -1
  55. package/dist/stories/ColorLegends/DiscreteLegends/RDE_Orig.stories.js +25 -14
  56. package/dist/stories/ColorLegends/DiscreteLegends/RDE_Orig.stories.js.map +1 -1
  57. package/dist/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.js +25 -14
  58. package/dist/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.js.map +1 -1
  59. package/dist/stories/ColorLegends/DiscreteLegends/Zonelog.stories.js +25 -14
  60. package/dist/stories/ColorLegends/DiscreteLegends/Zonelog.stories.js.map +1 -1
  61. package/dist/stories/ColorLegends/LegendWithSelector/DiscreteLegendWithSelector.stories.d.ts +7 -0
  62. package/dist/stories/ColorLegends/LegendWithSelector/DiscreteLegendWithSelector.stories.js +52 -0
  63. package/dist/stories/ColorLegends/LegendWithSelector/DiscreteLegendWithSelector.stories.js.map +1 -0
  64. package/dist/stories/ColorLegends/LegendWithSelector/LegendWithSelector.stories.d.ts +7 -0
  65. package/dist/stories/ColorLegends/LegendWithSelector/LegendWithSelector.stories.js +38 -0
  66. package/dist/stories/ColorLegends/LegendWithSelector/LegendWithSelector.stories.js.map +1 -0
  67. package/dist/stories/ColorLegends/SingleComponent/Single.stories.d.ts +7 -0
  68. package/dist/stories/ColorLegends/SingleComponent/Single.stories.js +58 -0
  69. package/dist/stories/ColorLegends/SingleComponent/Single.stories.js.map +1 -0
  70. package/package.json +4 -3
  71. package/src/component/ColorSelector/{ColorTableSelectorWrapper.tsx → ColorSelectorAccordion.tsx} +11 -6
  72. package/src/component/ColorSelector/ColorSelectorComponent.tsx +308 -93
  73. package/src/component/ColorSelector/ColorSelectorWrapper.tsx +118 -0
  74. package/src/component/Legend/ColorLegend.tsx +81 -0
  75. package/src/component/Legend/ContinuousLegend.tsx +163 -79
  76. package/src/component/Legend/DiscreteLegend.tsx +128 -61
  77. package/src/component/Utils/continousLegend.ts +1 -1
  78. package/src/component/Utils/discreteLegend.ts +77 -52
  79. package/src/component/color-tables.json +4 -4
  80. package/src/stories/ColorLegends/ColorSelector/Selector.stories.jsx +3 -3
  81. package/src/stories/ColorLegends/DiscreteLegends/Facies.stories.jsx +39 -39
  82. package/src/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.jsx +1 -1
  83. package/src/stories/ColorLegends/LegendWithSelector/DiscreteLegendWithSelector.stories.jsx +44 -0
  84. package/src/stories/ColorLegends/LegendWithSelector/LegendWithSelector.stories.jsx +30 -0
  85. package/src/stories/ColorLegends/SingleComponent/Single.stories.jsx +51 -0
  86. package/tsconfig.json +1 -1
  87. package/dist/component/ColorSelector/ColorTableSelectorWrapper.d.ts +0 -2
  88. package/dist/component/ColorSelector/ColorTableSelectorWrapper.js.map +0 -1
  89. package/dist/component/ColorSelector/legendComponent.d.ts +0 -14
  90. package/dist/component/ColorSelector/legendComponent.js +0 -228
  91. package/dist/component/ColorSelector/legendComponent.js.map +0 -1
  92. package/src/component/ColorSelector/legendComponent.tsx +0 -289
@@ -0,0 +1,3 @@
1
+ {
2
+ "git.ignoreLimitWarning": true
3
+ }
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const ColorSelectorAccordion: (props: any) => JSX.Element;
@@ -1,25 +1,30 @@
1
1
  import * as React from "react";
2
2
  import { Accordion } from "@equinor/eds-core-react";
3
- import { ColorSelector } from "./ColorSelectorComponent";
4
- export const ColorSelectorWrapper = () => {
5
- return (React.createElement("div", { style: { width: "650px" } },
3
+ import { ColorSelectorWrapper } from "./ColorSelectorWrapper";
4
+ export var ColorSelectorAccordion = function (props) {
5
+ return (React.createElement("div", { className: "Container", style: { width: "316px",
6
+ position: "absolute",
7
+ zIndex: 1,
8
+ top: 150,
9
+ right: 5,
10
+ } },
6
11
  React.createElement(Accordion, null,
7
- React.createElement(Accordion.Item, null,
12
+ React.createElement(Accordion.Item, { isExpanded: true },
8
13
  React.createElement(Accordion.Header, null, "Color Scales"),
9
14
  React.createElement(Accordion.Panel, null,
10
15
  React.createElement(Accordion, null,
11
16
  React.createElement(Accordion.Item, null,
12
17
  React.createElement(Accordion.Header, null, "Geologic Color Scale"),
13
18
  React.createElement(Accordion.Panel, null,
14
- React.createElement(ColorSelector, { useColorTableColors: true, useD3Colors: false })))),
19
+ React.createElement(ColorSelectorWrapper, { useColorTableColors: true, useD3Colors: false, colorScaleObject: props })))),
15
20
  React.createElement(Accordion, null,
16
21
  React.createElement(Accordion.Item, null,
17
22
  React.createElement(Accordion.Header, null, "D3 Color Scale"),
18
23
  React.createElement(Accordion.Panel, null,
19
- React.createElement(ColorSelector, { useColorTableColors: false, useD3Colors: true })))),
24
+ React.createElement(ColorSelectorWrapper, { useD3Colors: true, useColorTableColors: false, colorScaleObject: props })))),
20
25
  React.createElement(Accordion, null,
21
26
  React.createElement(Accordion.Item, null,
22
27
  React.createElement(Accordion.Header, null, "Custom Color Scale"),
23
28
  React.createElement(Accordion.Panel, null, "Custom Content"))))))));
24
29
  };
25
- //# sourceMappingURL=ColorTableSelectorWrapper.js.map
30
+ //# sourceMappingURL=ColorSelectorAccordion.js.map
@@ -0,0 +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,GAAG;YACR,KAAK,EAAE,CAAC;SACP;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,WAAW,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,GAAG,CACjF,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,WAAW,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,GAAG,CACjF,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,7 +1,16 @@
1
1
  import * as React from "react";
2
+ import { colorTablesArray } from "../ColorTableTypes";
2
3
  interface legendProps {
3
- useColorTableColors: boolean;
4
- useD3Colors: boolean;
4
+ position: number[];
5
+ colorsObject?: any;
6
+ legendColor?: any;
7
+ legendColorName?: string | undefined;
8
+ useContColorTable?: boolean;
9
+ useDiscColorTable?: boolean;
10
+ valueIndex?: any;
11
+ colorScaleData: any;
12
+ getColorMapname?: any | null;
5
13
  }
6
- export declare const ColorSelector: React.FC<legendProps>;
14
+ export declare const ColorSelectorComponent: React.FC<legendProps>;
15
+ export declare function colorTableData(colorName: string, colorTables: colorTablesArray): [number, number, number, number][];
7
16
  export {};
@@ -1,62 +1,266 @@
1
1
  import * as React from "react";
2
- import * as colorTables from "../color-tables.json";
2
+ import { useRef } from "react";
3
+ import { RGBToHex } from "../Utils/continousLegend";
3
4
  import { d3ColorScales } from "../Utils/d3ColorScale";
4
- import { LegendComponent } from "./legendComponent";
5
- const position = [16, 206];
6
- const continuosColorData = [];
7
- const continuosD3ColorData = [];
8
- const discreteColorData = [];
9
- const discreteD3ColorData = [];
10
- // code is for color table continuous data
11
- var colorTableContinuousData = colorTables.filter((element) => {
12
- return element.discrete == false;
13
- });
14
- colorTableContinuousData.forEach((element) => {
15
- continuosColorData.push({ color: element.colors, name: element.name });
16
- });
17
- // code is for d3 continuous data
18
- var d3continuousData = d3ColorScales.filter((element) => {
19
- return element.discrete == false;
20
- });
21
- d3continuousData.forEach((element) => {
22
- continuosD3ColorData.push({ color: element.colors, name: element.name });
23
- });
24
- // code is for color table discrete data
25
- var discreteData = colorTables.filter((element) => {
26
- return element.discrete == true;
27
- });
28
- discreteData.forEach((element) => {
29
- discreteColorData.push({ color: element.colors, name: element.name });
30
- });
31
- // code is for color table d3 discrete data
32
- var d3discreteData = d3ColorScales.filter((element) => {
33
- return element.discrete == true;
34
- });
35
- d3discreteData.forEach((element) => {
36
- discreteD3ColorData.push({ color: element.colors, name: element.name });
37
- });
38
- export const ColorSelector = ({ useColorTableColors, useD3Colors, }) => {
39
- let continuousLegend;
40
- let discreteLegend;
41
- if (useColorTableColors) {
42
- continuousLegend = continuosColorData.map((value, key) => {
43
- return React.createElement("div", null,
44
- React.createElement(LegendComponent, { position: position + key, colorsObject: value, legendColor: '', legendColorName: '', useContColorTable: true, valueIndex: key }));
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
+ 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;
13
+ var divRef = useRef(null);
14
+ // create an array of steps based on the color scale
15
+ // returns an array of evenly-spaced numbers. Returns the integers from zero to the specified end minus one.
16
+ // d3.range(start, stop, step)
17
+ if (legendColor) {
18
+ var data = range(10).map(function (d) { return ({ color: legendColor(d / 10), value: d }); });
19
+ // get the array's min and max value
20
+ var extent = d3.extent(data, function (d) { return d.value; });
21
+ }
22
+ var handleChange = React.useCallback(function () {
23
+ // continous legend with colortable colors
24
+ if (colorsObject && Object.keys(colorsObject).length > 0 && useContColorTable) {
25
+ colorScaleData(colorsObject, true);
26
+ }
27
+ // continous legend with d3 colors
28
+ else if (data && !useContColorTable) {
29
+ var arrayData_1 = [];
30
+ data.forEach(function (colorsObject) {
31
+ var _a, _b, _c;
32
+ 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]);
33
+ });
34
+ colorScaleData(arrayData_1, true);
35
+ }
36
+ // discrete legend with colortable colors
37
+ else if (colorsObject && Object.keys(colorsObject).length > 0 && useDiscColorTable) {
38
+ colorScaleData(colorsObject, false);
39
+ }
40
+ // discrete legend with d3 colors
41
+ else {
42
+ colorScaleData({ colorsObject: colorsObject, legendColorName: legendColorName }, false);
43
+ }
44
+ }, []);
45
+ React.useEffect(function () {
46
+ // continuous legend using color table colors
47
+ if (useContColorTable == true && divRef.current) {
48
+ contColortableLegend();
49
+ return function cleanup() {
50
+ select(divRef.current).select("svg").remove();
51
+ select(divRef.current).select("div").remove();
52
+ };
53
+ }
54
+ // discrete legend using color table colors
55
+ if (useDiscColorTable == true && divRef.current) {
56
+ discColorTableLegend();
57
+ return function cleanup() {
58
+ select(divRef.current).select("div").remove();
59
+ select(divRef.current).select("svg").remove();
60
+ };
61
+ }
62
+ // discrete legend using d3 colors
63
+ if (useDiscColorTable == false && divRef.current) {
64
+ discD3legend();
65
+ return function cleanup() {
66
+ select(divRef.current).select("div").remove();
67
+ select(divRef.current).select("svg").remove();
68
+ };
69
+ }
70
+ // continuous legend using d3 colors
71
+ else if (useContColorTable == false && divRef.current) {
72
+ contD3Legend();
73
+ return function cleanup() {
74
+ select(divRef.current).select("svg").remove();
75
+ select(divRef.current).select("div").remove();
76
+ };
77
+ }
78
+ }, [useContColorTable]);
79
+ // continuous legend using color table colors (using linear gradiend)
80
+ function contColortableLegend() {
81
+ var itemColor = [];
82
+ colorsObject.color.forEach(function (value) {
83
+ // return the color and offset needed to draw the legend
84
+ itemColor.push({
85
+ offset: RGBToHex(value).offset,
86
+ color: RGBToHex(value).color,
87
+ });
88
+ });
89
+ // append a defs (for definition) element to your SVG
90
+ var svgLegend = select(divRef.current)
91
+ .append("svg")
92
+ .style("height", "30px");
93
+ var defs = svgLegend.append("defs");
94
+ var currentIndex = "linear-gradient-" + valueIndex;
95
+ // append a linearGradient element to the defs and give it a unique id
96
+ var linearGradient = defs
97
+ .append("linearGradient")
98
+ .attr("id", currentIndex)
99
+ .attr("x1", "0%")
100
+ .attr("x2", "100%") //since it's a horizontal linear gradient
101
+ .attr("y1", "0%")
102
+ .attr("y2", "0%");
103
+ // append multiple color stops by using D3's data/enter step
104
+ linearGradient
105
+ .selectAll("stop")
106
+ .data(itemColor)
107
+ .enter()
108
+ .append("stop")
109
+ .attr("offset", function (data) {
110
+ return data.offset + "%";
111
+ })
112
+ .attr("stop-color", function (data) {
113
+ return data.color;
45
114
  });
46
- discreteLegend = discreteColorData.map((val, key) => {
47
- return React.createElement(LegendComponent, { legendColorName: val.name, position: position, colorsObject: discreteColorData[key], useDiscColorTable: true });
115
+ // append title
116
+ svgLegend
117
+ .append("text")
118
+ .attr("id", "legendTitle")
119
+ .attr("x", 0)
120
+ .attr("y", 15)
121
+ .style("font-size", "smaller")
122
+ .style("font-weight", "900")
123
+ // .attr("textLength","5em")
124
+ .text(colorsObject.name);
125
+ // draw the rectangle and fill with gradient
126
+ svgLegend
127
+ .append("rect")
128
+ .attr("x", 85)
129
+ .attr("y", 5)
130
+ .attr("width", "110")
131
+ .attr("height", 20)
132
+ .style("fill", "url(#" + currentIndex + ")");
133
+ }
134
+ // continuous legend using d3 colors (using linear gradiend)
135
+ function contD3Legend() {
136
+ var itemColor = [];
137
+ d3ColorScales.forEach(function (value) {
138
+ // return the color and offset needed to draw the legend
139
+ itemColor.push(value.colors);
48
140
  });
141
+ // append a defs (for definition) element to your SVG
142
+ var svgLegend = select(divRef.current)
143
+ .append("svg")
144
+ .style("height", "50px");
145
+ var defs = svgLegend.append("defs");
146
+ var currentIndex = "linear-gradient-" + valueIndex;
147
+ // append a linearGradient element to the defs and give it a unique id
148
+ var linearGradient = defs
149
+ .append("linearGradient")
150
+ .attr("id", currentIndex)
151
+ .attr("x1", "0%")
152
+ .attr("x2", "100%") //since it's a horizontal linear gradient
153
+ .attr("y1", "0%")
154
+ .attr("y2", "0%");
155
+ // append multiple color stops by using D3's data/enter step
156
+ linearGradient.selectAll("stop")
157
+ .data(data)
158
+ .enter().append("stop")
159
+ .attr("offset", function (d) { return ((d.value - extent[0]) / (extent[1] - extent[0]) * 100) + "%"; })
160
+ .attr("stop-color", function (d) { return d.color; });
161
+ // append title
162
+ svgLegend
163
+ .append("text")
164
+ .attr("id", "legendTitle")
165
+ .attr("x", 0)
166
+ .attr("y", 15)
167
+ .style("font-size", "smaller")
168
+ .style("font-weight", "900")
169
+ .text(legendColorName ? legendColorName : '');
170
+ // draw the rectangle and fill with gradient
171
+ svgLegend
172
+ .append("rect")
173
+ .attr("x", 85)
174
+ .attr("y", 5)
175
+ .attr("width", "110")
176
+ .attr("height", 20)
177
+ .style("fill", "url(#" + currentIndex + ")");
49
178
  }
50
- if (useD3Colors) {
51
- continuousLegend = continuosD3ColorData.map((val, key) => {
52
- return React.createElement(LegendComponent, { position: position + key, colorsObject: {}, legendColor: val.color, legendColorName: val.name, useContColorTable: false, valueIndex: key + "0" });
179
+ // discrete legend using color table colors
180
+ function discColorTableLegend() {
181
+ var itemColor = [];
182
+ var itemName = [];
183
+ colorsObject.color.forEach(function (element, key) {
184
+ itemColor.push({ color: RGBToHex(element) });
185
+ itemName.push(key);
53
186
  });
54
- discreteLegend = d3discreteData.map((val) => {
55
- return React.createElement(LegendComponent, { legendColorName: val.name, position: position, colorsObject: val.colors, useDiscColorTable: false });
187
+ function RGBToHex(rgb) {
188
+ var r = rgb[1].toString(16), g = rgb[2].toString(16), b = rgb[3].toString(16);
189
+ if (r.length == 1)
190
+ r = "0" + r;
191
+ if (g.length == 1)
192
+ g = "0" + g;
193
+ if (b.length == 1)
194
+ b = "0" + b;
195
+ return "#" + r + g + b;
196
+ }
197
+ //const ordinalValues = scaleOrdinal().domain(itemName);
198
+ var count = itemName.length;
199
+ var colorLegend = discreteLegendUtil(itemColor, true);
200
+ //const calcLegendHeight = 22 * itemColor.length + 4 * itemColor.length;
201
+ var selectedLegend = select(divRef.current);
202
+ // colorname as label for the legend (ex: facies)
203
+ selectedLegend
204
+ .append("label")
205
+ .text(legendColorName ? legendColorName : '')
206
+ .attr("y", 7)
207
+ .style("float", "left")
208
+ .style("width", "15px")
209
+ .style("margin", "10px 0px")
210
+ .style("white-space", "nowrap")
211
+ .style("font-size", "smaller")
212
+ .style("font-weight", "900");
213
+ selectedLegend
214
+ .append("svg")
215
+ .style("margin-top", "13px")
216
+ .style("margin-left", "70px")
217
+ .attr("viewBox", "0 0 ".concat(count, " 1"))
218
+ .attr("preserveAspectRatio", "none")
219
+ .style("width", "109px")
220
+ .style("height", "20px")
221
+ .call(colorLegend);
222
+ }
223
+ // discrete legend using d3 colors
224
+ function discD3legend() {
225
+ var itemName = [];
226
+ var itemColor = [];
227
+ colorsObject.forEach(function (element, key) {
228
+ itemColor.push({ color: element });
229
+ itemName.push(key);
56
230
  });
231
+ //const ordinalValues = scaleOrdinal(colorsObject).domain(itemName);
232
+ var count = itemName.length;
233
+ var discreteLegend = discreteLegendUtil(itemColor, true);
234
+ select("svg").append("g").attr("transform", "translate(50,70)").attr("class", "legend").call(discreteLegend);
235
+ var selectedLegend = select(divRef.current);
236
+ selectedLegend
237
+ .append("text")
238
+ .text(legendColorName ? legendColorName : '')
239
+ .attr("y", 7)
240
+ .style("float", "left")
241
+ .style("width", "15px")
242
+ .style("margin", "10px 0px")
243
+ .style("font-size", "smaller")
244
+ .style("font-weight", "900");
245
+ selectedLegend
246
+ .append("svg")
247
+ .style("margin-top", "13px")
248
+ .style("margin-left", "70px")
249
+ .style("background", "grey")
250
+ .attr("viewBox", "0 0 ".concat(count, " 1"))
251
+ .attr("preserveAspectRatio", "none")
252
+ .style("width", "109px")
253
+ .style("height", "20px")
254
+ .call(discreteLegend);
57
255
  }
58
256
  return (React.createElement("div", null,
59
- continuousLegend,
60
- discreteLegend));
257
+ React.createElement("div", { id: "legend", style: { height: 30 }, ref: divRef, onClick: handleChange })));
61
258
  };
259
+ // Based on name return the colors array from color.tables.json file
260
+ export function colorTableData(colorName, colorTables) {
261
+ var colorTableData = colorTables.filter(function (value) {
262
+ return value.name.toLowerCase() == colorName.toLowerCase();
263
+ });
264
+ return colorTableData.length > 0 ? colorTableData[0].colors : [];
265
+ }
62
266
  //# 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,KAAK,WAAW,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAElD,MAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;AAC3B,MAAM,kBA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AAE,EAAE;YAC/D,OAAO,oBAAC,eAAe,IACX,QAAQ,EAAE,QAAQ,GAAG,GAAG,EACxB,YAAY,EAAE,EAAE,EAChB,WAAW,EAAE,GAAG,CAAC,KAAK,EACtB,eAAe,EAAE,GAAG,CAAC,IAAI,EACzB,iBAAiB,EAAE,KAAK,EACxB,UAAU,EAAE,GAAG,GAAG,GAAG,GAC/B,CAAA;QACN,CAAC,CAAC,CAAC;QAEH,cAAc,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,GAAQ,EAAE,EAAE;YAC7C,OAAO,oBAAC,eAAe,IACX,eAAe,EAAE,GAAG,CAAC,IAAI,EACzB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,GAAG,CAAC,MAAM,EACxB,iBAAiB,EAAE,KAAK,GAAI,CAAA;QAC5C,CAAC,CAAC,CAAC;KACN;IAED,OAAO,CACH;QACK,gBAAgB;QAChB,cAAc,CACb,CACT,CAAC;AACN,CAAC,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,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;AAEzB,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAmBjC,MAAM,CAAC,IAAM,sBAAsB,GAA0B,UAAC,EAUhD;;IATV,YAAY;IACZ,YAAY,kBAAA,EACZ,WAAW,iBAAA,EACX,eAAe,qBAAA,EACf,iBAAiB,uBAA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3B,KAAK,CAAC,WAAW,EAAE,SAAS,CAAC;aAC7B,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;QACjC,cAAc;aACT,MAAM,CAAC,KAAK,CAAC;aACb,KAAK,CAAC,YAAY,EAAE,MAAM,CAAC;aAC3B,KAAK,CAAC,aAAa,EAAE,MAAM,CAAC;aAC5B,KAAK,CAAC,YAAY,EAAE,MAAM,CAAC;aAC3B,IAAI,CAAC,SAAS,EAAE,cAAO,KAAK,OAAI,CAAC;aACjC,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC;aAEnC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC;aACvB,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC;aACvB,IAAI,CAAC,cAAc,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,CACH;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;AAEF,oEAAoE;AACpE,MAAM,UAAU,cAAc,CAC1B,SAAiB,EACjB,WAA6B;IAE7B,IAAM,cAAc,GAAG,WAAW,CAAC,MAAM,CACrC,UAAC,KAAqB;QAClB,OAAA,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,SAAS,CAAC,WAAW,EAAE;IAAnD,CAAmD,CAC1D,CAAC;IACF,OAAO,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;AACrE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ interface legendProps {
3
+ useColorTableColors: boolean;
4
+ useD3Colors: boolean;
5
+ colorScaleObject: any;
6
+ }
7
+ export declare const ColorSelectorWrapper: React.FC<legendProps>;
8
+ export {};
@@ -0,0 +1,65 @@
1
+ import * as React from "react";
2
+ import * as colorTables from "../color-tables.json";
3
+ import { d3ColorScales } from "../Utils/d3ColorScale";
4
+ import { ColorSelectorComponent } from "./ColorSelectorComponent";
5
+ var position = [16, 206];
6
+ var continuosColorData = [];
7
+ var continuosD3ColorData = [];
8
+ var discreteColorData = [];
9
+ var discreteD3ColorData = [];
10
+ // Continuous legend using color table data
11
+ var colorTableContinuousData = colorTables.filter(function (element) {
12
+ return element.discrete == false;
13
+ });
14
+ colorTableContinuousData.forEach(function (element) {
15
+ continuosColorData.push({ color: element.colors, name: element.name });
16
+ });
17
+ // Continuous legend using d3 data
18
+ var d3continuousData = d3ColorScales.filter(function (element) {
19
+ return element.discrete == false;
20
+ });
21
+ d3continuousData.forEach(function (element) {
22
+ continuosD3ColorData.push({ color: element.colors, name: element.name });
23
+ });
24
+ // Discrete legend using color table data
25
+ var discreteData = colorTables.filter(function (element) {
26
+ return element.discrete == true;
27
+ });
28
+ discreteData.forEach(function (element) {
29
+ discreteColorData.push({ color: element.colors, name: element.name });
30
+ });
31
+ // Discrete legend using d3 data
32
+ var d3discreteData = d3ColorScales.filter(function (element) {
33
+ return element.discrete == true;
34
+ });
35
+ d3discreteData.forEach(function (element) {
36
+ discreteD3ColorData.push({ color: element.colors, name: element.name });
37
+ });
38
+ export var ColorSelectorWrapper = function (_a) {
39
+ var useColorTableColors = _a.useColorTableColors, useD3Colors = _a.useD3Colors, colorScaleObject = _a.colorScaleObject;
40
+ var continuousLegend;
41
+ var discreteLegend;
42
+ // return continuous and discrete legend which uses colortable data
43
+ if (useColorTableColors) {
44
+ continuousLegend = continuosColorData.map(function (value, key) {
45
+ return React.createElement("div", null,
46
+ React.createElement(ColorSelectorComponent, { position: position + key, colorsObject: value, useContColorTable: true, valueIndex: key, colorScaleData: colorScaleObject.colorScaleObject }));
47
+ });
48
+ discreteLegend = discreteColorData.map(function (val, key) {
49
+ return React.createElement(ColorSelectorComponent, { position: position + key, colorsObject: discreteColorData[key], legendColorName: val.name, useDiscColorTable: true, colorScaleData: colorScaleObject.colorScaleObject });
50
+ });
51
+ }
52
+ // return continuous and discrete legend which uses d3 data
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
+ return (React.createElement("div", { className: "legendWrapper", style: { height: 200, overflow: "auto", display: "flex", flexDirection: "column", overflowX: "hidden" } },
62
+ continuousLegend,
63
+ discreteLegend));
64
+ };
65
+ //# sourceMappingURL=ColorSelectorWrapper.js.map
@@ -0,0 +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,KAAK,WAAW,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAC,sBAAsB,EAAC,MAAM,0BAA0B,CAAC;AAEhE,IAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;AAC3B,IAAM,kBAAkB,GAAQ,EAAE,CAAC;AACnC,IAAM,oBAAoB,GAAQ,EAAE,CAAC;AACrC,IAAM,iBAAiB,GAAQ,EAAE,CAAC;AAClC,IAAM,mBAAmB,GAAQ,EAAE,CAAC;AAQpC,4CAA4C;AAC5C,IAAI,wBAAwB,GAAG,WAAW,CAAC,MAAM,CAAC,UAAC,OAAY;IAC3D,OAAO,OAAO,CAAC,QAAQ,IAAI,KAAK,CAAC;AACrC,C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,GAAG,cAAc,CAAC,GAAG,CAAC,UAAC,GAAQ,EAAE,GAAQ;YACnD,OAAO,oBAAC,sBAAsB,IAClB,QAAQ,EAAE,QAAQ,GAAG,GAAG,EACxB,YAAY,EAAE,GAAG,CAAC,MAAM,EACxB,eAAe,EAAE,GAAG,CAAC,IAAI,EACzB,iBAAiB,EAAE,KAAK,EACxB,cAAc,EAAE,gBAAgB,CAAC,gBAAgB,GACnD,CAAA;QACd,CAAC,CAAC,CAAC;KACN;IAED,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"}
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ interface ColorLegendProps {
3
+ colorTables: any;
4
+ min: number;
5
+ max: number;
6
+ dataObjectName: string;
7
+ position?: number[] | null;
8
+ colorName: string;
9
+ horizontal?: boolean | null;
10
+ discreteData: any;
11
+ }
12
+ declare const ColorLegend: React.FC<ColorLegendProps>;
13
+ export default ColorLegend;
@@ -0,0 +1,27 @@
1
+ import * as React from "react";
2
+ import { DiscreteColorLegend } from "./DiscreteLegend";
3
+ import { ContinuousLegend } from "./ContinuousLegend";
4
+ import { useCallback } from "react";
5
+ import { ColorSelectorAccordion } from "../ColorSelector/ColorSelectorAccordion";
6
+ // Todo: Adapt it for other layers too
7
+ var ColorLegend = function (_a) {
8
+ 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;
9
+ var _b = React.useState(false), isToggled = _b[0], setIsToggled = _b[1];
10
+ var handleClick = useCallback(function () {
11
+ setIsToggled(true);
12
+ }, []);
13
+ var _c = React.useState([]), updateLegend = _c[0], setUpdateLegendColor = _c[1];
14
+ var _d = React.useState(true), isCont = _d[0], setIsCont = _d[1];
15
+ // Get new colorscale from colorselector and update legend
16
+ var colorScaleObject = React.useCallback(function (data, value) {
17
+ setUpdateLegendColor(data);
18
+ setIsCont(value);
19
+ }, []);
20
+ return (React.createElement("div", null,
21
+ React.createElement("div", { onClick: handleClick },
22
+ isCont && (React.createElement(ContinuousLegend, { min: min, max: max, dataObjectName: dataObjectName, position: position, colorName: colorName, colorTables: colorTables, horizontal: horizontal, updateLegend: updateLegend })),
23
+ !isCont && (React.createElement(DiscreteColorLegend, { discreteData: discreteData, dataObjectName: dataObjectName, position: position, colorName: colorName, colorTables: colorTables, horizontal: horizontal, updateLegend: updateLegend }))),
24
+ React.createElement("div", null, isToggled && (React.createElement(ColorSelectorAccordion, { colorScaleObject: colorScaleObject })))));
25
+ };
26
+ export default ColorLegend;
27
+ //# sourceMappingURL=ColorLegend.js.map
@@ -0,0 +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;AAajF,sCAAsC;AACtC,IAAM,WAAW,GAA+B,UAAC,EAS9B;QARf,QAAQ,cAAA,EACR,UAAU,gBAAA,EACV,WAAW,iBAAA,EACX,GAAG,SAAA,EACH,GAAG,SAAA,EACH,cAAc,oBAAA,EACd,SAAS,eAAA,EACT,YAAY,kBAAA;IAGN,IAAA,KAA4B,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAhD,SAAS,QAAA,EAAE,YAAY,QAAyB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
  colorName: string;
9
9
  colorTables: colorTablesArray | string;
10
10
  horizontal?: boolean | null;
11
+ updateLegend?: any;
11
12
  };
12
13
  export declare const ContinuousLegend: React.FC<legendProps>;
13
14
  export {};