@@ -103,6 +103,7 @@ <h5><span data-lang-key="status_label">Status:</span> <span id="alignmentStatus"
103103 < div > < small data-lang-key ="y_range_label "> Y-Bereich:</ small >
104104 < select id ="plotYRange ">
105105 < option value ="auto " selected > Auto</ option >
106+ < option value ="stretch " data-lang-key ="y_range_stretch "> Stretch (Min-Max)</ option >
106107 < option value ="full " data-lang-key ="y_range_full "> Voll (0-Max)</ option >
107108 </ select >
108109 </ div >
@@ -342,11 +343,21 @@ <h4 id="tutorialStepTitle"></h4>
342343 const vis = intensityData . filter ( d => d . time >= mt ) ;
343344
344345 let yMin , yMax ;
345- if ( ById ( 'plotYRange' ) . value === 'auto' && vis . length > 1 ) {
346- const vs = vis . map ( d => d . value ) ; const mg = Math . max ( 50 , ( Math . max ( ...vs ) - Math . min ( ...vs ) ) * .1 ) ;
347- yMin = Math . max ( 0 , Math . min ( ...vs ) - mg ) ; yMax = Math . max ( ...vs ) + mg ;
348- if ( yMax - yMin < 100 ) { const m = ( yMax + yMin ) / 2 ; yMin = m - 50 ; yMax = m + 50 ; }
349- } else { yMin = 0 ; yMax = window . _maxRange || 65535 ; }
346+ const yRangeMode = ById ( 'plotYRange' ) . value ;
347+ if ( yRangeMode === 'auto' && vis . length > 1 ) {
348+ const vs = vis . map ( d => d . value ) ;
349+ const mg = Math . max ( 50 , ( Math . max ( ...vs ) - Math . min ( ...vs ) ) * .1 ) ;
350+ yMin = Math . max ( 0 , Math . min ( ...vs ) - mg ) ;
351+ yMax = Math . max ( ...vs ) + mg ;
352+ if ( yMax - yMin < 100 ) { const m = ( yMax + yMin ) / 2 ; yMin = m - 50 ; yMax = m + 50 ; }
353+ } else if ( yRangeMode === 'stretch' && vis . length > 0 ) {
354+ const vs = vis . map ( d => d . value ) ;
355+ yMin = Math . min ( ...vs ) ;
356+ yMax = Math . max ( ...vs ) ;
357+ if ( yMax === yMin ) { yMin = yMin - 1 ; yMax = yMax + 1 ; }
358+ } else {
359+ yMin = 0 ; yMax = window . _maxRange || 65535 ;
360+ }
350361
351362 // Grid
352363 ctx . strokeStyle = '#eee' ; ctx . lineWidth = 1 ;
@@ -448,6 +459,7 @@ <h4 id="tutorialStepTitle"></h4>
448459 alignment_hint :"Justieren Sie den optischen Pfad für maximale Intensität" ,
449460 intensity_graph :"📈 Intensitäts-Verlauf" , clear_plot :"Leeren" ,
450461 time_window :"Zeitfenster:" , y_range_label :"Y-Bereich:" , y_range_full :"Voll (0-Max)" ,
462+ y_range_stretch :"Stretch (Min-Max)" ,
451463 measurement_range :"Messbereich" , range_hint :"Werte hängen von Gain und Integrationszeit ab" ,
452464 sensor_settings :"Sensor-Einstellungen" , gain_label :"Verstärkung (Gain)" ,
453465 gain_tooltip :"Höhere Verstärkung = empfindlicher, aber schneller Sättigung bei starkem Licht. Starten Sie mit High (428x)." ,
@@ -474,6 +486,7 @@ <h4 id="tutorialStepTitle"></h4>
474486 alignment_hint :"Adjust the optical path for maximum intensity" ,
475487 intensity_graph :"📈 Intensity Over Time" , clear_plot :"Clear" ,
476488 time_window :"Time Window:" , y_range_label :"Y-Range:" , y_range_full :"Full (0-Max)" ,
489+ y_range_stretch :"Stretch (Min-Max)" ,
477490 measurement_range :"Measurement Range" , range_hint :"Values depend on Gain and Integration Time" ,
478491 sensor_settings :"Sensor Settings" , gain_label :"Gain" ,
479492 gain_tooltip :"Higher gain = more sensitive, but saturates faster with strong light. Start with High (428x)." ,
0 commit comments