@emerson-eps/color-tables 0.2.3 → 0.2.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.
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 +14 -5
  6. package/dist/component/ColorSelector/ColorSelectorComponent.js +260 -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 +16 -0
  12. package/dist/component/Legend/ColorLegend.js +35 -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 +190 -83
  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 +173 -71
  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 +117 -41
  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 +2 -1
  71. package/src/component/ColorSelector/{ColorTableSelectorWrapper.tsx → ColorSelectorAccordion.tsx} +11 -6
  72. package/src/component/ColorSelector/ColorSelectorComponent.tsx +315 -95
  73. package/src/component/ColorSelector/ColorSelectorWrapper.tsx +118 -0
  74. package/src/component/Legend/ColorLegend.tsx +91 -0
  75. package/src/component/Legend/ContinuousLegend.tsx +159 -80
  76. package/src/component/Legend/DiscreteLegend.tsx +168 -63
  77. package/src/component/Utils/continousLegend.ts +1 -1
  78. package/src/component/Utils/discreteLegend.ts +128 -53
  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: props.isHorizontal ? 100 : 30,
9
+ right: props.isHorizontal ? 5 : 165,
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,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;YAClC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;SAClC;QACG,oBAAC,SAAS;YACN,oBAAC,SAAS,CAAC,IAAI,IAAC,UAAU;gBACtB,oBAAC,SAAS,CAAC,MAAM,uBAEE;gBACnB,oBAAC,SAAS,CAAC,KAAK;oBACZ,oBAAC,SAAS;wBACN,oBAAC,SAAS,CAAC,IAAI;4BACX,oBAAC,SAAS,CAAC,MAAM,+BAEE;4BACnB,oBAAC,SAAS,CAAC,KAAK;gCACZ,oBAAC,oBAAoB,IAAC,mBAAmB,EAAE,IAAI,EAAE,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
- interface legendProps {
3
- useColorTableColors: boolean;
4
- useD3Colors: boolean;
5
- }
6
- export declare const ColorSelector: React.FC<legendProps>;
2
+ import { colorTablesArray } from "../ColorTableTypes";
3
+ declare type legendProps = {
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;
13
+ };
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,271 @@
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
+ var data;
18
+ var extent;
19
+ if (legendColor) {
20
+ data = range(10).map(function (d) { return ({
21
+ color: legendColor(d / 10),
22
+ value: d,
23
+ }); });
24
+ // get the array's min and max value
25
+ extent = d3.extent(data, function (d) { return d === null || d === void 0 ? void 0 : d.value; });
26
+ }
27
+ var handleChange = React.useCallback(function () {
28
+ // continous legend with colortable colors
29
+ if (colorsObject && Object.keys(colorsObject).length > 0 && useContColorTable) {
30
+ colorScaleData(colorsObject, true);
31
+ }
32
+ // continous legend with d3 colors
33
+ else if (data && !useContColorTable) {
34
+ var arrayData_1 = [];
35
+ data.forEach(function (colorsObject) {
36
+ var _a, _b, _c;
37
+ arrayData_1.push([0 + "." + colorsObject.value, (_a = color(colorsObject.color)) === null || _a === void 0 ? void 0 : _a.rgb().r, (_b = color(colorsObject.color)) === null || _b === void 0 ? void 0 : _b.rgb().g, (_c = color(colorsObject.color)) === null || _c === void 0 ? void 0 : _c.rgb().b]);
38
+ });
39
+ colorScaleData({ arrayData: arrayData_1, legendColorName: legendColorName }, true);
40
+ }
41
+ // discrete legend with colortable colors
42
+ else if (colorsObject && Object.keys(colorsObject).length > 0 && useDiscColorTable) {
43
+ colorScaleData(colorsObject, false);
44
+ }
45
+ // discrete legend with d3 colors
46
+ else {
47
+ colorScaleData({ colorsObject: colorsObject, legendColorName: legendColorName }, false);
48
+ }
49
+ }, []);
50
+ React.useEffect(function () {
51
+ // continuous legend using color table colors
52
+ if (useContColorTable == true && divRef.current) {
53
+ contColortableLegend();
54
+ return function cleanup() {
55
+ select(divRef.current).select("svg").remove();
56
+ select(divRef.current).select("div").remove();
57
+ };
58
+ }
59
+ // discrete legend using color table colors
60
+ if (useDiscColorTable == true && divRef.current) {
61
+ discColorTableLegend();
62
+ return function cleanup() {
63
+ select(divRef.current).select("div").remove();
64
+ select(divRef.current).select("svg").remove();
65
+ };
66
+ }
67
+ // discrete legend using d3 colors
68
+ if (useDiscColorTable == false && divRef.current) {
69
+ discD3legend();
70
+ return function cleanup() {
71
+ select(divRef.current).select("div").remove();
72
+ select(divRef.current).select("svg").remove();
73
+ };
74
+ }
75
+ // continuous legend using d3 colors
76
+ else if (useContColorTable == false && divRef.current) {
77
+ contD3Legend();
78
+ return function cleanup() {
79
+ select(divRef.current).select("svg").remove();
80
+ select(divRef.current).select("div").remove();
81
+ };
82
+ }
83
+ }, [useContColorTable]);
84
+ // continuous legend using color table colors (using linear gradiend)
85
+ function contColortableLegend() {
86
+ var itemColor = [];
87
+ colorsObject.color.forEach(function (value) {
88
+ // return the color and offset needed to draw the legend
89
+ itemColor.push({
90
+ offset: RGBToHex(value).offset,
91
+ color: RGBToHex(value).color,
92
+ });
93
+ });
94
+ // append a defs (for definition) element to your SVG
95
+ var svgLegend = select(divRef.current)
96
+ .append("svg")
97
+ .style("height", "30px");
98
+ var defs = svgLegend.append("defs");
99
+ var currentIndex = "linear-gradient-" + valueIndex;
100
+ // append a linearGradient element to the defs and give it a unique id
101
+ var linearGradient = defs
102
+ .append("linearGradient")
103
+ .attr("id", currentIndex)
104
+ .attr("x1", "0%")
105
+ .attr("x2", "100%") //since it's a horizontal linear gradient
106
+ .attr("y1", "0%")
107
+ .attr("y2", "0%");
108
+ // append multiple color stops by using D3's data/enter step
109
+ linearGradient
110
+ .selectAll("stop")
111
+ .data(itemColor)
112
+ .enter()
113
+ .append("stop")
114
+ .attr("offset", function (data) {
115
+ return data.offset + "%";
116
+ })
117
+ .attr("stop-color", function (data) {
118
+ return data.color;
45
119
  });
46
- discreteLegend = discreteColorData.map((val, key) => {
47
- return React.createElement(LegendComponent, { legendColorName: val.name, position: position, colorsObject: discreteColorData[key], useDiscColorTable: true });
120
+ // append title
121
+ svgLegend
122
+ .append("text")
123
+ .attr("id", "legendTitle")
124
+ .attr("x", 0)
125
+ .attr("y", 15)
126
+ .style("font-size", "smaller")
127
+ .style("font-weight", "900")
128
+ // .attr("textLength","5em")
129
+ .text(colorsObject.name);
130
+ // draw the rectangle and fill with gradient
131
+ svgLegend
132
+ .append("rect")
133
+ .attr("x", 85)
134
+ .attr("y", 5)
135
+ .attr("width", "110")
136
+ .attr("height", 20)
137
+ .style("fill", "url(#" + currentIndex + ")");
138
+ }
139
+ // continuous legend using d3 colors (using linear gradiend)
140
+ function contD3Legend() {
141
+ var itemColor = [];
142
+ d3ColorScales.forEach(function (value) {
143
+ // return the color and offset needed to draw the legend
144
+ itemColor.push(value.colors);
48
145
  });
146
+ // append a defs (for definition) element to your SVG
147
+ var svgLegend = select(divRef.current)
148
+ .append("svg")
149
+ .style("height", "50px");
150
+ var defs = svgLegend.append("defs");
151
+ var currentIndex = "linear-gradient-" + valueIndex;
152
+ // append a linearGradient element to the defs and give it a unique id
153
+ var linearGradient = defs
154
+ .append("linearGradient")
155
+ .attr("id", currentIndex)
156
+ .attr("x1", "0%")
157
+ .attr("x2", "100%") //since it's a horizontal linear gradient
158
+ .attr("y1", "0%")
159
+ .attr("y2", "0%");
160
+ // append multiple color stops by using D3's data/enter step
161
+ linearGradient.selectAll("stop")
162
+ .data(data)
163
+ .enter().append("stop")
164
+ .attr("offset", function (d) { return ((d.value - extent[0]) / (extent[1] - extent[0]) * 100) + "%"; })
165
+ .attr("stop-color", function (d) { return d.color; });
166
+ // append title
167
+ svgLegend
168
+ .append("text")
169
+ .attr("id", "legendTitle")
170
+ .attr("x", 0)
171
+ .attr("y", 15)
172
+ .style("font-size", "smaller")
173
+ .style("font-weight", "900")
174
+ .text(legendColorName ? legendColorName : '');
175
+ // draw the rectangle and fill with gradient
176
+ svgLegend
177
+ .append("rect")
178
+ .attr("x", 85)
179
+ .attr("y", 5)
180
+ .attr("width", "110")
181
+ .attr("height", 20)
182
+ .style("fill", "url(#" + currentIndex + ")");
49
183
  }
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" });
184
+ // discrete legend using color table colors
185
+ function discColorTableLegend() {
186
+ var itemColor = [];
187
+ var itemName = [];
188
+ colorsObject.color.forEach(function (element, key) {
189
+ itemColor.push({ color: RGBToHex(element) });
190
+ itemName.push(key);
53
191
  });
54
- discreteLegend = d3discreteData.map((val) => {
55
- return React.createElement(LegendComponent, { legendColorName: val.name, position: position, colorsObject: val.colors, useDiscColorTable: false });
192
+ function RGBToHex(rgb) {
193
+ var r = rgb[1].toString(16), g = rgb[2].toString(16), b = rgb[3].toString(16);
194
+ if (r.length == 1)
195
+ r = "0" + r;
196
+ if (g.length == 1)
197
+ g = "0" + g;
198
+ if (b.length == 1)
199
+ b = "0" + b;
200
+ return "#" + r + g + b;
201
+ }
202
+ //const ordinalValues = scaleOrdinal().domain(itemName);
203
+ var count = itemName.length;
204
+ var colorLegend = discreteLegendUtil(itemColor, true);
205
+ //const calcLegendHeight = 22 * itemColor.length + 4 * itemColor.length;
206
+ var selectedLegend = select(divRef.current);
207
+ // colorname as label for the legend (ex: facies)
208
+ selectedLegend
209
+ .append("label")
210
+ .text(legendColorName ? legendColorName : '')
211
+ .attr("y", 7)
212
+ .style("float", "left")
213
+ .style("width", "15px")
214
+ .style("margin", "10px 0px")
215
+ .style("white-space", "nowrap")
216
+ .style("font-size", "smaller")
217
+ .style("font-weight", "900");
218
+ selectedLegend
219
+ .append("svg")
220
+ .style("margin-top", "13px")
221
+ .style("margin-left", "70px")
222
+ .attr("viewBox", "0 0 ".concat(count, " 1"))
223
+ .attr("preserveAspectRatio", "none")
224
+ .style("width", "109px")
225
+ .style("height", "20px")
226
+ .call(colorLegend);
227
+ }
228
+ // discrete legend using d3 colors
229
+ function discD3legend() {
230
+ var itemName = [];
231
+ var itemColor = [];
232
+ colorsObject.forEach(function (element, key) {
233
+ itemColor.push({ color: element });
234
+ itemName.push(key);
56
235
  });
236
+ //const ordinalValues = scaleOrdinal(colorsObject).domain(itemName);
237
+ var count = itemName.length;
238
+ var discreteLegend = discreteLegendUtil(itemColor, true);
239
+ select("svg").append("g").attr("transform", "translate(50,70)").attr("class", "legend").call(discreteLegend);
240
+ var selectedLegend = select(divRef.current);
241
+ selectedLegend
242
+ .append("text")
243
+ .text(legendColorName ? legendColorName : '')
244
+ .attr("y", 7)
245
+ .style("float", "left")
246
+ .style("width", "15px")
247
+ .style("margin", "10px 0px")
248
+ .style("font-size", "smaller")
249
+ .style("font-weight", "900");
250
+ selectedLegend
251
+ .append("svg")
252
+ .style("margin-top", "13px")
253
+ .style("margin-left", "70px")
254
+ .style("background", "grey")
255
+ .attr("viewBox", "0 0 ".concat(count, " 1"))
256
+ .attr("preserveAspectRatio", "none")
257
+ .style("width", "109px")
258
+ .style("height", "20px")
259
+ .call(discreteLegend);
57
260
  }
58
261
  return (React.createElement("div", null,
59
- continuousLegend,
60
- discreteLegend));
262
+ React.createElement("div", { id: "legend", style: { height: 30 }, ref: divRef, onClick: handleChange })));
61
263
  };
264
+ // Based on name return the colors array from color.tables.json file
265
+ export function colorTableData(colorName, colorTables) {
266
+ var colorTableData = colorTables.filter(function (value) {
267
+ return value.name.toLowerCase() == colorName.toLowerCase();
268
+ });
269
+ return colorTableData.length > 0 ? colorTableData[0].colors : [];
270
+ }
62
271
  //# sourceMappingURL=ColorSelectorComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColorSelectorComponent.js","sourceRoot":"","sources":["../../../src/component/ColorSelector/ColorSelectorComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,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,GAAG,CAAC,IAAI,EACzB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,iBAAiB,CAAC,GAAG,CAAC,EACpC,iBAAiB,EAAE,IAAI,GAAI,CAAA;QAC3C,CAAC,CAAC,CAAC;KACN;IACD,IAAI,WAAW,EAAE;QACb,gBAAgB,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC,GAAQ,EAAE,GAAQ,EAAE,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,E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W,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
+ declare type 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;AA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BAAgB,GAAG,oBAAoB,CAAC,GAAG,CAAC,UAAC,GAAQ,EAAE,GAAQ;YAC3D,OAAO,oBAAC,sBAAsB,IAClB,QAAQ,EAAE,QAAQ,GAAG,GAAG,EACxB,WAAW,EAAE,GAAG,CAAC,KAAK,EACtB,eAAe,EAAE,GAAG,CAAC,IAAI,EACzB,iBAAiB,EAAE,KAAK,EACxB,UAAU,EAAE,GAAG,GAAG,GAAG,EACrB,cAAc,EAAE,gBAAgB,CAAC,gBAAgB,GAC3D,CAAA;QACN,CAAC,CAAC,CAAC;QAEH,cAAc,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,16 @@
1
+ import * as React from "react";
2
+ declare type 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: {
11
+ objects: Record<string, [number[], number]>;
12
+ };
13
+ getColorMapname?: any;
14
+ };
15
+ declare const ColorLegend: React.FC<ColorLegendProps>;
16
+ export default ColorLegend;
@@ -0,0 +1,35 @@
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, getColorMapname = _a.getColorMapname;
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
+ // update color map layer
18
+ if (data.name && getColorMapname) {
19
+ getColorMapname(data.name);
20
+ }
21
+ // d3 color name
22
+ else if (getColorMapname) {
23
+ getColorMapname(data.legendColorName);
24
+ }
25
+ setUpdateLegendColor(data);
26
+ setIsCont(value);
27
+ }, []);
28
+ return (React.createElement("div", null,
29
+ React.createElement("div", { onClick: handleClick },
30
+ isCont && (React.createElement(ContinuousLegend, { min: min, max: max, dataObjectName: dataObjectName, position: position, colorName: colorName, colorTables: colorTables, horizontal: horizontal, updateLegend: updateLegend })),
31
+ !isCont && (React.createElement(DiscreteColorLegend, { discreteData: discreteData, dataObjectName: dataObjectName, position: position, colorName: colorName, colorTables: colorTables, horizontal: horizontal, updateLegend: updateLegend }))),
32
+ React.createElement("div", null, isToggled && (React.createElement(ColorSelectorAccordion, { colorScaleObject: colorScaleObject, isHorizontal: horizontal })))));
33
+ };
34
+ export default ColorLegend;
35
+ //# sourceMappingURL=ColorLegend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorLegend.js","sourceRoot":"","sources":["../../../src/component/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AAI,CAAC,CAAC;QAC3B,SAAS,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACH;QACI,6BAAK,OAAO,EAAE,WAAW;YACpB,MAAM,IAAI,CACP,oBAAC,gBAAgB,IACb,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,GAC5B,CACL;YACA,CAAC,MAAM,IAAI,CACR,oBAAC,mBAAmB,IAChB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,GAC5B,CACL,CACC;QACN,iCACK,SAAS,IAAI,CACV,oBAAC,sBAAsB,IAAC,gBAAgB,EAAE,gBAAgB,EAAE,YAAY,EAAE,UAAU,GAAI,CAC3F,CACC,CACJ,CAET,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -8,6 +8,7 @@ declare type legendProps = {
8
8
  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 {};