@@ -146,12 +146,12 @@ const addOption = (label, onEnabled, defaultSelection = false) => {
146146 onEnabled ( )
147147 }
148148
149- checkBox . onSwitch ( ( _ , state ) => {
150- if ( state ) {
149+ checkBox . addEventListener ( 'switch' , ( event ) => {
150+ if ( event . state ) {
151151 onEnabled ( )
152- checkBox . setMouseInteractions ( false )
152+ checkBox . setPointerEvents ( false )
153153 // Set all other check boxes off.
154- options . forEach ( ( option ) => option . checkBox !== checkBox && option . checkBox . setOn ( false ) . setMouseInteractions ( true ) )
154+ options . forEach ( ( option ) => option . checkBox !== checkBox && option . checkBox . setOn ( false ) . setPointerEvents ( true ) )
155155 }
156156 } )
157157
@@ -189,7 +189,7 @@ const handleWireframeToggled = (state) => {
189189 wireframeCheckbox . setText ( state ? 'Hide wireframe' : 'Show wireframe' )
190190}
191191const wireframeCheckbox = group . addElement ( UIElementBuilders . CheckBox )
192- wireframeCheckbox . onSwitch ( ( _ , state ) => handleWireframeToggled ( state ) )
192+ wireframeCheckbox . addEventListener ( 'switch' , ( event ) => handleWireframeToggled ( event . state ) )
193193wireframeCheckbox . setOn ( true )
194194
195195// Add UI control for toggling camera animation.
@@ -200,9 +200,9 @@ const handleCameraAnimationToggled = (state) => {
200200 }
201201}
202202const cameraAnimationEnabledCheckbox = group . addElement ( UIElementBuilders . CheckBox )
203- cameraAnimationEnabledCheckbox . onSwitch ( ( _ , state ) => handleCameraAnimationToggled ( state ) )
203+ cameraAnimationEnabledCheckbox . addEventListener ( 'switch' , ( event ) => handleCameraAnimationToggled ( event . state ) )
204204handleCameraAnimationToggled ( true )
205- chart3D . onBackgroundMouseDrag ( ( ) => {
205+ chart3D . background . addEventListener ( 'pointerdown' , ( ) => {
206206 handleCameraAnimationToggled ( false )
207207} )
208208
0 commit comments