Skip to content

Commit

Permalink
revert back wellsLayer story change to match with the master
Browse files Browse the repository at this point in the history
  • Loading branch information
shengwei zhang committed Jan 18, 2023
1 parent f9e8f91 commit 36f5fdf
Showing 1 changed file with 20 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
} from "@emerson-eps/color-tables";
import { MapMouseEvent } from "../../components/Map";
import { makeStyles } from "@material-ui/core";
import { View } from "@deck.gl/core/typed";

export default {
component: DeckGLMap,
Expand Down Expand Up @@ -537,10 +536,10 @@ const reverseRange = false;

//eslint-disable-next-line
const wellLayerTemplate = (args: any) => {
const [getColorName, setColorName] = React.useState("Stratigraphy");
const [getColorName, setColorName] = React.useState("Rainbow");
const [isLog, setIsLog] = React.useState(false);
const wellLayerData = React.useCallback((data) => {
setColorName(data.name ? data.name : data.legendColorName);
setColorName(data);
}, []);

// interpolation method
Expand All @@ -557,37 +556,23 @@ const wellLayerTemplate = (args: any) => {
},
];
return (
// <div>
// <div
// style={{
// float: "right",
// zIndex: 999,
// opacity: 1,
// position: "relative",
// }}
// >
// <ColorLegend
// {...args}
// getScale={wellLayerData}
// getInterpolateMethod={getInterpolateMethod}
// />
// </div>
// <DeckGLMap {...args} layers={layers} />
// </div>
<DeckGLMap {...args} layers={layers}>
{
// @ts-expect-error This is demonstrated to work with js, but with ts it gives error
<View id="view_1">
<div style={{ marginTop: 50 }}>
<ColorLegend
{...args}
getScale={wellLayerData}
getInterpolateMethod={getInterpolateMethod}
/>
</div>
</View>
}
</DeckGLMap>
<div>
<div
style={{
float: "right",
zIndex: 999,
opacity: 1,
position: "relative",
}}
>
<ColorLegend
{...args}
getColorName={wellLayerData}
getInterpolateMethod={getInterpolateMethod}
/>
</div>
<DeckGLMap {...args} layers={layers} />
</div>
);
};

Expand All @@ -609,16 +594,6 @@ LegendWithColorSelector.args = {
visible: false,
},
reverseRange,
views: {
layout: [1, 1],
showLabel: true,
viewports: [
{
id: "view_1",
zoom: -4,
},
],
},
};

LegendWithColorSelector.parameters = {
Expand All @@ -629,4 +604,4 @@ LegendWithColorSelector.parameters = {
inlineStories: false,
iframeHeight: 500,
},
};
};

0 comments on commit 36f5fdf

Please sign in to comment.