@emerson-eps/color-tables 1.0.0 → 1.0.2
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.d.ts +3 -3
- package/dist/component/BreakPoint/Canvas.js +10 -21
- package/dist/component/BreakPoint/Canvas.js.map +1 -1
- package/dist/component/BreakPoint/ColorScale.d.ts +2 -3
- package/dist/component/BreakPoint/ColorScale.js +19 -20
- package/dist/component/BreakPoint/ColorScale.js.map +1 -1
- package/dist/component/BreakPoint/Legend.d.ts +2 -3
- package/dist/component/BreakPoint/Legend.js +31 -37
- package/dist/component/BreakPoint/Legend.js.map +1 -1
- package/dist/component/BreakPoint/Modal.d.ts +6 -3
- package/dist/component/BreakPoint/Modal.js +17 -21
- package/dist/component/BreakPoint/Modal.js.map +1 -1
- package/dist/component/BreakPoint/index.d.ts +4 -0
- package/dist/component/BreakPoint/index.js +6 -0
- package/dist/component/BreakPoint/index.js.map +1 -0
- package/dist/component/ColorSelector/BreakPointModule.d.ts +3 -4
- package/dist/component/ColorSelector/BreakPointModule.js +99 -140
- package/dist/component/ColorSelector/BreakPointModule.js.map +1 -1
- package/dist/component/ColorSelector/ColorSelectorAccordion.js +55 -60
- package/dist/component/ColorSelector/ColorSelectorAccordion.js.map +1 -1
- package/dist/component/ColorSelector/ColorSelectorComponent.d.ts +2 -3
- package/dist/component/ColorSelector/ColorSelectorComponent.js +83 -86
- package/dist/component/ColorSelector/ColorSelectorComponent.js.map +1 -1
- package/dist/component/ColorSelector/ColorSelectorWrapper.d.ts +12 -5
- package/dist/component/ColorSelector/ColorSelectorWrapper.js +41 -51
- package/dist/component/ColorSelector/ColorSelectorWrapper.js.map +1 -1
- package/dist/component/ColorSelector/index.d.ts +4 -0
- package/dist/component/ColorSelector/index.js +6 -0
- package/dist/component/ColorSelector/index.js.map +1 -0
- package/dist/component/Legend/ColorLegend.d.ts +2 -2
- package/dist/component/Legend/ColorLegend.js +38 -39
- package/dist/component/Legend/ColorLegend.js.map +1 -1
- package/dist/component/Legend/ColorLegend.stories.js +20 -31
- package/dist/component/Legend/ColorLegend.stories.js.map +1 -1
- package/dist/component/Legend/ContinuousLegend.d.ts +2 -2
- package/dist/component/Legend/ContinuousLegend.js +230 -276
- package/dist/component/Legend/ContinuousLegend.js.map +1 -1
- package/dist/component/Legend/ContinuousLegend.stories.js +13 -24
- package/dist/component/Legend/ContinuousLegend.stories.js.map +1 -1
- package/dist/component/Legend/DiscreteLegend.d.ts +2 -2
- package/dist/component/Legend/DiscreteLegend.js +130 -180
- package/dist/component/Legend/DiscreteLegend.js.map +1 -1
- package/dist/component/Legend/DiscreteLegend.stories.js +15 -26
- package/dist/component/Legend/DiscreteLegend.stories.js.map +1 -1
- package/dist/component/Legend/constants.js +1 -1
- package/dist/component/Legend/constants.js.map +1 -1
- package/dist/component/Legend/index.d.ts +3 -0
- package/dist/component/Legend/index.js +4 -0
- package/dist/component/Legend/index.js.map +1 -0
- package/dist/component/Utils/d3ColorScale.js +1 -1
- package/dist/component/Utils/d3ColorScale.js.map +1 -1
- package/dist/component/Utils/discreteLegend.d.ts +2 -3
- package/dist/component/Utils/discreteLegend.js.map +1 -1
- package/dist/component/Utils/index.d.ts +2 -0
- package/dist/component/Utils/index.js +4 -0
- package/dist/component/Utils/index.js.map +1 -0
- package/dist/component/Utils/legendCommonFunction.d.ts +7 -7
- package/dist/component/Utils/legendCommonFunction.js +128 -139
- package/dist/component/Utils/legendCommonFunction.js.map +1 -1
- package/dist/component/Utils/legendCommonFunction.stories.js +14 -25
- package/dist/component/Utils/legendCommonFunction.stories.js.map +1 -1
- package/dist/component/colorTableTypes.d.ts +10 -2
- package/dist/component/index.d.ts +8 -0
- package/dist/component/index.js +9 -0
- package/dist/component/index.js.map +1 -0
- package/dist/index.d.ts +1 -9
- package/dist/index.js +1 -8
- package/dist/index.js.map +1 -1
- package/dist/stories/ColorLegends/ContinousLegends/MD.stories.d.ts +7 -0
- package/dist/stories/ColorLegends/ContinousLegends/MD.stories.js +34 -0
- package/dist/stories/ColorLegends/ContinousLegends/MD.stories.js.map +1 -0
- package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.d.ts +7 -0
- package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.js +34 -0
- package/dist/stories/ColorLegends/ContinousLegends/NTG.stories.js.map +1 -0
- package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.d.ts +7 -0
- package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.js +34 -0
- package/dist/stories/ColorLegends/ContinousLegends/PermTot.stories.js.map +1 -0
- package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.d.ts +7 -0
- package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.js +36 -0
- package/dist/stories/ColorLegends/ContinousLegends/Permeability.stories.js.map +1 -0
- package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.d.ts +7 -0
- package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.js +34 -0
- package/dist/stories/ColorLegends/ContinousLegends/PoroTot.stories.js.map +1 -0
- package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.d.ts +7 -0
- package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.js +34 -0
- package/dist/stories/ColorLegends/ContinousLegends/Porosity.stories.js.map +1 -0
- package/dist/stories/ColorLegends/ContinousLegends/SW.stories.d.ts +7 -0
- package/dist/stories/ColorLegends/ContinousLegends/SW.stories.js +34 -0
- package/dist/stories/ColorLegends/ContinousLegends/SW.stories.js.map +1 -0
- package/dist/stories/ColorLegends/DiscreteLegends/FaciesNoCalcite.stories.d.ts +7 -0
- package/dist/stories/ColorLegends/DiscreteLegends/FaciesNoCalcite.stories.js +39 -0
- package/dist/stories/ColorLegends/DiscreteLegends/FaciesNoCalcite.stories.js.map +1 -0
- package/dist/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.d.ts +7 -0
- package/dist/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.js +31 -0
- package/dist/stories/ColorLegends/DiscreteLegends/FaultDistanceHum.stories.js.map +1 -0
- package/dist/stories/ColorLegends/DiscreteLegends/FaultProximityFlag.stories.d.ts +7 -0
- package/dist/stories/ColorLegends/DiscreteLegends/FaultProximityFlag.stories.js +31 -0
- package/dist/stories/ColorLegends/DiscreteLegends/FaultProximityFlag.stories.js.map +1 -0
- package/dist/stories/ColorLegends/DiscreteLegends/RDE.stories.d.ts +7 -0
- package/dist/stories/ColorLegends/DiscreteLegends/RDE.stories.js +34 -0
- package/dist/stories/ColorLegends/DiscreteLegends/RDE.stories.js.map +1 -0
- package/dist/stories/ColorLegends/DiscreteLegends/RDE_Orig.stories.d.ts +7 -0
- package/dist/stories/ColorLegends/DiscreteLegends/RDE_Orig.stories.js +45 -0
- package/dist/stories/ColorLegends/DiscreteLegends/RDE_Orig.stories.js.map +1 -0
- package/dist/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.d.ts +7 -0
- package/dist/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.js +34 -0
- package/dist/stories/ColorLegends/DiscreteLegends/ZoneMain.stories.js.map +1 -0
- package/dist/stories/ColorLegends/DiscreteLegends/Zonelog.stories.d.ts +7 -0
- package/dist/stories/ColorLegends/DiscreteLegends/Zonelog.stories.js +44 -0
- package/dist/stories/ColorLegends/DiscreteLegends/Zonelog.stories.js.map +1 -0
- package/dist/stories/ColorLegends/LegendWithSelector/LegendSelector.stories.d.ts +7 -0
- package/dist/stories/ColorLegends/LegendWithSelector/LegendSelector.stories.js +33 -0
- package/dist/stories/ColorLegends/LegendWithSelector/LegendSelector.stories.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Do not export * to skip deprecated exports
|
|
2
|
+
export * from "./BreakPointModule";
|
|
3
|
+
export * from "./ColorSelectorAccordion";
|
|
4
|
+
export * from "./ColorSelectorComponent";
|
|
5
|
+
export { ColorSelectorWrapper, } from "./ColorSelectorWrapper";
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/ColorSelector/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAIL,oBAAoB,GACrB,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { ColorTableArray } from "../colorTableTypes";
|
|
3
3
|
export type ScaleHandler = (data: {
|
|
4
4
|
name: string;
|
|
5
5
|
legendColorName: string;
|
|
6
6
|
}) => void;
|
|
7
7
|
export type ColorLegendProps = {
|
|
8
|
-
colorTables?:
|
|
8
|
+
colorTables?: ColorTableArray;
|
|
9
9
|
min?: number;
|
|
10
10
|
max?: number;
|
|
11
11
|
dataObjectName?: string;
|
|
@@ -9,20 +9,19 @@ import { d3ColorScales } from "../Utils/d3ColorScale";
|
|
|
9
9
|
import defaultColorTables from "../color-tables.json";
|
|
10
10
|
import { DEFAULT_STYLE } from "./constants";
|
|
11
11
|
// Todo: Adapt it for other layers too
|
|
12
|
-
export
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var interpolationType;
|
|
12
|
+
export const ColorLegend = ({ horizontal, colorTables = defaultColorTables, min = 0, max = 1, dataObjectName, colorName = "Rainbow", discreteData, colorNameFromSelector, reverseRange, getColorRange, getBreakpointValue, getScale, getInterpolateMethod, isModal, isRangeShown = true, legendFontSize = 18, tickFontSize = 12, numberOfTicks = 1, legendScaleSize = 200, cssLegendStyles = DEFAULT_STYLE, isOpenProp = false, openColorSelector = true, }) => {
|
|
13
|
+
var _a;
|
|
14
|
+
const generateUniqueId = Math.ceil(Math.random() * 9999).toString();
|
|
15
|
+
const divRef = useRef(null);
|
|
16
|
+
const colorSelectorRef = useRef(null);
|
|
17
|
+
const [isOpen, setIsOpen] = React.useState(isOpenProp);
|
|
18
|
+
const [isAuto, setAuto] = React.useState(true);
|
|
19
|
+
const [newMin, setNewMin] = React.useState();
|
|
20
|
+
const [newMax, setNewMax] = React.useState();
|
|
21
|
+
const [isLog, setLog] = React.useState(false);
|
|
22
|
+
const [getItemColor, setItemColor] = React.useState([]);
|
|
23
|
+
const [isNearest, setIsNearest] = React.useState(false);
|
|
24
|
+
let interpolationType;
|
|
26
25
|
if (isNearest) {
|
|
27
26
|
interpolationType = { isNearest: true };
|
|
28
27
|
}
|
|
@@ -33,7 +32,7 @@ export var ColorLegend = function (_a) {
|
|
|
33
32
|
interpolationType = { isLinear: true };
|
|
34
33
|
}
|
|
35
34
|
// callback function for modifying range
|
|
36
|
-
|
|
35
|
+
const getRange = React.useCallback((data) => {
|
|
37
36
|
if (data === "Auto") {
|
|
38
37
|
setAuto(true);
|
|
39
38
|
if (getColorRange)
|
|
@@ -49,7 +48,7 @@ export var ColorLegend = function (_a) {
|
|
|
49
48
|
}
|
|
50
49
|
}
|
|
51
50
|
}, [getColorRange]);
|
|
52
|
-
|
|
51
|
+
const getInterpolation = React.useCallback((data) => {
|
|
53
52
|
if (data === "Logarithmic") {
|
|
54
53
|
setLog(true);
|
|
55
54
|
setIsNearest(false);
|
|
@@ -71,31 +70,31 @@ export var ColorLegend = function (_a) {
|
|
|
71
70
|
getInterpolateMethod({ isLog: false, isNearest: false });
|
|
72
71
|
}
|
|
73
72
|
}, [getInterpolateMethod]);
|
|
74
|
-
|
|
73
|
+
const breakpointValues = React.useCallback((data) => {
|
|
75
74
|
if (data) {
|
|
76
75
|
setItemColor(data);
|
|
77
76
|
if (getBreakpointValue)
|
|
78
77
|
getBreakpointValue(data);
|
|
79
78
|
}
|
|
80
79
|
}, [getBreakpointValue]);
|
|
81
|
-
|
|
80
|
+
const toggleColorSelector = useCallback(() => {
|
|
82
81
|
if (divRef && divRef.current) {
|
|
83
82
|
isOpen ? setIsOpen(false) : setIsOpen(true);
|
|
84
83
|
}
|
|
85
84
|
}, [isOpen]);
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
const [getColorScaleData, setGetColorScaleData] = React.useState([]);
|
|
86
|
+
const isColortableColors = colorTables === null || colorTables === void 0 ? void 0 : colorTables.find((value) => {
|
|
88
87
|
return (value === null || value === void 0 ? void 0 : value.name) === colorName || colorNameFromSelector;
|
|
89
88
|
});
|
|
90
|
-
|
|
89
|
+
const isD3Colors = d3ColorScales.find((value) => {
|
|
91
90
|
return (value === null || value === void 0 ? void 0 : value.name) === colorName || colorNameFromSelector;
|
|
92
91
|
});
|
|
93
|
-
|
|
92
|
+
const [isCont, setIsCont] = React.useState((isColortableColors || isD3Colors) &&
|
|
94
93
|
((isColortableColors === null || isColortableColors === void 0 ? void 0 : isColortableColors.discrete) === false || (isD3Colors === null || isD3Colors === void 0 ? void 0 : isD3Colors.discrete) === false)
|
|
95
94
|
? true
|
|
96
|
-
: false)
|
|
95
|
+
: false);
|
|
97
96
|
// Get new colorscale from colorselector and update legend
|
|
98
|
-
|
|
97
|
+
const getSelectedColorScale = React.useCallback((data, value) => {
|
|
99
98
|
// update color map layer
|
|
100
99
|
if (data.name && colorNameFromSelector) {
|
|
101
100
|
colorNameFromSelector(data.name);
|
|
@@ -113,55 +112,55 @@ export var ColorLegend = function (_a) {
|
|
|
113
112
|
if (getBreakpointValue)
|
|
114
113
|
getBreakpointValue({ breakpoint: [] });
|
|
115
114
|
}, [colorNameFromSelector, getBreakpointValue, getScale]);
|
|
116
|
-
|
|
115
|
+
const handleModalClick = React.useCallback((e) => {
|
|
117
116
|
var _a;
|
|
118
117
|
if (!((_a = colorSelectorRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) && isOpen) {
|
|
119
118
|
setIsOpen(false);
|
|
120
119
|
}
|
|
121
120
|
}, [isOpen]);
|
|
122
|
-
React.useEffect(
|
|
121
|
+
React.useEffect(() => {
|
|
123
122
|
if (isOpen && isModal) {
|
|
124
123
|
document.addEventListener("mousedown", handleModalClick);
|
|
125
124
|
}
|
|
126
125
|
else {
|
|
127
126
|
document.removeEventListener("mousedown", handleModalClick);
|
|
128
127
|
}
|
|
129
|
-
return
|
|
128
|
+
return () => document.removeEventListener("mousedown", handleModalClick);
|
|
130
129
|
}, [isOpen, isModal, handleModalClick]);
|
|
131
130
|
/* Defining some states to rerender the component upon prop change in storybook */
|
|
132
131
|
// defining a state that controls the legend name and allows editing it
|
|
133
|
-
|
|
134
|
-
React.useEffect(
|
|
132
|
+
const [legendName, setLegendName] = React.useState(dataObjectName);
|
|
133
|
+
React.useEffect(() => {
|
|
135
134
|
setLegendName(dataObjectName);
|
|
136
135
|
}, [dataObjectName]);
|
|
137
136
|
// defining a state that controls the legend name FONT SIZE and allows editing it
|
|
138
|
-
|
|
139
|
-
React.useEffect(
|
|
137
|
+
const [legendFontSizeState, setLegendFontSize] = React.useState(legendFontSize);
|
|
138
|
+
React.useEffect(() => {
|
|
140
139
|
setLegendFontSize(legendFontSize);
|
|
141
140
|
}, [legendFontSize]);
|
|
142
141
|
// defining a state that controls the legend ticks' FONT SIZE and allows editing them
|
|
143
|
-
|
|
144
|
-
React.useEffect(
|
|
142
|
+
const [tickFontSizeState, setTickFontSize] = React.useState(tickFontSize);
|
|
143
|
+
React.useEffect(() => {
|
|
145
144
|
setTickFontSize(tickFontSize);
|
|
146
145
|
}, [tickFontSize]);
|
|
147
146
|
// defining a state that manages number of ticks
|
|
148
|
-
|
|
149
|
-
React.useEffect(
|
|
147
|
+
const [numberOfTicksState, setNumberOfTicks] = React.useState(numberOfTicks);
|
|
148
|
+
React.useEffect(() => {
|
|
150
149
|
setNumberOfTicks(numberOfTicks);
|
|
151
150
|
}, [numberOfTicks]);
|
|
152
151
|
// defining a state managing the legend scale size
|
|
153
|
-
|
|
154
|
-
React.useEffect(
|
|
152
|
+
const [legendScaleSizeState, setLegendScaleSize] = React.useState(legendScaleSize);
|
|
153
|
+
React.useEffect(() => {
|
|
155
154
|
setLegendScaleSize(legendScaleSize);
|
|
156
155
|
}, [legendScaleSize]);
|
|
157
|
-
|
|
156
|
+
const theme = useTheme();
|
|
158
157
|
return (React.createElement(ThemeProvider, { theme: theme },
|
|
159
158
|
React.createElement("div", null,
|
|
160
159
|
React.createElement("div", { ref: divRef, onClick: toggleColorSelector, style: { display: "inline-block", cursor: "pointer" }, title: "Click here to edit" },
|
|
161
160
|
isCont === true && (React.createElement(ContinuousLegend, { min: newMin && !isAuto ? newMin : min, max: newMax && !isAuto ? newMax : max, dataObjectName: legendName, colorName: colorName, horizontal: horizontal, getColorScaleData: getColorScaleData, id: generateUniqueId, colorTables: colorTables, reverseRange: reverseRange, editedBreakPointValues: getItemColor, isLog: isLog, isNearest: isNearest, isRangeShown: isRangeShown, legendFontSize: legendFontSizeState, tickFontSize: tickFontSizeState, numberOfTicks: numberOfTicksState, legendScaleSize: legendScaleSizeState, cssLegendStyles: cssLegendStyles })),
|
|
162
161
|
isCont === false && (React.createElement(DiscreteColorLegend, { discreteData: discreteData, dataObjectName: legendName, colorName: colorName, horizontal: horizontal, getColorScaleData: getColorScaleData, id: generateUniqueId, colorTables: colorTables, legendFontSize: legendFontSizeState, tickFontSize: tickFontSizeState, numberOfTicks: numberOfTicksState, legendScaleSize: legendScaleSizeState, cssLegendStyles: cssLegendStyles }))),
|
|
163
162
|
React.createElement("div", null, isOpen && openColorSelector && (React.createElement("div", { style: { display: "inline-block" }, ref: colorSelectorRef },
|
|
164
|
-
React.createElement(ColorSelectorAccordion, { setIsOpen:
|
|
163
|
+
React.createElement(ColorSelectorAccordion, { setIsOpen: () => setIsOpen(false), isModal: isModal, dataObjectName: legendName, isHorizontal: horizontal, colorTables: colorTables, getRange: getRange, isCont: isCont, getEditedBreakPoint: breakpointValues, newColorScaleData: getSelectedColorScale, handleModalClick: handleModalClick, currentLegendName: ((_a = getColorScaleData === null || getColorScaleData === void 0 ? void 0 : getColorScaleData.color) === null || _a === void 0 ? void 0 : _a.length) > 0
|
|
165
164
|
? getColorScaleData.name
|
|
166
165
|
: colorName, getInterpolation: getInterpolation, legendScaleSize: legendScaleSizeState, cssLegendStyles: cssLegendStyles, selectedInterpolationType: interpolationType, selectedRangeType: isAuto ? { isAuto: true } : { isAuto: false } })))))));
|
|
167
166
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorLegend.js","sourceRoot":"","sources":["../../../src/component/Legend/ColorLegend.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAgC5C,sCAAsC;AACtC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"ColorLegend.js","sourceRoot":"","sources":["../../../src/component/Legend/ColorLegend.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;A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.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
1
|
import React from "react";
|
|
13
2
|
import { ColorLegend } from "./ColorLegend";
|
|
14
3
|
export default {
|
|
15
4
|
component: ColorLegend,
|
|
16
5
|
title: "Legends/ColorLegend",
|
|
17
6
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
const Template = (args) => {
|
|
8
|
+
const [getColor, setColorName] = React.useState("Rainbow");
|
|
9
|
+
const getColorName = React.useCallback((data) => {
|
|
21
10
|
// for geological color scale data (from color-table.json) => data.name
|
|
22
11
|
// for D3 color scale => data.legendColorName
|
|
23
12
|
setColorName((data === null || data === void 0 ? void 0 : data.name) || (data === null || data === void 0 ? void 0 : data.legendColorName));
|
|
24
13
|
}, []);
|
|
25
|
-
return React.createElement(ColorLegend,
|
|
14
|
+
return React.createElement(ColorLegend, Object.assign({}, args, { colorName: getColor, getScale: getColorName }));
|
|
26
15
|
};
|
|
27
|
-
|
|
16
|
+
const defaultProps = {
|
|
28
17
|
horizontal: true,
|
|
29
18
|
isOpenProp: true,
|
|
30
19
|
min: 0,
|
|
@@ -38,22 +27,22 @@ var defaultProps = {
|
|
|
38
27
|
numberOfTicks: 3,
|
|
39
28
|
legendScaleSize: 300,
|
|
40
29
|
};
|
|
41
|
-
export
|
|
42
|
-
DefaultStyle.args =
|
|
43
|
-
export
|
|
44
|
-
TopLeftPosition.args =
|
|
45
|
-
export
|
|
46
|
-
TopRightPosition.args =
|
|
47
|
-
export
|
|
48
|
-
VerticalPositioning.args =
|
|
49
|
-
export
|
|
50
|
-
|
|
51
|
-
return React.createElement(ColorLegend,
|
|
30
|
+
export const DefaultStyle = Template.bind({});
|
|
31
|
+
DefaultStyle.args = Object.assign({}, defaultProps);
|
|
32
|
+
export const TopLeftPosition = Template.bind({});
|
|
33
|
+
TopLeftPosition.args = Object.assign(Object.assign({}, defaultProps), { cssLegendStyles: { left: "0vw", top: "0vh" } });
|
|
34
|
+
export const TopRightPosition = Template.bind({});
|
|
35
|
+
TopRightPosition.args = Object.assign(Object.assign({}, defaultProps), { cssLegendStyles: { right: "0vw", top: "0vh" } });
|
|
36
|
+
export const VerticalPositioning = Template.bind({});
|
|
37
|
+
VerticalPositioning.args = Object.assign(Object.assign({}, defaultProps), { cssLegendStyles: { right: "0vw", top: "0vh" }, horizontal: false });
|
|
38
|
+
export const BottomRightPosition = (args) => {
|
|
39
|
+
const style = { right: "0vw", bottom: "0vh" };
|
|
40
|
+
return React.createElement(ColorLegend, Object.assign({}, args, { cssLegendStyles: style }));
|
|
52
41
|
};
|
|
53
|
-
export
|
|
54
|
-
BottomLeftPosition.args =
|
|
55
|
-
export
|
|
56
|
-
BackgroundColor.args =
|
|
42
|
+
export const BottomLeftPosition = Template.bind({});
|
|
43
|
+
BottomLeftPosition.args = Object.assign(Object.assign({}, defaultProps), { cssLegendStyles: { left: "0vw", bottom: "0vh" } });
|
|
44
|
+
export const BackgroundColor = Template.bind({});
|
|
45
|
+
BackgroundColor.args = Object.assign(Object.assign({}, defaultProps), { cssLegendStyles: {
|
|
57
46
|
backgroundColor: "red",
|
|
58
47
|
borderRadius: "5px",
|
|
59
48
|
padding: "5px",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorLegend.stories.js","sourceRoot":"","sources":["../../../src/component/Legend/ColorLegend.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ColorLegend.stories.js","sourceRoot":"","sources":["../../../src/component/Legend/ColorLegend.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAkC,MAAM,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";
|
|
2
|
-
import {
|
|
2
|
+
import { ColorTableArray } from "../colorTableTypes";
|
|
3
3
|
export type ContinuousLegendProps = {
|
|
4
4
|
/**
|
|
5
5
|
* Min value
|
|
@@ -36,7 +36,7 @@ export type ContinuousLegendProps = {
|
|
|
36
36
|
*
|
|
37
37
|
* Reference: https://github.com/emerson-eps/color-tables/blob/main/react-app/src/component/color-tables.json
|
|
38
38
|
*/
|
|
39
|
-
colorTables?:
|
|
39
|
+
colorTables?: ColorTableArray | string;
|
|
40
40
|
/**
|
|
41
41
|
* Optional function property
|
|
42
42
|
*
|