@emerson-eps/color-tables 0.1.22 → 0.2.0

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 (49) hide show
  1. package/dist/component/ColorSelector/ColorSelectorComponent.d.ts +7 -0
  2. package/dist/component/ColorSelector/ColorSelectorComponent.js +36 -0
  3. package/dist/component/ColorSelector/ColorSelectorComponent.js.map +1 -0
  4. package/dist/component/ColorSelector/ColorTableSelectorWrapper.d.ts +2 -0
  5. package/dist/component/ColorSelector/ColorTableSelectorWrapper.js +27 -0
  6. package/dist/component/ColorSelector/ColorTableSelectorWrapper.js.map +1 -0
  7. package/dist/component/Legend/legendContinous.d.ts +11 -0
  8. package/dist/component/Legend/legendContinous.js +132 -0
  9. package/dist/component/Legend/legendContinous.js.map +1 -0
  10. package/dist/component/Utils/d3ColorScale.d.ts +7 -0
  11. package/dist/component/Utils/d3ColorScale.js +38 -0
  12. package/dist/component/Utils/d3ColorScale.js.map +1 -0
  13. package/dist/stories/ColorLegends/ColorSelector/Selector.stories.d.ts +7 -0
  14. package/dist/stories/ColorLegends/ColorSelector/Selector.stories.js +11 -0
  15. package/dist/stories/ColorLegends/ColorSelector/Selector.stories.js.map +1 -0
  16. package/dist/stories/ColorLegends/ContinousLegends/MD.stories.d.ts +7 -0
  17. package/dist/stories/ColorLegends/ContinousLegends/MD.stories.js +27 -0
  18. package/dist/stories/ColorLegends/ContinousLegends/MD.stories.js.map +1 -0
  19. package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.d.ts +7 -0
  20. package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.js +27 -0
  21. package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.js.map +1 -0
  22. package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.d.ts +7 -0
  23. package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.js +27 -0
  24. package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.js.map +1 -0
  25. package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.d.ts +7 -0
  26. package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.js +27 -0
  27. package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.js.map +1 -0
  28. package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.d.ts +7 -0
  29. package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.js +27 -0
  30. package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.js.map +1 -0
  31. package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.d.ts +7 -0
  32. package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.js +27 -0
  33. package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.js.map +1 -0
  34. package/dist/stories/ColorLegends/ContinousLegends/SW.stories.d.ts +7 -0
  35. package/dist/stories/ColorLegends/ContinousLegends/SW.stories.js +27 -0
  36. package/dist/stories/ColorLegends/ContinousLegends/SW.stories.js.map +1 -0
  37. package/package.json +3 -1
  38. package/src/component/ColorSelector/ColorSelectorComponent.tsx +68 -0
  39. package/src/component/ColorSelector/ColorTableSelectorWrapper.tsx +51 -0
  40. package/src/component/Legend/legendContinous.tsx +175 -0
  41. package/src/component/Utils/d3ColorScale.ts +39 -0
  42. package/src/stories/ColorLegends/ColorSelector/Selector.stories.jsx +12 -0
  43. package/src/stories/ColorLegends/ContinousLegends/MD.stories.jsx +29 -0
  44. package/src/stories/ColorLegends/ContinousLegends/NTG.stories.jsx +29 -0
  45. package/src/stories/ColorLegends/ContinousLegends/PermTot.stories.jsx +29 -0
  46. package/src/stories/ColorLegends/ContinousLegends/Permeability.stories.jsx +29 -0
  47. package/src/stories/ColorLegends/ContinousLegends/PoroTot.stories.jsx +29 -0
  48. package/src/stories/ColorLegends/ContinousLegends/Porosity.stories.jsx +29 -0
  49. package/src/stories/ColorLegends/ContinousLegends/SW.stories.jsx +29 -0
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ interface legendProps {
3
+ useColorTableColors: boolean;
4
+ useD3Colors: boolean;
5
+ }
6
+ export declare const ColorSelector: React.FC<legendProps>;
7
+ export {};
@@ -0,0 +1,36 @@
1
+ import * as React from "react";
2
+ import { LegendContinous } from "../Legend/legendContinous";
3
+ import * as colorTables from "../color-tables.json";
4
+ import { colorScalesCont } from "../Utils/d3ColorScale";
5
+ const position = [16, 206];
6
+ const continuosColorData = [];
7
+ const continuosD3ColorData = [];
8
+ // code is for color table continuous data
9
+ var colorTableContinuousData = colorTables.filter((element) => {
10
+ return element.discrete == false;
11
+ });
12
+ colorTableContinuousData.forEach((element) => {
13
+ continuosColorData.push({ color: element.colors, name: element.name });
14
+ });
15
+ // code is for d3 continuous data
16
+ var d3continuousData = colorScalesCont.filter((element) => {
17
+ return element.discrete == false;
18
+ });
19
+ d3continuousData.forEach((element) => {
20
+ continuosD3ColorData.push({ color: element.colors, name: element.name });
21
+ });
22
+ export const ColorSelector = ({ useColorTableColors, useD3Colors, }) => {
23
+ let continuousLegend;
24
+ if (useColorTableColors) {
25
+ continuousLegend = continuosColorData.map((value, key) => {
26
+ return React.createElement(LegendContinous, { position: position + key, colorArray: value, legendColor: '', legendColorName: '', useContColorTable: true, valueIndex: key });
27
+ });
28
+ }
29
+ if (useD3Colors) {
30
+ continuousLegend = continuosD3ColorData.map((val, key) => {
31
+ return React.createElement(LegendContinous, { position: position + key, colorArray: {}, legendColor: val.color, legendColorName: val.name, useContColorTable: false, valueIndex: key + "0" });
32
+ });
33
+ }
34
+ return (React.createElement("div", null, continuousLegend));
35
+ };
36
+ //# sourceMappingURL=ColorSelectorComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorSelectorComponent.js","sourceRoot":"","sources":["../../../src/component/ColorSelector/ColorSelectorComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,WAAW,MAAM,sBAAsB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AU,EAAE,KAAK,EACjB,WAAW,EAAE,EAAE,EACf,eAAe,EAAE,EAAE,EACnB,iBAAiB,EAAE,IAAI,EACvB,UAAU,EAAE,GAAG,GACzB,CAAA;QACN,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,UAAU,EAAE,EAAE,EACd,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;KACN;IAED,OAAO,CACH,iCACK,gBAAgB,CACf,CACT,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const ColorSelectorWrapper: () => JSX.Element;
@@ -0,0 +1,27 @@
1
+ import * as React from "react";
2
+ import { Accordion } from "@equinor/eds-core-react";
3
+ import { ColorSelector } from "./ColorSelectorComponent";
4
+ export const ColorSelectorWrapper = () => {
5
+ // export const ColorSelector: React.FC<legendProps> = ({
6
+ // }: legendProps) => {
7
+ return (React.createElement("div", { style: { width: "450px" } },
8
+ React.createElement(Accordion, null,
9
+ React.createElement(Accordion.Item, null,
10
+ React.createElement(Accordion.Header, null, "Color Scales"),
11
+ React.createElement(Accordion.Panel, null,
12
+ React.createElement(Accordion, null,
13
+ React.createElement(Accordion.Item, null,
14
+ React.createElement(Accordion.Header, null, "Geologic Color Scale"),
15
+ React.createElement(Accordion.Panel, null,
16
+ React.createElement(ColorSelector, { useColorTableColors: true, useD3Colors: false, key: 1 })))),
17
+ React.createElement(Accordion, null,
18
+ React.createElement(Accordion.Item, null,
19
+ React.createElement(Accordion.Header, null, "D3 Color Scale"),
20
+ React.createElement(Accordion.Panel, null,
21
+ React.createElement(ColorSelector, { useColorTableColors: false, useD3Colors: true, key: 1 })))),
22
+ React.createElement(Accordion, null,
23
+ React.createElement(Accordion.Item, null,
24
+ React.createElement(Accordion.Header, null, "Custom Color Scale"),
25
+ React.createElement(Accordion.Panel, null, "Custom Content"))))))));
26
+ };
27
+ //# sourceMappingURL=ColorTableSelectorWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorTableSelectorWrapper.js","sourceRoot":"","sources":["../../../src/component/ColorSelector/ColorTableSelectorWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAG,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAEvD,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACrC,yDAAyD;IACzD,uBAAuB;IACvB,OAAO,CACH,6BAAK,KAAK,EAAE,EAAC,KAAK,EAAE,OAAO,EAAC;QACxB,oBAAC,SAAS;YACN,oBAAC,SAAS,CAAC,IAAI;gBACX,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,aAAa,IAAC,mBAAmB,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,CACzD,CACL,CACT;oBACZ,oBAAC,SAAS;wBACN,oBAAC,SAAS,CAAC,IAAI;4BACX,oBAAC,SAAS,CAAC,MAAM,yBAEE;4BACnB,oBAAC,SAAS,CAAC,KAAK;gCACZ,oBAAC,aAAa,IAAC,mBAAmB,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,GAAG,CACzD,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"}
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ interface legendProps {
3
+ position?: number[] | null;
4
+ colorArray: any;
5
+ legendColor: any;
6
+ legendColorName: string;
7
+ useContColorTable: boolean;
8
+ valueIndex: any;
9
+ }
10
+ export declare const LegendContinous: React.FC<legendProps>;
11
+ export {};
@@ -0,0 +1,132 @@
1
+ import * as React from "react";
2
+ import { useRef } from "react";
3
+ import { RGBToHex } from "../Utils/continousLegend";
4
+ import { colorScalesCont } from "../Utils/d3ColorScale";
5
+ import * as d3 from "d3";
6
+ export const LegendContinous = ({ position, colorArray, legendColor, legendColorName, useContColorTable, valueIndex, }) => {
7
+ const divRef = useRef(null);
8
+ React.useEffect(() => {
9
+ // colortable colors
10
+ if (useContColorTable == true && divRef.current) {
11
+ colortableLegend();
12
+ }
13
+ // d3 colors
14
+ else if (useContColorTable == false && divRef.current) {
15
+ d3colorLegend(colorScalesCont);
16
+ }
17
+ return function cleanup() {
18
+ d3.select(divRef.current).select("svg").remove();
19
+ };
20
+ }, [useContColorTable]);
21
+ function colortableLegend() {
22
+ const itemColor = [];
23
+ colorArray.color.forEach((value) => {
24
+ // return the color and offset needed to draw the legend
25
+ itemColor.push({
26
+ offset: RGBToHex(value).offset,
27
+ color: RGBToHex(value).color,
28
+ });
29
+ });
30
+ // append a defs (for definition) element to your SVG
31
+ const svgLegend = d3.select(divRef.current)
32
+ .append("svg")
33
+ .style("height", "50px")
34
+ .style("display", "flex");
35
+ const defs = svgLegend.append("defs");
36
+ let currentIndex = "linear-gradient-" + valueIndex;
37
+ // append a linearGradient element to the defs and give it a unique id
38
+ const linearGradient = defs
39
+ .append("linearGradient")
40
+ .attr("id", currentIndex)
41
+ .attr("x1", "0%")
42
+ .attr("x2", "100%") //since it's a horizontal linear gradient
43
+ .attr("y1", "0%")
44
+ .attr("y2", "0%");
45
+ // append multiple color stops by using D3's data/enter step
46
+ linearGradient
47
+ .selectAll("stop")
48
+ .data(itemColor)
49
+ .enter()
50
+ .append("stop")
51
+ .attr("offset", function (data) {
52
+ return data.offset + "%";
53
+ })
54
+ .attr("stop-color", function (data) {
55
+ return data.color;
56
+ });
57
+ // append title
58
+ svgLegend
59
+ .append("text")
60
+ .attr("class", "legendTitle")
61
+ .attr("x", 0)
62
+ .attr("y", 43)
63
+ .style("text-anchor", "left")
64
+ .text(colorArray.name);
65
+ // draw the rectangle and fill with gradient
66
+ svgLegend
67
+ .append("rect")
68
+ .attr("x", 180)
69
+ .attr("y", 30)
70
+ .attr("width", 150)
71
+ .attr("height", 25)
72
+ .style("fill", "url(#" + currentIndex + ")");
73
+ }
74
+ // continuous legend using d3 color scale (linear gradiend code)
75
+ function d3colorLegend(colorscale) {
76
+ const itemColor = [];
77
+ colorscale.forEach((value) => {
78
+ // return the color and offset needed to draw the legend
79
+ itemColor.push(value.colors);
80
+ });
81
+ // create an array of steps based on the color scale
82
+ // returns an array of evenly-spaced numbers. Returns the integers from zero to the specified end minus one.
83
+ // d3.range(start, stop, step)
84
+ var data = d3.range(10).map(d => ({ color: legendColor(d / 10), value: d }));
85
+ // get the array's min and max value
86
+ var extent = d3.extent(data, d => d.value);
87
+ // append a defs (for definition) element to your SVG
88
+ const svgLegend = d3.select(divRef.current)
89
+ .append("svg")
90
+ .style("height", "50px")
91
+ .style("display", "flex");
92
+ const defs = svgLegend.append("defs");
93
+ let currentIndex = "linear-gradient-" + valueIndex;
94
+ // append a linearGradient element to the defs and give it a unique id
95
+ const linearGradient = defs
96
+ .append("linearGradient")
97
+ .attr("id", currentIndex)
98
+ .attr("x1", "0%")
99
+ .attr("x2", "100%") //since it's a horizontal linear gradient
100
+ .attr("y1", "0%")
101
+ .attr("y2", "0%");
102
+ // append multiple color stops by using D3's data/enter step
103
+ linearGradient.selectAll("stop")
104
+ .data(data)
105
+ .enter().append("stop")
106
+ .attr("offset", d => ((d.value - extent[0]) / (extent[1] - extent[0]) * 100) + "%")
107
+ .attr("stop-color", d => d.color);
108
+ // append title
109
+ svgLegend
110
+ .append("text")
111
+ .attr("class", "legendTitle")
112
+ .attr("x", 0)
113
+ .attr("y", 43)
114
+ .style("text-anchor", "left")
115
+ .text(legendColorName);
116
+ // draw the rectangle and fill with gradient
117
+ svgLegend
118
+ .append("rect")
119
+ .attr("x", 180)
120
+ .attr("y", 30)
121
+ .attr("width", 150)
122
+ .attr("height", 25)
123
+ .style("fill", "url(#" + currentIndex + ")");
124
+ }
125
+ return (React.createElement("div", { style: {
126
+ right: position ? position[0] : ' ',
127
+ top: position ? position[1] : ' ',
128
+ } }, useContColorTable ? React.createElement("div", { className: "colortableLegend", ref: divRef })
129
+ :
130
+ React.createElement("div", { className: "d3colorLegend", ref: divRef })));
131
+ };
132
+ //# sourceMappingURL=legendContinous.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legendContinous.js","sourceRoot":"","sources":["../../../src/component/Legend/legendContinous.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,eAAe,EAAC,MAAM,uBAAuB,CAAA;AACrD,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAgBzB,MAAM,CAAC,MAAM,eAAe,GAA0B,CAAC,EACnD,QAAQ,EACR,UAAU,EACV,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,UAAU,GACA,EAAE,EAAE;IACd,MAAM,MAAM,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC5C,KAAK,CAAC,SAAS,CAAC,GAAG,E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SAAS,EAAC,eAAe,EAAC,GAAG,EAAE,MAAM,GAAQ,CAChD,CACT,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import * as d3 from "d3";
2
+ export declare const colorScalesCont: {
3
+ name: string;
4
+ discrete: boolean;
5
+ colors: typeof d3.interpolateSpectral;
6
+ }[];
7
+ export declare function interpolatorContinuous(): d3.ScaleSequential<string, never>;
@@ -0,0 +1,38 @@
1
+ import * as d3 from "d3";
2
+ export const colorScalesCont = [
3
+ {
4
+ "name": "Spectral",
5
+ "discrete": false,
6
+ "colors": d3.interpolateSpectral
7
+ },
8
+ {
9
+ "name": "RdYlBu",
10
+ "discrete": false,
11
+ "colors": d3.interpolateRdYlBu
12
+ },
13
+ {
14
+ "name": "Warm",
15
+ "discrete": false,
16
+ "colors": d3.interpolateWarm
17
+ },
18
+ {
19
+ "name": "Cool",
20
+ "discrete": false,
21
+ "colors": d3.interpolateCool
22
+ },
23
+ {
24
+ "name": "Viridis",
25
+ "discrete": false,
26
+ "colors": d3.interpolateViridis
27
+ },
28
+ {
29
+ "name": "Inferno",
30
+ "discrete": false,
31
+ "colors": d3.interpolateInferno
32
+ },
33
+ ];
34
+ export function interpolatorContinuous() {
35
+ return d3.scaleSequential(d3.interpolateInferno);
36
+ }
37
+ ;
38
+ //# sourceMappingURL=d3ColorScale.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"d3ColorScale.js","sourceRoot":"","sources":["../../../src/component/Utils/d3ColorScale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B;QACE,MAAM,EAAE,UAAU;QAClB,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,EAAE,CAAC,mBAAmB;KACjC;IACD;QACE,MAAM,EAAE,QAAQ;QAChB,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,EAAE,CAAC,iBAAiB;KAC/B;IACD;QACE,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,EAAE,CAAC,eAAe;KAC7B;IACD;QACE,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,EAAE,CAAC,eAAe;KAC7B;IACD;QACE,MAAM,EAAE,SAAS;QACjB,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,EAAE,CAAC,kBAAkB;KAChC;IACD;QACE,MAAM,EAAE,SAAS;QACjB,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,EAAE,CAAC,kBAAkB;KAChC;CACF,CAAA;AAGD,MAAM,UAAU,sBAAsB;IACpC,OAAO,EAAE,CAAC,eAAe,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC;AACnD,CAAC;AAAA,CAAC"}
@@ -0,0 +1,7 @@
1
+ declare namespace _default {
2
+ export { ColorSelectorWrapper as component };
3
+ export const title: string;
4
+ }
5
+ export default _default;
6
+ export const selectorTemplate: any;
7
+ import { ColorSelectorWrapper } from "../../../component/ColorSelector/ColorTableSelectorWrapper";
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ import { ColorSelectorWrapper } from "../../../component/ColorSelector/ColorTableSelectorWrapper";
3
+ export default {
4
+ component: ColorSelectorWrapper,
5
+ title: "Legends/ColorSelector",
6
+ };
7
+ const Template = (args) => {
8
+ return React.createElement(ColorSelectorWrapper, null);
9
+ };
10
+ export const selectorTemplate = Template.bind({});
11
+ //# sourceMappingURL=Selector.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Selector.stories.js","sourceRoot":"","sources":["../../../../src/stories/ColorLegends/ColorSelector/Selector.stories.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAClG,eAAe;IACX,SAAS,EAAE,oBAAoB;IAC/B,KAAK,EAAE,uBAAuB;CACjC,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,EAAE;IACtB,OAAO,oBAAC,oBAAoB,OAAG,CAAC;AACpC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ declare namespace _default {
2
+ export { ContinuousLegend as component };
3
+ export const title: string;
4
+ }
5
+ export default _default;
6
+ export const MDTemplate: any;
7
+ import { ContinuousLegend } from "../../../component/Legend/ContinuousLegend";
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ import { ContinuousLegend } from "../../../component/Legend/ContinuousLegend";
3
+ export default {
4
+ component: ContinuousLegend,
5
+ title: "Legends/ContinousLegend",
6
+ };
7
+ import colorTables from "../../../component/color-tables.json";
8
+ const min = 2918;
9
+ const max = 4770;
10
+ const dataObjectName = "Wells / MD";
11
+ const position = [16, 10];
12
+ const horizontal = true;
13
+ const colorName = "Time/Depth";
14
+ const Template = (args) => {
15
+ return React.createElement(ContinuousLegend, Object.assign({}, args));
16
+ };
17
+ export const MDTemplate = Template.bind({});
18
+ MDTemplate.args = {
19
+ min,
20
+ max,
21
+ dataObjectName,
22
+ position,
23
+ colorName,
24
+ colorTables,
25
+ horizontal,
26
+ };
27
+ //# sourceMappingURL=MD.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MD.stories.js","sourceRoot":"","sources":["../../../../src/stories/ColorLegends/ContinousLegends/MD.stories.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAC;AAC5E,eAAe;IACX,SAAS,EAAE,gBAAgB;IAC3B,KAAK,EAAE,yBAAyB;CACnC,CAAC;AACF,OAAO,WAAW,MAAM,sCAAsC,CAAC;AAE/D,MAAM,GAAG,GAAG,IAAI,CAAC;AACjB,MAAM,GAAG,GAAG,IAAI,CAAC;AACjB,MAAM,cAAc,GAAG,YAAY,CAAC;AACpC,MAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC1B,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,SAAS,GAAG,YAAY,CAAC;AAE/B,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,EAAE;IACtB,OAAO,oBAAC,gBAAgB,oBAAK,IAAI,EAAI,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5C,UAAU,CAAC,IAAI,GAAG;IACd,GAAG;IACH,GAAG;IACH,cAAc;IACd,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;CACb,CAAC"}
@@ -0,0 +1,7 @@
1
+ declare namespace _default {
2
+ export { ContinuousLegend as component };
3
+ export const title: string;
4
+ }
5
+ export default _default;
6
+ export const NTGTemplate: any;
7
+ import { ContinuousLegend } from "../../../component/Legend/ContinuousLegend";
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ import { ContinuousLegend } from "../../../component/Legend/ContinuousLegend";
3
+ export default {
4
+ component: ContinuousLegend,
5
+ title: "Legends/ContinousLegend",
6
+ };
7
+ import colorTables from "../../../component/color-tables.json";
8
+ const min = 0;
9
+ const max = 1;
10
+ const dataObjectName = "Wells / NTG";
11
+ const position = [16, 10];
12
+ const horizontal = true;
13
+ const colorName = "Rainbow";
14
+ const Template = (args) => {
15
+ return React.createElement(ContinuousLegend, Object.assign({}, args));
16
+ };
17
+ export const NTGTemplate = Template.bind({});
18
+ NTGTemplate.args = {
19
+ min,
20
+ max,
21
+ dataObjectName,
22
+ position,
23
+ colorName,
24
+ colorTables,
25
+ horizontal,
26
+ };
27
+ //# sourceMappingURL=NTG.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NTG.stories.js","sourceRoot":"","sources":["../../../../src/stories/ColorLegends/ContinousLegends/NTG.stories.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAC;AAC5E,eAAe;IACX,SAAS,EAAE,gBAAgB;IAC3B,KAAK,EAAE,yBAAyB;CACnC,CAAC;AACF,OAAO,WAAW,MAAM,sCAAsC,CAAC;AAE/D,MAAM,GAAG,GAAG,CAAC,CAAC;AACd,MAAM,GAAG,GAAG,CAAC,CAAC;AACd,MAAM,cAAc,GAAG,aAAa,CAAC;AACrC,MAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC1B,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,SAAS,GAAG,SAAS,CAAC;AAE5B,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,EAAE;IACtB,OAAO,oBAAC,gBAAgB,oBAAK,IAAI,EAAI,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC7C,WAAW,CAAC,IAAI,GAAG;IACf,GAAG;IACH,GAAG;IACH,cAAc;IACd,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;CACb,CAAC"}
@@ -0,0 +1,7 @@
1
+ declare namespace _default {
2
+ export { ContinuousLegend as component };
3
+ export const title: string;
4
+ }
5
+ export default _default;
6
+ export const PermTotTemplate: any;
7
+ import { ContinuousLegend } from "../../../component/Legend/ContinuousLegend";
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ import { ContinuousLegend } from "../../../component/Legend/ContinuousLegend";
3
+ export default {
4
+ component: ContinuousLegend,
5
+ title: "Legends/ContinousLegend",
6
+ };
7
+ import colorTables from "../../../component/color-tables.json";
8
+ const min = -999;
9
+ const max = 14023;
10
+ const dataObjectName = "Wells / PERMTOT";
11
+ const position = [16, 10];
12
+ const horizontal = true;
13
+ const colorName = "Porosity";
14
+ const Template = (args) => {
15
+ return React.createElement(ContinuousLegend, Object.assign({}, args));
16
+ };
17
+ export const PermTotTemplate = Template.bind({});
18
+ PermTotTemplate.args = {
19
+ min,
20
+ max,
21
+ dataObjectName,
22
+ position,
23
+ colorName,
24
+ colorTables,
25
+ horizontal,
26
+ };
27
+ //# sourceMappingURL=PermTot.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PermTot.stories.js","sourceRoot":"","sources":["../../../../src/stories/ColorLegends/ContinousLegends/PermTot.stories.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAC;AAC5E,eAAe;IACX,SAAS,EAAE,gBAAgB;IAC3B,KAAK,EAAE,yBAAyB;CACnC,CAAC;AACF,OAAO,WAAW,MAAM,sCAAsC,CAAC;AAE/D,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC;AACjB,MAAM,GAAG,GAAG,KAAK,CAAC;AAClB,MAAM,cAAc,GAAG,iBAAiB,CAAC;AACzC,MAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC1B,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,SAAS,GAAG,UAAU,CAAC;AAE7B,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,EAAE;IACtB,OAAO,oBAAC,gBAAgB,oBAAK,IAAI,EAAI,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACjD,eAAe,CAAC,IAAI,GAAG;IACnB,GAAG;IACH,GAAG;IACH,cAAc;IACd,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;CACb,CAAC"}
@@ -0,0 +1,7 @@
1
+ declare namespace _default {
2
+ export { ContinuousLegend as component };
3
+ export const title: string;
4
+ }
5
+ export default _default;
6
+ export const PermeabilityTemplate: any;
7
+ import { ContinuousLegend } from "../../../component/Legend/ContinuousLegend";
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ import { ContinuousLegend } from "../../../component/Legend/ContinuousLegend";
3
+ export default {
4
+ component: ContinuousLegend,
5
+ title: "Legends/ContinousLegend",
6
+ };
7
+ import colorTables from "../../../component/color-tables.json";
8
+ const min = -999;
9
+ const max = 14023;
10
+ const dataObjectName = "Wells / PERM";
11
+ const position = [16, 10];
12
+ const horizontal = true;
13
+ const colorName = "Permeability";
14
+ const Template = (args) => {
15
+ return React.createElement(ContinuousLegend, Object.assign({}, args));
16
+ };
17
+ export const PermeabilityTemplate = Template.bind({});
18
+ PermeabilityTemplate.args = {
19
+ min,
20
+ max,
21
+ dataObjectName,
22
+ position,
23
+ colorName,
24
+ colorTables,
25
+ horizontal,
26
+ };
27
+ //# sourceMappingURL=Permeability.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Permeability.stories.js","sourceRoot":"","sources":["../../../../src/stories/ColorLegends/ContinousLegends/Permeability.stories.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAC;AAC5E,eAAe;IACX,SAAS,EAAE,gBAAgB;IAC3B,KAAK,EAAE,yBAAyB;CACnC,CAAC;AACF,OAAO,WAAW,MAAM,sCAAsC,CAAC;AAE/D,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC;AACjB,MAAM,GAAG,GAAG,KAAK,CAAC;AAClB,MAAM,cAAc,GAAG,cAAc,CAAC;AACtC,MAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC1B,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,SAAS,GAAG,cAAc,CAAC;AAEjC,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,EAAE;IACtB,OAAO,oBAAC,gBAAgB,oBAAK,IAAI,EAAI,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtD,oBAAoB,CAAC,IAAI,GAAG;IACxB,GAAG;IACH,GAAG;IACH,cAAc;IACd,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;CACb,CAAC"}
@@ -0,0 +1,7 @@
1
+ declare namespace _default {
2
+ export { ContinuousLegend as component };
3
+ export const title: string;
4
+ }
5
+ export default _default;
6
+ export const PoroTotTemplate: any;
7
+ import { ContinuousLegend } from "../../../component/Legend/ContinuousLegend";
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ import { ContinuousLegend } from "../../../component/Legend/ContinuousLegend";
3
+ export default {
4
+ component: ContinuousLegend,
5
+ title: "Legends/ContinousLegend",
6
+ };
7
+ import colorTables from "../../../component/color-tables.json";
8
+ const min = 0;
9
+ const max = 0.35;
10
+ const dataObjectName = "Wells / POROTOT";
11
+ const position = [16, 10];
12
+ const horizontal = true;
13
+ const colorName = "Porosity";
14
+ const Template = (args) => {
15
+ return React.createElement(ContinuousLegend, Object.assign({}, args));
16
+ };
17
+ export const PoroTotTemplate = Template.bind({});
18
+ PoroTotTemplate.args = {
19
+ min,
20
+ max,
21
+ dataObjectName,
22
+ position,
23
+ colorName,
24
+ colorTables,
25
+ horizontal,
26
+ };
27
+ //# sourceMappingURL=PoroTot.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PoroTot.stories.js","sourceRoot":"","sources":["../../../../src/stories/ColorLegends/ContinousLegends/PoroTot.stories.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAC;AAC5E,eAAe;IACX,SAAS,EAAE,gBAAgB;IAC3B,KAAK,EAAE,yBAAyB;CACnC,CAAC;AACF,OAAO,WAAW,MAAM,sCAAsC,CAAC;AAE/D,MAAM,GAAG,GAAG,CAAC,CAAC;AACd,MAAM,GAAG,GAAG,IAAI,CAAC;AACjB,MAAM,cAAc,GAAG,iBAAiB,CAAC;AACzC,MAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC1B,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,SAAS,GAAG,UAAU,CAAC;AAE7B,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,EAAE;IACtB,OAAO,oBAAC,gBAAgB,oBAAK,IAAI,EAAI,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACjD,eAAe,CAAC,IAAI,GAAG;IACnB,GAAG;IACH,GAAG;IACH,cAAc;IACd,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;CACb,CAAC"}
@@ -0,0 +1,7 @@
1
+ declare namespace _default {
2
+ export { ContinuousLegend as component };
3
+ export const title: string;
4
+ }
5
+ export default _default;
6
+ export const PorosityTemplate: any;
7
+ import { ContinuousLegend } from "../../../component/Legend/ContinuousLegend";
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ import { ContinuousLegend } from "../../../component/Legend/ContinuousLegend";
3
+ export default {
4
+ component: ContinuousLegend,
5
+ title: "Legends/ContinousLegend",
6
+ };
7
+ import colorTables from "../../../component/color-tables.json";
8
+ const min = 0;
9
+ const max = 0.35;
10
+ const dataObjectName = "Wells / PORO";
11
+ const position = [16, 10];
12
+ const horizontal = true;
13
+ const colorName = "Porosity";
14
+ const Template = (args) => {
15
+ return React.createElement(ContinuousLegend, Object.assign({}, args));
16
+ };
17
+ export const PorosityTemplate = Template.bind({});
18
+ PorosityTemplate.args = {
19
+ min,
20
+ max,
21
+ dataObjectName,
22
+ position,
23
+ colorName,
24
+ colorTables,
25
+ horizontal,
26
+ };
27
+ //# sourceMappingURL=Porosity.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Porosity.stories.js","sourceRoot":"","sources":["../../../../src/stories/ColorLegends/ContinousLegends/Porosity.stories.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAC;AAC5E,eAAe;IACX,SAAS,EAAE,gBAAgB;IAC3B,KAAK,EAAE,yBAAyB;CACnC,CAAC;AACF,OAAO,WAAW,MAAM,sCAAsC,CAAC;AAE/D,MAAM,GAAG,GAAG,CAAC,CAAC;AACd,MAAM,GAAG,GAAG,IAAI,CAAC;AACjB,MAAM,cAAc,GAAG,cAAc,CAAC;AACtC,MAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC1B,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,SAAS,GAAG,UAAU,CAAC;AAE7B,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,EAAE;IACtB,OAAO,oBAAC,gBAAgB,oBAAK,IAAI,EAAI,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAClD,gBAAgB,CAAC,IAAI,GAAG;IACpB,GAAG;IACH,GAAG;IACH,cAAc;IACd,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;CACb,CAAC"}
@@ -0,0 +1,7 @@
1
+ declare namespace _default {
2
+ export { ContinuousLegend as component };
3
+ export const title: string;
4
+ }
5
+ export default _default;
6
+ export const SWTemplate: any;
7
+ import { ContinuousLegend } from "../../../component/Legend/ContinuousLegend";
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ import { ContinuousLegend } from "../../../component/Legend/ContinuousLegend";
3
+ export default {
4
+ component: ContinuousLegend,
5
+ title: "Legends/ContinousLegend",
6
+ };
7
+ import colorTables from "../../../component/color-tables.json";
8
+ const min = 0;
9
+ const max = 1;
10
+ const dataObjectName = "Wells / SW";
11
+ const position = [16, 10];
12
+ const horizontal = true;
13
+ const colorName = "Rainbow";
14
+ const Template = (args) => {
15
+ return React.createElement(ContinuousLegend, Object.assign({}, args));
16
+ };
17
+ export const SWTemplate = Template.bind({});
18
+ SWTemplate.args = {
19
+ min,
20
+ max,
21
+ dataObjectName,
22
+ position,
23
+ colorName,
24
+ colorTables,
25
+ horizontal,
26
+ };
27
+ //# sourceMappingURL=SW.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SW.stories.js","sourceRoot":"","sources":["../../../../src/stories/ColorLegends/ContinousLegends/SW.stories.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAC;AAC5E,eAAe;IACX,SAAS,EAAE,gBAAgB;IAC3B,KAAK,EAAE,yBAAyB;CACnC,CAAC;AACF,OAAO,WAAW,MAAM,sCAAsC,CAAC;AAE/D,MAAM,GAAG,GAAG,CAAC,CAAC;AACd,MAAM,GAAG,GAAG,CAAC,CAAC;AACd,MAAM,cAAc,GAAG,YAAY,CAAC;AACpC,MAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC1B,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,SAAS,GAAG,SAAS,CAAC;AAE5B,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,EAAE;IACtB,OAAO,oBAAC,gBAAgB,oBAAK,IAAI,EAAI,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5C,UAAU,CAAC,IAAI,GAAG;IACd,GAAG;IACH,GAAG;IACH,cAAc;IACd,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;CACb,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emerson-eps/color-tables",
3
- "version": "0.1.22",
3
+ "version": "0.2.0",
4
4
  "description": "Standard library of color tables for geological domain",
