Skip to content

Commit c16327c

Browse files
author
shengwei zhang
committed
fix comments
1 parent 913c02a commit c16327c

File tree

3 files changed

+8
-20
lines changed

3 files changed

+8
-20
lines changed

react/src/lib/components/DeckGLMap/layers/BoxSelectionLayer/boxSelectionLayer.stories.tsx

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { FormControlLabel, makeStyles, Switch } from "@material-ui/core";
22
import { ComponentMeta, ComponentStory } from "@storybook/react";
3+
import { PickInfo } from "lib";
34
import React from "react";
45
import DeckGLMap from "../../DeckGLMap";
56

@@ -22,8 +23,7 @@ const useStyles = makeStyles({
2223
},
2324
});
2425

25-
export const boxSelection: ComponentStory<typeof DeckGLMap> = (args) => {
26-
const [editedData, setEditedData] = React.useState(args.editedData);
26+
export const boxSelection: ComponentStory<typeof DeckGLMap> = () => {
2727
const [argsState, setArgsState] =
2828
React.useState<Record<string, unknown>>(enableLassoArgs);
2929
const [state, setState] = React.useState<boolean>(true);
@@ -34,7 +34,7 @@ export const boxSelection: ComponentStory<typeof DeckGLMap> = (args) => {
3434
);
3535
if (boxSelectionLayer[0].visible !== undefined) {
3636
boxSelectionLayer[0].visible = !boxSelectionLayer[0].visible;
37-
}
37+
};
3838
if (boxSelectionLayer[0].visible) {
3939
setArgsState(enableLassoArgs);
4040
} else {
@@ -43,22 +43,10 @@ export const boxSelection: ComponentStory<typeof DeckGLMap> = (args) => {
4343
setState(!state);
4444
}, [state]);
4545

46-
React.useEffect(() => {
47-
setEditedData(args.editedData);
48-
}, [args.editedData]);
49-
5046
return (
5147
<>
5248
<div className={useStyles().main}>
53-
<DeckGLMap
54-
id={"DeckGL-Map"}
55-
{...argsState}
56-
editedData={editedData}
57-
setProps={(updatedProps) => {
58-
setEditedData(updatedProps);
59-
}}
60-
legend={{ visible: false }}
61-
/>
49+
<DeckGLMap id={"DeckGL-Map"} {...argsState} />
6250
</div>
6351
<div style={{ textAlign: "center" }}>
6452
<FormControlLabel
@@ -128,7 +116,7 @@ export const boxSelectionWithCallback: ComponentStory<
128116
const [data, setData] = React.useState<string[]>([]);
129117
const getSelectedWellsDataCallBack = React.useCallback(
130118
// eslint-disable-next-line @typescript-eslint/no-explicit-any
131-
(pickingInfos: any[]) => {
119+
(pickingInfos: PickInfo[]) => {
132120
const selectedWells = pickingInfos
133121
.map((item) => item.object)
134122
.filter((item) => item.type === "Feature")

react/src/lib/components/DeckGLMap/layers/BoxSelectionLayer/boxSelectionLayer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { ExtendedLayerProps } from "../utils/layerTools";
77
import { getSize } from "../wells/wellsLayer";
88
import { Color } from "@deck.gl/core/typed";
99
import { Feature } from "geojson";
10+
import { PickInfo } from "lib";
1011
export interface BoxSelectionLayerProps<D> extends ExtendedLayerProps<D> {
1112
mode: string; // One of modes in MODE_MAP
1213
selectedFeatureIndexes: number[];
@@ -16,8 +17,7 @@ export interface BoxSelectionLayerProps<D> extends ExtendedLayerProps<D> {
1617
lineWidthScale: number;
1718
lineStyle: LineStyleAccessor;
1819
wellHeadStyle: WellHeadStyleAccessor;
19-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
20-
handleSelection: (pickingInfos: any[]) => void;
20+
handleSelection: (pickingInfos: PickInfo[]) => void;
2121
}
2222

2323
type StyleAccessorFunction = (

react/src/lib/components/DeckGLMap/layers/map/mapLayer.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ export const ColorMapRange: ComponentStory<typeof DeckGLMap> = (args) => {
907907
max={41048}
908908
defaultValue={41048}
909909
step={1000}
910-
onChangeCommitted={handleChange}
910+
onChange={handleChange}
911911
/>
912912
</>
913913
);

0 commit comments

Comments
 (0)