@emerson-eps/color-tables 0.2.39 → 0.3.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.
- package/dist/component/ColorSelector/ColorSelectorAccordion.js +2 -1
- package/dist/component/ColorSelector/ColorSelectorAccordion.js.map +1 -1
- package/dist/component/ColorSelector/ColorSelectorComponent.js +35 -14
- package/dist/component/ColorSelector/ColorSelectorComponent.js.map +1 -1
- package/dist/component/ColorSelector/ColorSelectorWrapper.js +11 -5
- package/dist/component/ColorSelector/ColorSelectorWrapper.js.map +1 -1
- package/dist/component/Legend/ColorLegend.js +4 -2
- package/dist/component/Legend/ColorLegend.js.map +1 -1
- package/dist/component/Legend/ContinuousLegend.d.ts +2 -2
- package/dist/component/Legend/ContinuousLegend.js +29 -16
- package/dist/component/Legend/ContinuousLegend.js.map +1 -1
- package/dist/component/Legend/ContinuousLegend.stories.d.ts +17 -0
- package/dist/component/Legend/ContinuousLegend.stories.js +38 -0
- package/dist/component/Legend/ContinuousLegend.stories.js.map +1 -0
- package/dist/component/Legend/DiscreteLegend.js +4 -6
- package/dist/component/Legend/DiscreteLegend.js.map +1 -1
- package/dist/component/Utils/d3ColorScale.js +48 -48
- package/dist/component/Utils/d3ColorScale.js.map +1 -1
- package/dist/component/Utils/discreteLegend.js.map +1 -1
- package/dist/component/Utils/legendCommonFunction.d.ts +6 -18
- package/dist/component/Utils/legendCommonFunction.js +44 -21
- package/dist/component/Utils/legendCommonFunction.js.map +1 -1
- package/dist/component/Utils/legendCommonFunction.stories.d.ts +16 -0
- package/dist/component/Utils/legendCommonFunction.stories.js +37 -0
- package/dist/component/Utils/legendCommonFunction.stories.js.map +1 -0
- package/dist/component/color-tables.json +21 -21
- package/dist/index.d.ts +8 -8
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/package.json +16 -8
|
@@ -1,84 +1,84 @@
|
|
|
1
1
|
import * as d3 from "d3";
|
|
2
2
|
export var d3ColorScales = [
|
|
3
3
|
{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
name: "Spectral",
|
|
5
|
+
discrete: false,
|
|
6
|
+
colors: d3.interpolateSpectral,
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
name: "RdYlBu",
|
|
10
|
+
discrete: false,
|
|
11
|
+
colors: d3.interpolateRdYlBu,
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
name: "Warm",
|
|
15
|
+
discrete: false,
|
|
16
|
+
colors: d3.interpolateWarm,
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
name: "Cool",
|
|
20
|
+
discrete: false,
|
|
21
|
+
colors: d3.interpolateCool,
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
name: "Viridis",
|
|
25
|
+
discrete: false,
|
|
26
|
+
colors: d3.interpolateViridis,
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
name: "Inferno",
|
|
30
|
+
discrete: false,
|
|
31
|
+
colors: d3.interpolateInferno,
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
name: "Accent",
|
|
35
|
+
discrete: true,
|
|
36
|
+
colors: d3.schemeAccent,
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
name: "Dark2",
|
|
40
|
+
discrete: true,
|
|
41
|
+
colors: d3.schemeDark2,
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
name: "Paired",
|
|
45
|
+
discrete: true,
|
|
46
|
+
colors: d3.schemePaired,
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
name: "Pastel1",
|
|
50
|
+
discrete: true,
|
|
51
|
+
colors: d3.schemePastel1,
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
name: "Pastel2",
|
|
55
|
+
discrete: true,
|
|
56
|
+
colors: d3.schemePastel2,
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
name: "Set1",
|
|
60
|
+
discrete: true,
|
|
61
|
+
colors: d3.schemeSet1,
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
name: "Set2",
|
|
65
|
+
discrete: true,
|
|
66
|
+
colors: d3.schemeSet3,
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
name: "Set3",
|
|
70
|
+
discrete: true,
|
|
71
|
+
colors: d3.schemeSet3,
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
name: "Tableau10",
|
|
75
|
+
discrete: true,
|
|
76
|
+
colors: d3.schemeTableau10,
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
name: "Category10",
|
|
80
|
+
discrete: true,
|
|
81
|
+
colors: d3.schemeCategory10,
|
|
82
82
|
},
|
|
83
83
|
];
|
|
84
84
|
//# sourceMappingURL=d3ColorScale.js.map
|
|
@@ -1 +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,IAAM,aAAa,GAAG;IAC3B;QACE,
|
|
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,IAAM,aAAa,GAAG;IAC3B;QACE,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,EAAE,CAAC,mBAAmB;KAC/B;IACD;QACE,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,EAAE,CAAC,iBAAiB;KAC7B;IACD;QACE,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,EAAE,CAAC,eAAe;KAC3B;IACD;QACE,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,EAAE,CAAC,eAAe;KAC3B;IACD;QACE,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,EAAE,CAAC,kBAAkB;KAC9B;IACD;QACE,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,EAAE,CAAC,kBAAkB;KAC9B;IACD;QACE,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,CAAC,YAAY;KACxB;IACD;QACE,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,CAAC,WAAW;KACvB;IACD;QACE,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,CAAC,YAAY;KACxB;IACD;QACE,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,CAAC,aAAa;KACzB;IACD;QACE,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,CAAC,aAAa;KACzB;IACD;QACE,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,CAAC,UAAU;KACtB;IACD;QACE,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,CAAC,UAAU;KACtB;IACD;QACE,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,CAAC,UAAU;KACtB;IACD;QACE,IAAI,EAAE,WAAW;QACjB,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,CAAC,eAAe;KAC3B;IACD;QACE,IAAI,EAAE,YAAY;QAClB,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,CAAC,gBAAgB;KAC5B;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discreteLegend.js","sourceRoot":"","sources":["../../../src/component/Utils/discreteLegend.ts"],"names":[],"mappings":"AAIA,2BAA2B;AAC3B,MAAM,CAAC,OAAO,UAAU,kBAAkB,
|
|
1
|
+
{"version":3,"file":"discreteLegend.js","sourceRoot":"","sources":["../../../src/component/Utils/discreteLegend.ts"],"names":[],"mappings":"AAIA,2BAA2B;AAC3B,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,SAAsB,EACtB,gBAA0B,EAC1B,UAAgB;IAEhB,IAAM,YAAY,GAAgB,EAAE,CAAC;IAErC,2BAA2B;IAC3B,SAAS,MAAM,CAAC,CAAM;QACpB,SAAS,UAAU;YACjB,yBAAyB;YACzB,oCAAoC;YACpC,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC;iBACzB,IAAI,CAAC,SAAS,CAAC;iBACf,KAAK,EAAE;iBACP,MAAM,CAAC,GAAG,CAAC;iBACX,MAAM,CAAC,MAAM,CAAC;iBACd,MAAM,CAAC,OAAO,CAAC;iBACf,IAAI,CAAC,UAAU,CAA0B;gBACxC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;YACnB,CAAC,CAAC;iBACD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G,EAAE,UAAU,EAAU,EAAE,CAAS;oBACxC,OAAO,CAAC,CAAC;gBACX,CAAC,CAAC;qBACD,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;aACjB;iBAAM;gBACL,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC;qBAChB,IAAI,CAAC,GAAG,EAAE,UAAU,EAAU,EAAE,CAAS;oBACxC,OAAO,CAAC,CAAC;gBACX,CAAC,CAAC;qBACD,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;aACjB;QACH,CAAC;QAED,UAAU,EAAE,CAAC;IACf,CAAC;IACD,2BAA2B;IAC3B,MAAM,CAAC,UAAU,GAAG,UAAU,QAAa;QACzC,2BAA2B;QAC3B,IAAI,KAAK,GAAQ,EAAE,CAAC;QACpB,KAAK,GAAG,QAAQ,CAAC;QAEjB,KAAK,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,UAAU,EAAO;YACtC,IAAM,UAAU,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;YACnD,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { colorTablesArray } from "../colorTableTypes";
|
|
2
|
+
declare type Color = [number, number, number];
|
|
2
3
|
export declare function colorsArray(colorName: string, iscolorTablesDefined: colorTablesArray | any): any;
|
|
3
|
-
export declare function rgbValues(point: number, colorName: string, iscolorTablesDefined: colorTablesArray | any):
|
|
4
|
-
r: number;
|
|
5
|
-
g: number;
|
|
6
|
-
b: number;
|
|
7
|
-
opacity: number;
|
|
8
|
-
} | undefined;
|
|
4
|
+
export declare function rgbValues(point: number, colorName: string, iscolorTablesDefined: colorTablesArray | any): Color;
|
|
9
5
|
export declare function RGBToHex(rgb: number[]): {
|
|
10
6
|
color: string;
|
|
11
7
|
offset: number;
|
|
@@ -21,15 +17,7 @@ export declare function getRgbData(point: number, colorName: string, iscolorTabl
|
|
|
21
17
|
opacity: number;
|
|
22
18
|
} | undefined;
|
|
23
19
|
export declare function getColors(colorName: string, iscolorTablesDefined: any, point: number): any;
|
|
24
|
-
export declare function sampledColor(colorScaleName: string, point: number, categorial?: boolean, min?: number, max?: number, iscolorTablesDefined?: colorTablesArray | any): number
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
opacity: number;
|
|
29
|
-
};
|
|
30
|
-
export declare function createColorMapFunction(colorScaleName: string): (x: number, categorial: boolean, min: number, max: number, iscolorTablesDefined: colorTablesArray | any) => number[] | {
|
|
31
|
-
r: number;
|
|
32
|
-
g: number;
|
|
33
|
-
b: number;
|
|
34
|
-
opacity: number;
|
|
35
|
-
};
|
|
20
|
+
export declare function sampledColor(colorScaleName: string, point: number, categorial?: boolean, min?: number, max?: number, iscolorTablesDefined?: colorTablesArray | any): [number, number, number, number] | Color;
|
|
21
|
+
export declare function createColorMapFunction(colorScaleName: string): (x: number, categorial?: boolean, min?: number, max?: number, iscolorTablesDefined?: colorTablesArray | any) => [number, number, number, number] | Color;
|
|
22
|
+
export declare function createContinuousLibraryColorScale(name: string, library?: colorTablesArray): (value: number) => Color;
|
|
23
|
+
export {};
|
|
@@ -2,20 +2,29 @@ import { color } from "d3-color";
|
|
|
2
2
|
import { interpolateRgb } from "d3-interpolate";
|
|
3
3
|
import { d3ColorScales } from "./d3ColorScale";
|
|
4
4
|
import colorTables from "../../component/color-tables.json";
|
|
5
|
+
function getColor(rgb) {
|
|
6
|
+
return [rgb["r"], rgb["g"], rgb["b"]];
|
|
7
|
+
}
|
|
5
8
|
// Based on objectName return the colors array from color.tables.json file
|
|
6
9
|
export function colorsArray(colorName, iscolorTablesDefined) {
|
|
7
|
-
var getColorTables = iscolorTablesDefined
|
|
8
|
-
|
|
10
|
+
var getColorTables = iscolorTablesDefined
|
|
11
|
+
? iscolorTablesDefined
|
|
12
|
+
: colorTables;
|
|
13
|
+
var colorTableData = getColorTables.filter(function (value) {
|
|
14
|
+
return value.name.toLowerCase() === colorName.toLowerCase();
|
|
15
|
+
});
|
|
9
16
|
return colorTableData.length > 0 ? colorTableData[0].colors : [];
|
|
10
17
|
}
|
|
11
18
|
// return the colors based on the point
|
|
12
19
|
export function rgbValues(point, colorName, iscolorTablesDefined) {
|
|
13
20
|
var _a;
|
|
14
|
-
var getColorTables = iscolorTablesDefined
|
|
21
|
+
var getColorTables = iscolorTablesDefined
|
|
22
|
+
? iscolorTablesDefined
|
|
23
|
+
: colorTables;
|
|
15
24
|
var colorTableColors = colorsArray(colorName, getColorTables);
|
|
16
25
|
// compare the point and first value from colorTableColors
|
|
17
26
|
var colorArrays = colorTableColors.find(function (value) {
|
|
18
|
-
return point
|
|
27
|
+
return point === value[0];
|
|
19
28
|
});
|
|
20
29
|
// if point and value in color table matches then return particular colors
|
|
21
30
|
if (colorArrays) {
|
|
@@ -29,12 +38,13 @@ export function rgbValues(point, colorName, iscolorTablesDefined) {
|
|
|
29
38
|
});
|
|
30
39
|
var firstColorArray = colorTableColors[index - 1];
|
|
31
40
|
var secondColorArray = colorTableColors[index];
|
|
32
|
-
if ((firstColorArray || secondColorArray)
|
|
41
|
+
if ((firstColorArray || secondColorArray) !== undefined) {
|
|
33
42
|
var t0 = firstColorArray[0];
|
|
34
43
|
var t1 = secondColorArray[0];
|
|
35
44
|
var t = (point - t0) / (t1 - t0); // t = 0.0 gives first color, t = 1.0 gives second color.
|
|
36
45
|
var interpolatedValues = interpolateRgb(RGBToHex(firstColorArray).color, RGBToHex(secondColorArray).color)(t);
|
|
37
|
-
|
|
46
|
+
var c = (_a = color(interpolatedValues)) === null || _a === void 0 ? void 0 : _a.rgb();
|
|
47
|
+
return getColor(c);
|
|
38
48
|
}
|
|
39
49
|
return undefined;
|
|
40
50
|
}
|
|
@@ -68,7 +78,9 @@ export function RGBToHexValue(rgb, max) {
|
|
|
68
78
|
// return the colors based on the point
|
|
69
79
|
export function getRgbData(point, colorName, iscolorTablesDefined) {
|
|
70
80
|
var _a;
|
|
71
|
-
var getColorTables = iscolorTablesDefined
|
|
81
|
+
var getColorTables = iscolorTablesDefined
|
|
82
|
+
? iscolorTablesDefined
|
|
83
|
+
: colorTables;
|
|
72
84
|
// get colortable colorscale data
|
|
73
85
|
var getColorTableScale = getColorTables.find(function (value) {
|
|
74
86
|
return value.name == colorName;
|
|
@@ -126,7 +138,9 @@ export function getRgbData(point, colorName, iscolorTablesDefined) {
|
|
|
126
138
|
}
|
|
127
139
|
export function getColors(colorName, iscolorTablesDefined, point) {
|
|
128
140
|
var _a;
|
|
129
|
-
var getColorTables = iscolorTablesDefined
|
|
141
|
+
var getColorTables = iscolorTablesDefined
|
|
142
|
+
? iscolorTablesDefined
|
|
143
|
+
: colorTables;
|
|
130
144
|
var colorTableData = getColorTables.filter(function (value) {
|
|
131
145
|
return value.name.toLowerCase() == colorName.toLowerCase();
|
|
132
146
|
});
|
|
@@ -137,7 +151,9 @@ export function getColors(colorName, iscolorTablesDefined, point) {
|
|
|
137
151
|
}
|
|
138
152
|
export function sampledColor(colorScaleName, point, categorial, min, max, iscolorTablesDefined) {
|
|
139
153
|
var _a, _b;
|
|
140
|
-
var getColorTables = iscolorTablesDefined
|
|
154
|
+
var getColorTables = iscolorTablesDefined
|
|
155
|
+
? iscolorTablesDefined
|
|
156
|
+
: colorTables;
|
|
141
157
|
// get colortable colorscale data
|
|
142
158
|
var getColorTableScale = getColorTables.find(function (value) {
|
|
143
159
|
return value.name == colorScaleName;
|
|
@@ -157,7 +173,7 @@ export function sampledColor(colorScaleName, point, categorial, min, max, iscolo
|
|
|
157
173
|
//if (min && max) {
|
|
158
174
|
var normalizedPoint = (point - min) / (max - min);
|
|
159
175
|
rgb = rgbValues(normalizedPoint, colorScaleName, getColorTables);
|
|
160
|
-
//}
|
|
176
|
+
//}
|
|
161
177
|
}
|
|
162
178
|
else {
|
|
163
179
|
rgb = rgbValues(point, colorScaleName, getColorTables);
|
|
@@ -171,7 +187,7 @@ export function sampledColor(colorScaleName, point, categorial, min, max, iscolo
|
|
|
171
187
|
var normalizedPoint = (point - min) / (max - min);
|
|
172
188
|
colorMappingRange = getD3Scale === null || getD3Scale === void 0 ? void 0 : getD3Scale.colors(normalizedPoint);
|
|
173
189
|
}
|
|
174
|
-
rgb = (_a = color(colorMappingRange)) === null || _a === void 0 ? void 0 : _a.rgb();
|
|
190
|
+
rgb = getColor((_a = color(colorMappingRange)) === null || _a === void 0 ? void 0 : _a.rgb());
|
|
175
191
|
}
|
|
176
192
|
// colortable discrete scale
|
|
177
193
|
if ((getColorTableScale === null || getColorTableScale === void 0 ? void 0 : getColorTableScale.discrete) == true) {
|
|
@@ -181,7 +197,7 @@ export function sampledColor(colorScaleName, point, categorial, min, max, iscolo
|
|
|
181
197
|
var colorArrays = arrayOfColors.find(function (value) {
|
|
182
198
|
return value[0] == point;
|
|
183
199
|
});
|
|
184
|
-
|
|
200
|
+
return colorArrays;
|
|
185
201
|
}
|
|
186
202
|
else {
|
|
187
203
|
var getSelectedScaleLength = getColorTableScale === null || getColorTableScale === void 0 ? void 0 : getColorTableScale.colors.length;
|
|
@@ -194,12 +210,10 @@ export function sampledColor(colorScaleName, point, categorial, min, max, iscolo
|
|
|
194
210
|
var nextIndex = index + 1;
|
|
195
211
|
var normalizedNextIndex = (nextIndex - minValue_2) / (maxValue_2 - 0);
|
|
196
212
|
//const t = (point - t0) / (t1 - t0); // t = 0.0 gives first color, t = 1.0 gives second color.
|
|
197
|
-
if (point >= normalizedCurrentIndex &&
|
|
198
|
-
|
|
199
|
-
if ((item && (getColorTableScale === null || getColorTableScale === void 0 ? void 0 : getColorTableScale.colors[nextIndex])) !=
|
|
200
|
-
undefined) {
|
|
213
|
+
if (point >= normalizedCurrentIndex && point <= normalizedNextIndex) {
|
|
214
|
+
if ((item && (getColorTableScale === null || getColorTableScale === void 0 ? void 0 : getColorTableScale.colors[nextIndex])) != undefined) {
|
|
201
215
|
var interpolate = interpolateRgb((_a = RGBToHex(item)) === null || _a === void 0 ? void 0 : _a.color, (_b = RGBToHex(getColorTableScale === null || getColorTableScale === void 0 ? void 0 : getColorTableScale.colors[nextIndex])) === null || _b === void 0 ? void 0 : _b.color)(point);
|
|
202
|
-
rgb = (_c = color(interpolate)) === null || _c === void 0 ? void 0 : _c.rgb();
|
|
216
|
+
rgb = getColor((_c = color(interpolate)) === null || _c === void 0 ? void 0 : _c.rgb());
|
|
203
217
|
}
|
|
204
218
|
}
|
|
205
219
|
});
|
|
@@ -214,7 +228,7 @@ export function sampledColor(colorScaleName, point, categorial, min, max, iscolo
|
|
|
214
228
|
var d3ColorArrays = getD3Scale === null || getD3Scale === void 0 ? void 0 : getD3Scale.colors.find(function (_value, index) {
|
|
215
229
|
return index == code_1;
|
|
216
230
|
});
|
|
217
|
-
rgb = (_b = color(d3ColorArrays)) === null || _b === void 0 ? void 0 : _b.rgb();
|
|
231
|
+
rgb = getColor((_b = color(d3ColorArrays)) === null || _b === void 0 ? void 0 : _b.rgb());
|
|
218
232
|
}
|
|
219
233
|
// continous log
|
|
220
234
|
else {
|
|
@@ -226,10 +240,9 @@ export function sampledColor(colorScaleName, point, categorial, min, max, iscolo
|
|
|
226
240
|
var nextIndex = index + 1;
|
|
227
241
|
var normalizedNextIndex = (nextIndex - 0) / (max_1 - 0);
|
|
228
242
|
//const t = (point - t0) / (t1 - t0); // t = 0.0 gives first color, t = 1.0 gives second color.
|
|
229
|
-
if (point >= normalizedCurrentIndex &&
|
|
230
|
-
point <= normalizedNextIndex) {
|
|
243
|
+
if (point >= normalizedCurrentIndex && point <= normalizedNextIndex) {
|
|
231
244
|
var interpolate = interpolateRgb(item, getD3Scale[nextIndex])(point);
|
|
232
|
-
rgb = (_a = color(interpolate)) === null || _a === void 0 ? void 0 : _a.rgb();
|
|
245
|
+
rgb = getColor((_a = color(interpolate)) === null || _a === void 0 ? void 0 : _a.rgb());
|
|
233
246
|
}
|
|
234
247
|
});
|
|
235
248
|
}
|
|
@@ -238,7 +251,17 @@ export function sampledColor(colorScaleName, point, categorial, min, max, iscolo
|
|
|
238
251
|
}
|
|
239
252
|
export function createColorMapFunction(colorScaleName) {
|
|
240
253
|
return function (x, categorial, min, max, iscolorTablesDefined) {
|
|
254
|
+
if (categorial === void 0) { categorial = false; }
|
|
255
|
+
if (min === void 0) { min = 0; }
|
|
256
|
+
if (max === void 0) { max = 1; }
|
|
257
|
+
if (iscolorTablesDefined === void 0) { iscolorTablesDefined = colorTables; }
|
|
241
258
|
return sampledColor(colorScaleName, x, categorial, min, max, iscolorTablesDefined);
|
|
242
259
|
};
|
|
243
260
|
}
|
|
261
|
+
export function createContinuousLibraryColorScale(name, library) {
|
|
262
|
+
if (library === void 0) { library = colorTables; }
|
|
263
|
+
return function (value) {
|
|
264
|
+
return rgbValues(value, name, library);
|
|
265
|
+
};
|
|
266
|
+
}
|
|
244
267
|
//# sourceMappingURL=legendCommonFunction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legendCommonFunction.js","sourceRoot":"","sources":["../../../src/component/Utils/legendCommonFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAKhD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,WAAW,MAAM,mCAAmC,CAAC;AAE5D,0EAA0E;AAC1E,MAAM,UAAU,WAAW,CACvB,SAAiB,EACjB,oBAA4C;IAE5C,IAAM,cAAc,GAAG,oBAAoB,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,WAAW,CAAA;IAChF,IAAM,cAAc,GAAG,cAAc,CAAC,MAAM,CACxC,UAAC,KAAqB,IAAK,OAAA,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,SAAS,CAAC,W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ACf,qCAAA,EAAA,kCAA0D;QAE1D,OAAO,YAAY,CACjB,cAAc,EACd,CAAC,EACD,UAAU,EACV,GAAG,EACH,GAAG,EACH,oBAAoB,CACrB,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC/C,IAAY,EACZ,OAAyC;IAAzC,wBAAA,EAAA,UAAU,WAA+B;IAEzC,OAAO,UAAC,KAAa;QACnB,OAAO,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentMeta } from "@storybook/react";
|
|
3
|
+
declare const _default: ComponentMeta<React.FC<{
|
|
4
|
+
min: number;
|
|
5
|
+
max: number;
|
|
6
|
+
dataObjectName: string;
|
|
7
|
+
position?: number[];
|
|
8
|
+
colorName?: string;
|
|
9
|
+
horizontal?: boolean;
|
|
10
|
+
getColorScaleData?: any;
|
|
11
|
+
id?: string;
|
|
12
|
+
colorTables?: import("../colorTableTypes").colorTablesArray;
|
|
13
|
+
colorMapFunction?: any;
|
|
14
|
+
}>>;
|
|
15
|
+
export default _default;
|
|
16
|
+
export declare const ColorMapFunction: any;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import React from "react";
|
|
13
|
+
import { ContinuousLegend } from "../../component/Legend/ContinuousLegend";
|
|
14
|
+
import { createContinuousLibraryColorScale } from "./legendCommonFunction";
|
|
15
|
+
export default {
|
|
16
|
+
component: ContinuousLegend,
|
|
17
|
+
title: "Utils / Common Functions",
|
|
18
|
+
};
|
|
19
|
+
var min = 0;
|
|
20
|
+
var max = 1;
|
|
21
|
+
var dataObjectName = "Physics color map function";
|
|
22
|
+
var colorName = "Physics";
|
|
23
|
+
function colorMap(value) {
|
|
24
|
+
var f = createContinuousLibraryColorScale(colorName);
|
|
25
|
+
return f(value);
|
|
26
|
+
}
|
|
27
|
+
var ContinuousLegendTemplate = function (args) {
|
|
28
|
+
return React.createElement(ContinuousLegend, __assign({}, args));
|
|
29
|
+
};
|
|
30
|
+
export var ColorMapFunction = ContinuousLegendTemplate.bind({});
|
|
31
|
+
ColorMapFunction.args = {
|
|
32
|
+
min: min,
|
|
33
|
+
max: max,
|
|
34
|
+
dataObjectName: dataObjectName,
|
|
35
|
+
colorMapFunction: colorMap,
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=legendCommonFunction.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legendCommonFunction.stories.js","sourceRoot":"","sources":["../../../src/component/Utils/legendCommonFunction.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,iCAAiC,EAAE,MAAM,wBAAwB,CAAC;AAE3E,eAAe;IACb,SAAS,EAAE,gBAAgB;IAC3B,KAAK,EAAE,0BAA0B;CACQ,CAAC;AAE5C,IAAM,GAAG,GAAG,CAAC,CAAC;AACd,IAAM,GAAG,GAAG,CAAC,CAAC;AACd,IAAM,cAAc,GAAG,4BAA4B,CAAC;AACpD,IAAM,SAAS,GAAG,SAAS,CAAC;AAE5B,SAAS,QAAQ,CAAC,KAAa;IAC7B,IAAM,CAAC,GAAG,iCAAiC,CAAC,SAAS,CAAC,CAAC;IACvD,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC;AAClB,CAAC;AAED,IAAM,wBAAwB,GAA4C,UACxE,IAAI;IAEJ,OAAO,oBAAC,gBAAgB,eAAK,IAAI,EAAI,CAAC;AACxC,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,gBAAgB,GAAG,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAClE,gBAAgB,CAAC,IAAI,GAAG;IACtB,GAAG,KAAA;IACH,GAAG,KAAA;IACH,cAAc,gBAAA;IACd,gBAAgB,EAAE,QAAQ;CAC3B,CAAC"}
|
|
@@ -3,30 +3,30 @@
|
|
|
3
3
|
"name": "Physics",
|
|
4
4
|
"discrete": false,
|
|
5
5
|
"colors": [
|
|
6
|
-
[0.
|
|
6
|
+
[0.0, 255, 0, 0],
|
|
7
7
|
[0.25, 255, 255, 0],
|
|
8
|
-
[0.
|
|
8
|
+
[0.5, 0, 255, 0],
|
|
9
9
|
[0.75, 0, 255, 255],
|
|
10
|
-
[1.
|
|
10
|
+
[1.0, 0, 0, 255]
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
"name": "Rainbow",
|
|
15
15
|
"discrete": false,
|
|
16
16
|
"colors": [
|
|
17
|
-
[0.
|
|
18
|
-
[0.
|
|
19
|
-
[0.
|
|
20
|
-
[0.
|
|
21
|
-
[0.
|
|
22
|
-
[1.
|
|
17
|
+
[0.0, 255, 0, 0],
|
|
18
|
+
[0.2, 255, 255, 0],
|
|
19
|
+
[0.4, 0, 255, 0],
|
|
20
|
+
[0.6, 0, 255, 255],
|
|
21
|
+
[0.8, 0, 0, 255],
|
|
22
|
+
[1.0, 255, 0, 255]
|
|
23
23
|
]
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"name": "Porosity",
|
|
27
27
|
"discrete": false,
|
|
28
28
|
"colors": [
|
|
29
|
-
[0.
|
|
29
|
+
[0.0, 255, 246, 117],
|
|
30
30
|
[0.11, 255, 243, 53],
|
|
31
31
|
[0.18, 255, 241, 0],
|
|
32
32
|
[0.25, 155, 193, 0],
|
|
@@ -34,19 +34,19 @@
|
|
|
34
34
|
[0.39, 255, 162, 61],
|
|
35
35
|
[0.46, 255, 126, 45],
|
|
36
36
|
[0.53, 227, 112, 24],
|
|
37
|
-
[0.
|
|
37
|
+
[0.6, 246, 96, 31],
|
|
38
38
|
[0.67, 229, 39, 48],
|
|
39
39
|
[0.74, 252, 177, 170],
|
|
40
40
|
[0.81, 236, 103, 146],
|
|
41
41
|
[0.88, 226, 44, 118],
|
|
42
|
-
[1.
|
|
42
|
+
[1.0, 126, 40, 111]
|
|
43
43
|
]
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
"name": "Permeability",
|
|
47
47
|
"discrete": false,
|
|
48
48
|
"colors": [
|
|
49
|
-
[0.
|
|
49
|
+
[0.0, 119, 63, 49],
|
|
50
50
|
[0.148, 135, 49, 45],
|
|
51
51
|
[0.246, 154, 89, 24],
|
|
52
52
|
[0.344, 191, 88, 22],
|
|
@@ -55,37 +55,37 @@
|
|
|
55
55
|
[0.637, 255, 162, 61],
|
|
56
56
|
[0.734, 255, 155, 23],
|
|
57
57
|
[0.832, 255, 241, 0],
|
|
58
|
-
[1.
|
|
58
|
+
[1.0, 255, 246, 117]
|
|
59
59
|
]
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
"name": "Seismic",
|
|
63
63
|
"discrete": false,
|
|
64
64
|
"colors": [
|
|
65
|
-
[0.
|
|
66
|
-
[0.
|
|
67
|
-
[1.
|
|
65
|
+
[0.0, 0, 0, 255],
|
|
66
|
+
[0.5, 255, 255, 255],
|
|
67
|
+
[1.0, 255, 2, 2]
|
|
68
68
|
]
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
"name": "Time/Depth",
|
|
72
72
|
"discrete": false,
|
|
73
73
|
"colors": [
|
|
74
|
-
[0.
|
|
75
|
-
[0.
|
|
74
|
+
[0.0, 252, 174, 169],
|
|
75
|
+
[0.1, 226, 44, 118],
|
|
76
76
|
[0.168, 229, 39, 48],
|
|
77
77
|
[0.234, 150, 40, 34],
|
|
78
78
|
[0.301, 255, 126, 45],
|
|
79
79
|
[0.367, 255, 162, 61],
|
|
80
80
|
[0.434, 255, 241, 0],
|
|
81
|
-
[0.
|
|
81
|
+
[0.5, 219, 228, 163],
|
|
82
82
|
[0.566, 0, 143, 74],
|
|
83
83
|
[0.633, 0, 110, 78],
|
|
84
84
|
[0.699, 0, 124, 140],
|
|
85
85
|
[0.766, 116, 190, 230],
|
|
86
86
|
[0.832, 0, 143, 212],
|
|
87
87
|
[0.898, 0, 51, 116],
|
|
88
|
-
[1.
|
|
88
|
+
[1.0, 74, 19, 86]
|
|
89
89
|
]
|
|
90
90
|
},
|
|
91
91
|
{
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ColorSelectorAccordion } from
|
|
2
|
-
import { ColorLegend } from
|
|
3
|
-
import { colorsArray, rgbValues, RGBToHex, createColorMapFunction, getColors, getRgbData, RGBToHexValue } from
|
|
4
|
-
import { d3ColorScales } from
|
|
5
|
-
import { colorTablesObj, colorTablesArray } from
|
|
6
|
-
import { ContinuousLegend } from
|
|
7
|
-
import { DiscreteColorLegend } from
|
|
8
|
-
import * as colorTables from
|
|
1
|
+
import { ColorSelectorAccordion } from "./component/ColorSelector/ColorSelectorAccordion";
|
|
2
|
+
import { ColorLegend } from "./component/Legend/ColorLegend";
|
|
3
|
+
import { colorsArray, rgbValues, RGBToHex, createColorMapFunction, getColors, getRgbData, RGBToHexValue } from "./component/Utils/legendCommonFunction";
|
|
4
|
+
import { d3ColorScales } from "./component/Utils/d3ColorScale";
|
|
5
|
+
import { colorTablesObj, colorTablesArray } from "./component/colorTableTypes";
|
|
6
|
+
import { ContinuousLegend } from "./component/Legend/ContinuousLegend";
|
|
7
|
+
import { DiscreteColorLegend } from "./component/Legend/DiscreteLegend";
|
|
8
|
+
import * as colorTables from "./component/color-tables.json";
|
|
9
9
|
export { ColorSelectorAccordion, ContinuousLegend, DiscreteColorLegend, ColorLegend, colorsArray, rgbValues, RGBToHex, createColorMapFunction, getColors, getRgbData, RGBToHexValue, d3ColorScales, colorTablesObj, colorTablesArray, colorTables, };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ColorSelectorAccordion } from
|
|
2
|
-
import { ColorLegend } from
|
|
3
|
-
import { colorsArray, rgbValues, RGBToHex, createColorMapFunction, getColors, getRgbData, RGBToHexValue } from
|
|
4
|
-
import { d3ColorScales } from
|
|
5
|
-
import { ContinuousLegend } from
|
|
6
|
-
import { DiscreteColorLegend } from
|
|
7
|
-
import * as colorTables from
|
|
1
|
+
import { ColorSelectorAccordion } from "./component/ColorSelector/ColorSelectorAccordion";
|
|
2
|
+
import { ColorLegend } from "./component/Legend/ColorLegend";
|
|
3
|
+
import { colorsArray, rgbValues, RGBToHex, createColorMapFunction, getColors, getRgbData, RGBToHexValue, } from "./component/Utils/legendCommonFunction";
|
|
4
|
+
import { d3ColorScales } from "./component/Utils/d3ColorScale";
|
|
5
|
+
import { ContinuousLegend } from "./component/Legend/ContinuousLegend";
|
|
6
|
+
import { DiscreteColorLegend } from "./component/Legend/DiscreteLegend";
|
|
7
|
+
import * as colorTables from "./component/color-tables.json";
|
|
8
8
|
export { ColorSelectorAccordion, ContinuousLegend, DiscreteColorLegend, ColorLegend, colorsArray, rgbValues, RGBToHex, createColorMapFunction, getColors, getRgbData, RGBToHexValue, d3ColorScales, colorTables, };
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kDAAkD,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kDAAkD,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EACL,WAAW,EACX,SAAS,EACT,QAAQ,EACR,sBAAsB,EACtB,SAAS,EACT,UAAU,EACV,aAAa,GACd,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,WAAW,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,SAAS,EACT,QAAQ,EACR,sBAAsB,EACtB,SAAS,EACT,UAAU,EACV,aAAa,EACb,aAAa,EAGb,WAAW,GACZ,CAAC"}
|