5
5
  "release": {
6
6
  "branches": [
@@ -16,6 +16,7 @@
16
16
  "semantic-release": "semantic-release"
17
17
  },
18
18
  "dependencies": {
19
+ "@equinor/eds-core-react": "^0.17.0",
19
20
  "d3": "^7.2.0",
20
21
  "d3-color": "^3.0.1",
21
22
  "d3-interpolate": "^3.0.1",
@@ -57,6 +58,7 @@
57
58
  "@testing-library/react": "^12.1.2",
58
59
  "@testing-library/user-event": "^13.5.0",
59
60
  "@types/d3": "^7.1.0",
61
+ "@types/styled-components": "^5.1.23",
60
62
  "babel-loader": "^8.1.0",
61
63
  "semantic-release": "^19.0.2",
62
64
  "ts-loader": "^9.2.6",
@@ -0,0 +1,68 @@
1
+ import * as React from "react";
2
+ import { LegendContinous } from "../Legend/legendContinous";
3
+ import * as colorTables from "../color-tables.json";
4
+ import {colorScalesCont} from "../Utils/d3ColorScale"
5
+
6
+ const position = [16, 206];
7
+ const continuosColorData: any = []
8
+ const continuosD3ColorData: any = []
9
+
10
+ interface legendProps {
11
+ useColorTableColors: boolean
12
+ useD3Colors: boolean
13
+ }
14
+
15
+ // code is for color table continuous data
16
+ var colorTableContinuousData = colorTables.filter((element: any) => {
17
+ return element.discrete == false;
18
+ });
19
+
20
+ colorTableContinuousData.forEach((element: any) => {
21
+ continuosColorData.push({color: element.colors, name: element.name})
22
+ });
23
+
24
+ // code is for d3 continuous data
25
+ var d3continuousData = colorScalesCont.filter((element: any) => {
26
+ return element.discrete == false;
27
+ });
28
+
29
+ d3continuousData.forEach((element: any) => {
30
+ continuosD3ColorData.push({color: element.colors, name: element.name})
31
+ });
32
+
33
+ export const ColorSelector: React.FC<legendProps> = ({
34
+ useColorTableColors,
35
+ useD3Colors,
36
+ }: legendProps) => {
37
+ let continuousLegend;
38
+ if (useColorTableColors) {
39
+ continuousLegend = continuosColorData.map((value: any, key: any) => {
40
+ return <LegendContinous
41
+ position={position + key}
42
+ colorArray={value}
43
+ legendColor={''}
44
+ legendColorName={''}
45
+ useContColorTable={true}
46
+ valueIndex={key}
47
+ />
48
+ });
49
+ }
50
+ if (useD3Colors) {
51
+ continuousLegend = continuosD3ColorData.map((val: any, key: any) => {
52
+ return <LegendContinous
53
+ position={position + key}
54
+ colorArray={{}}
55
+ legendColor={val.color}
56
+ legendColorName={val.name}
57
+ useContColorTable={false}
58
+ valueIndex={key + "0"}
59
+ />
60
+ });
61
+ }
62
+
63
+ return (
64
+ <div>
65
+ {continuousLegend}
66
+ </div>
67
+ );
68
+ };
@@ -0,0 +1,51 @@
1
+ import * as React from "react";
2
+ import { Accordion } from "@equinor/eds-core-react";
3
+ import {ColorSelector} from "./ColorSelectorComponent";
4
+
5
+ export const ColorSelectorWrapper = () => {
6
+ // export const ColorSelector: React.FC<legendProps> = ({
7
+ // }: legendProps) => {
8
+ return (
9
+ <div style={{width: "450px"}}>
10
+ <Accordion >
11
+ <Accordion.Item>
12
+ <Accordion.Header>
13
+ Color Scales
14
+ </Accordion.Header>
15
+ <Accordion.Panel>
16
+ <Accordion >
17
+ <Accordion.Item>
18
+ <Accordion.Header>
19
+ Geologic Color Scale
20
+ </Accordion.Header>
21
+ <Accordion.Panel>
22
+ <ColorSelector useColorTableColors={true} useD3Colors={false} key={1}/>
23
+ </Accordion.Panel>
24
+ </Accordion.Item>
25
+ </Accordion>
26
+ <Accordion >
27
+ <Accordion.Item>
28
+ <Accordion.Header>
29
+ D3 Color Scale
30
+ </Accordion.Header>
31
+ <Accordion.Panel>
32
+ <ColorSelector useColorTableColors={false} useD3Colors={true} key={1}/>
33
+ </Accordion.Panel>
34
+ </Accordion.Item>
35
+ </Accordion>
36
+ <Accordion >
37
+ <Accordion.Item>
38
+ <Accordion.Header>
39
+ Custom Color Scale
40
+ </Accordion.Header>
41
+ <Accordion.Panel>
42
+ Custom Content
43
+ </Accordion.Panel>
44
+ </Accordion.Item>
45
+ </Accordion>
46
+ </Accordion.Panel>
47
+ </Accordion.Item>
48
+ </Accordion>
49
+ </div>
50
+ );
51
+ };
@@ -0,0 +1,175 @@
1
+ import * as React from "react";
2
+ import { useRef } from "react";
3
+ import { RGBToHex } from "../Utils/continousLegend";
4
+ import {colorScalesCont} from "../Utils/d3ColorScale"
5
+ import * as d3 from "d3";
6
+
7
+ interface legendProps {
8
+ position?: number[] | null;
9
+ colorArray: any;
10
+ legendColor: any;
11
+ legendColorName: string;
12
+ useContColorTable: boolean;
13
+ valueIndex: any;
14
+ }
15
+
16
+ interface ItemColor {
17
+ color: string;
18
+ offset: number;
19
+ }
20
+
21
+ export const LegendContinous: React.FC<legendProps> = ({
22
+ position,
23
+ colorArray,
24
+ legendColor,
25
+ legendColorName,
26
+ useContColorTable,
27
+ valueIndex,
28
+ }: legendProps) => {
29
+ const divRef = useRef<HTMLDivElement>(null);
30
+ React.useEffect(() => {
31
+ // colortable colors
32
+ if (useContColorTable == true && divRef.current) {
33
+ colortableLegend()
34
+ }
35
+ // d3 colors
36
+ else if (useContColorTable == false && divRef.current) {
37
+ d3colorLegend(colorScalesCont)
38
+ }
39
+ return function cleanup() {
40
+ d3.select(divRef.current).select("svg").remove();
41
+ };
42
+ }, [useContColorTable]);
43
+
44
+ function colortableLegend() {
45
+ const itemColor: ItemColor[] = [];
46
+ colorArray.color.forEach((value: [number, number, number, number]) => {
47
+ // return the color and offset needed to draw the legend
48
+ itemColor.push({
49
+ offset: RGBToHex(value).offset,
50
+ color: RGBToHex(value).color,
51
+ });
52
+ });
53
+
54
+ // append a defs (for definition) element to your SVG
55
+ const svgLegend = d3.select(divRef.current)
56
+ .append("svg")
57
+ .style("height", "50px")
58
+ .style("display", "flex")
59
+
60
+ const defs = svgLegend.append("defs");
61
+ let currentIndex = "linear-gradient-" + valueIndex;
62
+ // append a linearGradient element to the defs and give it a unique id
63
+ const linearGradient = defs
64
+ .append("linearGradient")
65
+ .attr("id", currentIndex)
66
+ .attr("x1", "0%")
67
+ .attr("x2", "100%") //since it's a horizontal linear gradient
68
+ .attr("y1", "0%")
69
+ .attr("y2", "0%");
70
+ // append multiple color stops by using D3's data/enter step
71
+
72
+ linearGradient
73
+ .selectAll("stop")
74
+ .data(itemColor)
75
+ .enter()
76
+ .append("stop")
77
+ .attr("offset", function (data) {
78
+ return data.offset + "%";
79
+ })
80
+ .attr("stop-color", function (data) {
81
+ return data.color;
82
+ });
83
+
84
+ // append title
85
+ svgLegend
86
+ .append("text")
87
+ .attr("class", "legendTitle")
88
+ .attr("x", 0)
89
+ .attr("y", 43)
90
+ .style("text-anchor", "left")
91
+ .text(colorArray.name);
92
+
93
+ // draw the rectangle and fill with gradient
94
+ svgLegend
95
+ .append("rect")
96
+ .attr("x", 180)
97
+ .attr("y", 30)
98
+ .attr("width", 150)
99
+ .attr("height", 25)
100
+ .style("fill", "url(#"+currentIndex+")");
101
+ }
102
+
103
+ // continuous legend using d3 color scale (linear gradiend code)
104
+ function d3colorLegend(colorscale: any) {
105
+
106
+ const itemColor: any = [];
107
+
108
+ colorscale.forEach((value: any) => {
109
+ // return the color and offset needed to draw the legend
110
+ itemColor.push(value.colors);
111
+ });
112
+
113
+ // create an array of steps based on the color scale
114
+ // returns an array of evenly-spaced numbers. Returns the integers from zero to the specified end minus one.
115
+ // d3.range(start, stop, step)
116
+ var data = d3.range(10).map(d=> ({color:legendColor(d/10), value:d}))
117
+ // get the array's min and max value
118
+ var extent: any = d3.extent(data, d => d.value);
119
+
120
+ // append a defs (for definition) element to your SVG
121
+ const svgLegend = d3.select(divRef.current)
122
+ .append("svg")
123
+ .style("height", "50px")
124
+ .style("display", "flex")
125
+
126
+ const defs = svgLegend.append("defs");
127
+ let 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
+
137
+ // append multiple color stops by using D3's data/enter step
138
+ linearGradient.selectAll("stop")
139
+ .data(data)
140
+ .enter().append("stop")
141
+ .attr("offset", d => ((d.value - extent[0]) / (extent[1] - extent[0]) * 100) + "%")
142
+ .attr("stop-color", d => d.color);
143
+
144
+ // append title
145
+ svgLegend
146
+ .append("text")
147
+ .attr("class", "legendTitle")
148
+ .attr("x", 0)
149
+ .attr("y", 43)
150
+ .style("text-anchor", "left")
151
+ .text(legendColorName);
152
+
153
+ // draw the rectangle and fill with gradient
154
+ svgLegend
155
+ .append("rect")
156
+ .attr("x", 180)
157
+ .attr("y", 30)
158
+ .attr("width", 150)
159
+ .attr("height", 25)
160
+ .style("fill", "url(#"+currentIndex+")");
161
+ }
162
+
163
+ return (
164
+ <div
165
+ style={{
166
+ right: position ? position[0] : ' ',
167
+ top: position ? position[1] : ' ',
168
+ }}
169
+ >
170
+ {useContColorTable ? <div className="colortableLegend" ref={divRef}></div>
171
+ :
172
+ <div className="d3colorLegend" ref={divRef}></div>}
173
+ </div>
174
+ );
175
+ };
@@ -0,0 +1,39 @@
1
+ import * as d3 from "d3";
2
+
3
+ export const colorScalesCont = [
4
+ {
5
+ "name": "Spectral",
6
+ "discrete": false,
7
+ "colors": d3.interpolateSpectral
8
+ },
9
+ {
10
+ "name": "RdYlBu",
11
+ "discrete": false,
12
+ "colors": d3.interpolateRdYlBu
13
+ },
14
+ {
15
+ "name": "Warm",
16
+ "discrete": false,
17
+ "colors": d3.interpolateWarm
18
+ },
19
+ {
20
+ "name": "Cool",
21
+ "discrete": false,
22
+ "colors": d3.interpolateCool
23
+ },
24
+ {
25
+ "name": "Viridis",
26
+ "discrete": false,
27
+ "colors": d3.interpolateViridis
28
+ },
29
+ {
30
+ "name": "Inferno",
31
+ "discrete": false,
32
+ "colors": d3.interpolateInferno
33
+ },
34
+ ]
35
+
36
+
37
+ export function interpolatorContinuous(): d3.ScaleSequential<string, never> {
38
+ return d3.scaleSequential(d3.interpolateInferno);
39
+ };
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import { ColorSelectorWrapper } from "../../../component/ColorSelector/ColorTableSelectorWrapper";
3
+ export default {
4
+ component: ColorSelectorWrapper,
5
+ title: "Legends/ColorSelector",
6
+ };
7
+
8
+ const Template = (args) => {
9
+ return <ColorSelectorWrapper />;
10
+ };
11
+
12
+ export const selectorTemplate = Template.bind({});
@@ -0,0 +1,29 @@
1
+ import React from "react";
2
+ import {ContinuousLegend} from "../../../component/Legend/ContinuousLegend";
3
+ export default {
4
+ component: ContinuousLegend,
5
+ title: "Legends/ContinousLegend",
6
+ };
7
+ import colorTables from "../../../component/color-tables.json";
8
+
9
+ const min = 2918;
10
+ const max = 4770;
11
+ const dataObjectName = "Wells / MD";
12
+ const position = [16, 10];
13
+ const horizontal = true;
14
+ const colorName = "Time/Depth";
15
+
16
+ const Template = (args) => {
17
+ return <ContinuousLegend {...args} />;
18
+ };
19
+
20
+ export const MDTemplate = Template.bind({});
21
+ MDTemplate.args = {
22
+ min,
23
+ max,
24
+ dataObjectName,
25
+ position,
26
+ colorName,
27
+ colorTables,
28
+ horizontal,
29
+ };
@@ -0,0 +1,29 @@
1
+ import React from "react";
2
+ import {ContinuousLegend} from "../../../component/Legend/ContinuousLegend";
3
+ export default {
4
+ component: ContinuousLegend,
5
+ title: "Legends/ContinousLegend",
6
+ };
7
+ import colorTables from "../../../component/color-tables.json";
8
+
9
+ const min = 0;
10
+ const max = 1;
11
+ const dataObjectName = "Wells / NTG";
12
+ const position = [16, 10];
13
+ const horizontal = true;
14
+ const colorName = "Rainbow";
15
+
16
+ const Template = (args) => {
17
+ return <ContinuousLegend {...args} />;
18
+ };
19
+
20
+ export const NTGTemplate = Template.bind({});
21
+ NTGTemplate.args = {
22
+ min,
23
+ max,
24
+ dataObjectName,
25
+ position,
26
+ colorName,
27
+ colorTables,
28
+ horizontal,
29
+ };
@@ -0,0 +1,29 @@
1
+ import React from "react";
2
+ import {ContinuousLegend} from "../../../component/Legend/ContinuousLegend";
3
+ export default {
4
+ component: ContinuousLegend,
5
+ title: "Legends/ContinousLegend",
6
+ };
7
+ import colorTables from "../../../component/color-tables.json";
8
+
9
+ const min = -999;
10
+ const max = 14023;
11
+ const dataObjectName = "Wells / PERMTOT";
12
+ const position = [16, 10];
13
+ const horizontal = true;
14
+ const colorName = "Porosity";
15
+
16
+ const Template = (args) => {
17
+ return <ContinuousLegend {...args} />;
18
+ };
19
+
20
+ export const PermTotTemplate = Template.bind({});
21
+ PermTotTemplate.args = {
22
+ min,
23
+ max,
24
+ dataObjectName,
25
+ position,
26
+ colorName,
27
+ colorTables,
28
+ horizontal,
29
+ };
@@ -0,0 +1,29 @@
1
+ import React from "react";
2
+ import {ContinuousLegend} from "../../../component/Legend/ContinuousLegend";
3
+ export default {
4
+ component: ContinuousLegend,
5
+ title: "Legends/ContinousLegend",
6
+ };
7
+ import colorTables from "../../../component/color-tables.json";
8
+
9
+ const min = -999;
10
+ const max = 14023;
11
+ const dataObjectName = "Wells / PERM";
12
+ const position = [16, 10];
13
+ const horizontal = true;
14
+ const colorName = "Permeability";
15
+
16
+ const Template = (args) => {
17
+ return <ContinuousLegend {...args} />;
18
+ };
19
+
20
+ export const PermeabilityTemplate = Template.bind({});
21
+ PermeabilityTemplate.args = {
22
+ min,
23
+ max,
24
+ dataObjectName,
25
+ position,
26
+ colorName,
27
+ colorTables,
28
+ horizontal,
29
+ };
@@ -0,0 +1,29 @@
1
+ import React from "react";
2
+ import {ContinuousLegend} from "../../../component/Legend/ContinuousLegend";
3
+ export default {
4
+ component: ContinuousLegend,
5
+ title: "Legends/ContinousLegend",
6
+ };
7
+ import colorTables from "../../../component/color-tables.json";
8
+
9
+ const min = 0;
10
+ const max = 0.35;
11
+ const dataObjectName = "Wells / POROTOT";
12
+ const position = [16, 10];
13
+ const horizontal = true;
14
+ const colorName = "Porosity";
15
+
16
+ const Template = (args) => {
17
+ return <ContinuousLegend {...args} />;
18
+ };
19
+
20
+ export const PoroTotTemplate = Template.bind({});
21
+ PoroTotTemplate.args = {
22
+ min,
23
+ max,
24
+ dataObjectName,
25
+ position,
26
+ colorName,
27
+ colorTables,
28
+ horizontal,
29
+ };
@@ -0,0 +1,29 @@
1
+ import React from "react";
2
+ import {ContinuousLegend} from "../../../component/Legend/ContinuousLegend";
3
+ export default {
4
+ component: ContinuousLegend,
5
+ title: "Legends/ContinousLegend",
6
+ };
7
+ import colorTables from "../../../component/color-tables.json";
8
+
9
+ const min = 0;
10
+ const max = 0.35;
11
+ const dataObjectName = "Wells / PORO";
12
+ const position = [16, 10];
13
+ const horizontal = true;
14
+ const colorName = "Porosity";
15
+
16
+ const Template = (args) => {
17
+ return <ContinuousLegend {...args} />;
18
+ };
19
+
20
+ export const PorosityTemplate = Template.bind({});
21
+ PorosityTemplate.args = {
22
+ min,
23
+ max,
24
+ dataObjectName,
25
+ position,
26
+ colorName,
27
+ colorTables,
28
+ horizontal,
29
+ };
@@ -0,0 +1,29 @@
1
+ import React from "react";
2
+ import {ContinuousLegend} from "../../../component/Legend/ContinuousLegend";
3
+ export default {
4
+ component: ContinuousLegend,
5
+ title: "Legends/ContinousLegend",
6
+ };
7
+ import colorTables from "../../../component/color-tables.json";
8
+
9
+ const min = 0;
10
+ const max = 1;
11
+ const dataObjectName = "Wells / SW";
12
+ const position = [16, 10];
13
+ const horizontal = true;
14
+ const colorName = "Rainbow";
15
+
16
+ const Template = (args) => {
17
+ return <ContinuousLegend {...args} />;
18
+ };
19
+
20
+ export const SWTemplate = Template.bind({});
21
+ SWTemplate.args = {
22
+ min,
23
+ max,
24
+ dataObjectName,
25
+ position,
26
+ colorName,
27
+ colorTables,
28
+ horizontal,
29
+ };