@@ -87,7 +87,7 @@ const Scene2 = {
8787 countryCentroids : { } ,
8888 countryFeatures : { } ,
8989 countryNameToISO : new Map ( ) ,
90- currentYearRange : [ 1975 , 1975 ] ,
90+ currentYearRange : [ 1975 , 2025 ] ,
9191 currentCountryData : { } ,
9292 debounceTimeout : null ,
9393 disasterTypes : [ ] ,
@@ -267,9 +267,11 @@ const Scene2 = {
267267 } ,
268268
269269 selectType ( type ) {
270- if ( ! type || type === this . selectedType ) return ;
270+ if ( ! type ) return ;
271271
272- this . selectedType = type ;
272+ // Toggle off when the already-active type is clicked: no type selected
273+ // leaves the globe empty (no markers, 0 events).
274+ this . selectedType = type === this . selectedType ? null : type ;
273275 this . updateSelectedTypeButtons ( ) ;
274276 this . updateEventCount ( ) ;
275277 this . debounceUpdate ( ) ;
@@ -734,16 +736,13 @@ const Scene2 = {
734736 this . playButton ?. classList . add ( 'playing' ) ;
735737 this . playButton ?. setAttribute ( 'aria-label' , 'Pause timeline animation' ) ;
736738
737- // Set start year to 1975 if not already
738- const currentStart = this . currentYearRange [ 0 ] ;
739- if ( currentStart !== 1975 ) {
740- this . currentYearRange = [ 1975 , 1975 ] ;
741- this . yearStartSlider . value = 1975 ;
742- this . yearEndSlider . value = 1975 ;
743- this . updateYearRangeUI ( ) ;
744- this . updateEventCount ( ) ;
745- this . updateVisualization ( ) ;
746- }
739+ // Always restart the sweep from 1975 so Play replays the full animation.
740+ this . currentYearRange = [ 1975 , 1975 ] ;
741+ this . yearStartSlider . value = 1975 ;
742+ this . yearEndSlider . value = 1975 ;
743+ this . updateYearRangeUI ( ) ;
744+ this . updateEventCount ( ) ;
745+ this . updateVisualization ( ) ;
747746
748747 // Use slower speed for bubble chart, normal speed for globe
749748 const speed = this . bubbleChartVisible ? this . animationSpeed * 2 : this . animationSpeed ;
0 commit comments