@emerson-eps/color-tables 1.0.12 → 1.0.14
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/BreakPoint/Canvas.js +3 -15
- package/dist/component/BreakPoint/Canvas.js.map +1 -1
- package/dist/component/BreakPoint/ColorScale.js +1 -1
- package/dist/component/BreakPoint/ColorScale.js.map +1 -1
- package/dist/component/BreakPoint/index.d.ts +1 -1
- package/dist/component/BreakPoint/index.js.map +1 -1
- package/dist/component/ColorSelector/BreakPointModule.js +13 -6
- package/dist/component/ColorSelector/BreakPointModule.js.map +1 -1
- package/dist/component/ColorSelector/ColorSelectorAccordion.js +10 -11
- package/dist/component/ColorSelector/ColorSelectorAccordion.js.map +1 -1
- package/dist/component/ColorSelector/ColorSelectorComponent.js +4 -5
- package/dist/component/ColorSelector/ColorSelectorComponent.js.map +1 -1
- package/dist/component/ColorSelector/ColorSelectorWrapper.js +13 -13
- package/dist/component/ColorSelector/ColorSelectorWrapper.js.map +1 -1
- package/dist/component/ColorSelector/index.d.ts +1 -1
- package/dist/component/Legend/ColorLegend.js +7 -9
- package/dist/component/Legend/ColorLegend.js.map +1 -1
- package/dist/component/Legend/ColorLegend.stories.d.ts +13 -14
- package/dist/component/Legend/ColorLegend.stories.js +85 -32
- package/dist/component/Legend/ColorLegend.stories.js.map +1 -1
- package/dist/component/Legend/ContinuousLegend.js +221 -229
- package/dist/component/Legend/ContinuousLegend.js.map +1 -1
- package/dist/component/Legend/ContinuousLegend.stories.d.ts +15 -10
- package/dist/component/Legend/ContinuousLegend.stories.js +147 -18
- package/dist/component/Legend/ContinuousLegend.stories.js.map +1 -1
- package/dist/component/Legend/DiscreteLegend.js +129 -133
- package/dist/component/Legend/DiscreteLegend.js.map +1 -1
- package/dist/component/Legend/DiscreteLegend.stories.d.ts +14 -9
- package/dist/component/Legend/DiscreteLegend.stories.js +178 -16
- package/dist/component/Legend/DiscreteLegend.stories.js.map +1 -1
- package/dist/component/Utils/Utils.stories.d.ts +7 -0
- package/dist/component/Utils/Utils.stories.js +41 -0
- package/dist/component/Utils/Utils.stories.js.map +1 -0
- package/dist/component/Utils/legendCommonFunction.js +40 -48
- package/dist/component/Utils/legendCommonFunction.js.map +1 -1
- package/package.json +11 -17
- package/dist/component/Utils/legendCommonFunction.stories.d.ts +0 -8
- package/dist/component/Utils/legendCommonFunction.stories.js +0 -35
- package/dist/component/Utils/legendCommonFunction.stories.js.map +0 -1
- package/dist/stories/ColorLegends/ContinousLegends/MD.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/ContinousLegends/MD.stories.js +0 -34
- package/dist/stories/ColorLegends/ContinousLegends/MD.stories.js.map +0 -1
- package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.js +0 -34
- package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.js.map +0 -1
- package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.js +0 -34
- package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.js.map +0 -1
- package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.js +0 -36
- package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.js.map +0 -1
- package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.js +0 -34
- package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.js.map +0 -1
- package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.js +0 -34
- package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.js.map +0 -1
- package/dist/stories/ColorLegends/ContinousLegends/SW.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/ContinousLegends/SW.stories.js +0 -34
- package/dist/stories/ColorLegends/ContinousLegends/SW.stories.js.map +0 -1
- package/dist/stories/ColorLegends/DiscreteLegends/FaciesNoCalcite.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/DiscreteLegends/FaciesNoCalcite.stories.js +0 -39
- package/dist/stories/ColorLegends/DiscreteLegends/FaciesNoCalcite.stories.js.map +0 -1
- package/dist/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.js +0 -31
- package/dist/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.js.map +0 -1
- package/dist/stories/ColorLegends/DiscreteLegends/FaultProximityFlag.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/DiscreteLegends/FaultProximityFlag.stories.js +0 -31
- package/dist/stories/ColorLegends/DiscreteLegends/FaultProximityFlag.stories.js.map +0 -1
- package/dist/stories/ColorLegends/DiscreteLegends/RDE.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/DiscreteLegends/RDE.stories.js +0 -34
- package/dist/stories/ColorLegends/DiscreteLegends/RDE.stories.js.map +0 -1
- package/dist/stories/ColorLegends/DiscreteLegends/RDE_Orig.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/DiscreteLegends/RDE_Orig.stories.js +0 -45
- package/dist/stories/ColorLegends/DiscreteLegends/RDE_Orig.stories.js.map +0 -1
- package/dist/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.js +0 -34
- package/dist/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.js.map +0 -1
- package/dist/stories/ColorLegends/DiscreteLegends/Zonelog.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/DiscreteLegends/Zonelog.stories.js +0 -44
- package/dist/stories/ColorLegends/DiscreteLegends/Zonelog.stories.js.map +0 -1
- package/dist/stories/ColorLegends/LegendWithSelector/LegendSelector.stories.d.ts +0 -7
- package/dist/stories/ColorLegends/LegendWithSelector/LegendSelector.stories.js +0 -33
- package/dist/stories/ColorLegends/LegendWithSelector/LegendSelector.stories.js.map +0 -1
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const BackgroundColor: any;
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { ColorLegend } from ".";
|
|
3
|
+
declare const meta: Meta<typeof ColorLegend>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof ColorLegend>;
|
|
6
|
+
export declare const DefaultStyle: Story;
|
|
7
|
+
export declare const TopLeftPosition: Story;
|
|
8
|
+
export declare const TopRightPosition: Story;
|
|
9
|
+
export declare const VerticalPositioning: Story;
|
|
10
|
+
export declare const BottomRightPosition: Story;
|
|
11
|
+
export declare const BottomLeftPosition: Story;
|
|
12
|
+
export declare const BackgroundColor: Story;
|
|
13
|
+
export declare const LegendWithColorSelector: Story;
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { colorTables } from "..";
|
|
3
|
+
import { ColorLegend } from ".";
|
|
4
|
+
// storybook page
|
|
5
|
+
const meta = {
|
|
5
6
|
title: "Legends/ColorLegend",
|
|
7
|
+
component: ColorLegend,
|
|
8
|
+
decorators: [
|
|
9
|
+
(Story) => {
|
|
10
|
+
return React.createElement(Story, null);
|
|
11
|
+
},
|
|
12
|
+
],
|
|
6
13
|
};
|
|
7
|
-
|
|
8
|
-
const [getColor, setColorName] = React.useState("Rainbow");
|
|
9
|
-
const getColorName = React.useCallback((data) => {
|
|
10
|
-
// for geological color scale data (from color-table.json) => data.name
|
|
11
|
-
// for D3 color scale => data.legendColorName
|
|
12
|
-
setColorName((data === null || data === void 0 ? void 0 : data.name) || (data === null || data === void 0 ? void 0 : data.legendColorName));
|
|
13
|
-
}, []);
|
|
14
|
-
return React.createElement(ColorLegend, Object.assign({}, args, { colorName: getColor, getScale: getColorName }));
|
|
15
|
-
};
|
|
14
|
+
export default meta;
|
|
16
15
|
const defaultProps = {
|
|
17
16
|
horizontal: true,
|
|
18
17
|
isOpenProp: true,
|
|
@@ -27,24 +26,78 @@ const defaultProps = {
|
|
|
27
26
|
numberOfTicks: 3,
|
|
28
27
|
legendScaleSize: 300,
|
|
29
28
|
};
|
|
30
|
-
export const DefaultStyle =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
29
|
+
export const DefaultStyle = {
|
|
30
|
+
args: {
|
|
31
|
+
...defaultProps,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export const TopLeftPosition = {
|
|
35
|
+
args: {
|
|
36
|
+
...defaultProps,
|
|
37
|
+
cssLegendStyles: { left: "0vw", top: "0vh" },
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
export const TopRightPosition = {
|
|
41
|
+
args: {
|
|
42
|
+
...defaultProps,
|
|
43
|
+
cssLegendStyles: { right: "2vw", top: "0vh" },
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
export const VerticalPositioning = {
|
|
47
|
+
args: {
|
|
48
|
+
...defaultProps,
|
|
49
|
+
cssLegendStyles: { right: "0vw", top: "0vh" },
|
|
50
|
+
horizontal: false,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
export const BottomRightPosition = {
|
|
54
|
+
args: {
|
|
55
|
+
...defaultProps,
|
|
56
|
+
cssLegendStyles: { right: "2vw", bottom: "0vh" },
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
export const BottomLeftPosition = {
|
|
60
|
+
args: {
|
|
61
|
+
...defaultProps,
|
|
62
|
+
cssLegendStyles: { left: "0vw", bottom: "0vh" },
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
export const BackgroundColor = {
|
|
66
|
+
args: {
|
|
67
|
+
...defaultProps,
|
|
68
|
+
cssLegendStyles: {
|
|
69
|
+
backgroundColor: "red",
|
|
70
|
+
borderRadius: "5px",
|
|
71
|
+
padding: "5px",
|
|
72
|
+
},
|
|
73
|
+
horizontal: false,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
const ColorSelector = (props) => {
|
|
77
|
+
const [color, setColor] = React.useState("Rainbow");
|
|
78
|
+
const getColorName = React.useCallback((data) => {
|
|
79
|
+
// for geological color scale data (from color-table.json) => data.name
|
|
80
|
+
// for D3 color scale => data.legendColorName
|
|
81
|
+
setColor(data?.name || data?.legendColorName);
|
|
82
|
+
}, []);
|
|
83
|
+
return React.createElement(ColorLegend, { ...props, colorName: color, getScale: getColorName });
|
|
84
|
+
};
|
|
85
|
+
export const LegendWithColorSelector = {
|
|
86
|
+
args: {
|
|
87
|
+
min: 0,
|
|
88
|
+
max: 0.35,
|
|
89
|
+
cssLegendStyles: { left: "0vw", top: "0vh" },
|
|
90
|
+
horizontal: true,
|
|
91
|
+
colorName: "Rainbow",
|
|
92
|
+
dataObjectName: "Legend with Selector",
|
|
93
|
+
colorTables,
|
|
94
|
+
isModal: true,
|
|
95
|
+
isRangeShown: true,
|
|
96
|
+
legendFontSize: 13,
|
|
97
|
+
tickFontSize: 13,
|
|
98
|
+
numberOfTicks: 3,
|
|
99
|
+
legendScaleSize: 300,
|
|
100
|
+
},
|
|
101
|
+
render: (args) => React.createElement(ColorSelector, { ...args }),
|
|
102
|
+
};
|
|
50
103
|
//# sourceMappingURL=ColorLegend.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorLegend.stories.js","sourceRoot":"","sources":["../../../src/component/Legend/ColorLegend.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ColorLegend.stories.js","sourceRoot":"","sources":["../../../src/component/Legend/ColorLegend.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AACjC,OAAO,EAAyB,WAAW,EAAqB,MAAM,GAAG,CAAC;AAE1E,iBAAiB;AACjB,MAAM,IAAI,GAA6B;IACrC,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE;QACV,CAAC,KAAK,EAAE,EAAE;YACR,OAAO,oBAAC,KAAK,OAAG,CAAC;QACnB,CAAC;KACF;CACF,CAAC;AACF,eAAe,IAAI,CAAC;AAIpB,MAAM,YAAY,GAAqB;IACrC,UAAU,EAAE,IAAI;IAChB,UAAU,EAAE,IAAI;IAChB,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,IAAI;IACT,SAAS,EAAE,SAAS;IACpB,cAAc,EAAE,sBAAsB;IACtC,OAAO,EAAE,IAAI;IACb,YAAY,EAAE,IAAI;IAClB,cAAc,EAAE,EAAE;IAClB,YAAY,EAAE,EAAE;IAChB,aAAa,EAAE,CAAC;IAChB,eAAe,EAAE,GAAG;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAU;IACjC,IAAI,EAAE;QACJ,GAAG,YAAY;KAChB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAU;IACpC,IAAI,EAAE;QACJ,GAAG,YAAY;QACf,eAAe,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,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