File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -563,18 +563,24 @@ <h3 style="text-align:center;">Jitter</h3>
563563 }
564564 } ) ;
565565
566+ const xMax = Math . max (
567+ ...freqSets . flatMap ( ds => ds . data . map ( pt => pt . x ) )
568+ ) ;
569+ const yMax = Math . max (
570+ ...freqSets . flatMap ( ds => ds . data . map ( pt => pt . y ) ) . filter ( v => v !== null )
571+ ) ;
566572 gameChart . options . plugins . zoom = {
567573 ...fullscreenZoom ( gameChart ) ,
568574 limits : {
569575 x : {
570576 min : 0 ,
571- max : 600 ,
577+ max : 1.5 * xMax ,
572578 minRange : 1 ,
573- maxRange : 60
579+ maxRange : 1.5 * xMax
574580 } ,
575581 y : {
576582 min : 0 ,
577- max : 10
583+ max : 1.5 * yMax ,
578584 }
579585 }
580586 } ;
@@ -741,20 +747,28 @@ <h3 style="text-align:center;">Jitter</h3>
741747
742748 // Attach our custom pan/zoom config that allows negative Y:
743749 { #angleChart. options . plugins . zoom = fullscreenZoomAngle ( angleChart ) ; #}
750+
751+ const xMax = Math . max (
752+ ...angleChart . data . datasets . flatMap ( ds => ds . data . map ( pt => pt . x ) )
753+ ) ;
754+ const yMax = Math . max (
755+ ...angleChart . data . datasets . flatMap ( ds => ds . data . map ( pt => pt . y ) )
756+ ) ;
757+
744758 angleChart . options . plugins . zoom = {
745759 ...fullscreenZoomAngle ( angleChart ) ,
746760 limits : {
747761 x : {
748762 min : 0 ,
749- max : 600 , // 0–60 seconds
763+ max : xMax * 2 , // double the max X for zooming out
750764 minRange : 1 ,
751- maxRange : 60
765+ maxRange : xMax * 2
752766 } ,
753767 y : {
754768 min : - 2 ,
755769 max : 2 ,
756770 minRange : 0.1 ,
757- maxRange : 50
771+ maxRange : 2 * yMax // double the max Y for zooming out
758772 }
759773 }
760774} ;
You can’t perform that action at this time.
0 commit comments