11import { FormControlLabel , makeStyles , Switch } from "@material-ui/core" ;
22import { ComponentMeta , ComponentStory } from "@storybook/react" ;
3+ import { PickInfo } from "lib" ;
34import React from "react" ;
45import 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" )
0 commit comments