File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
apps/class-solid/src/components Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -140,9 +140,15 @@ export function TimeSeriesPlot({ analysis }: { analysis: TimeseriesAnalysis }) {
140140 e . output ? e . output [ analysis . yVariable as OutputVariableKey ] : [ ] ,
141141 ) ;
142142
143- const granularity = ( ) => ( analysis . xVariable === "t" ? 600 : undefined ) ;
144- const xLim = ( ) => getNiceAxisLimits ( allX ( ) , 0 , granularity ( ) ) ;
145- const yLim = ( ) => getNiceAxisLimits ( allY ( ) ) ;
143+ const granularities : Record < string , number | undefined > = {
144+ t : 600 , // 10 minutes in seconds
145+ utcTime : 60_000 , // 1 minute in milliseconds
146+ default : undefined ,
147+ } ;
148+
149+ const roundTo = ( v : string ) => granularities [ v ] ?? granularities . default ;
150+ const xLim = ( ) => getNiceAxisLimits ( allX ( ) , 0 , roundTo ( analysis . xVariable ) ) ;
151+ const yLim = ( ) => getNiceAxisLimits ( allY ( ) , 0 , roundTo ( analysis . yVariable ) ) ;
146152
147153 const chartData = ( ) =>
148154 flatExperiments ( ) . map ( ( e ) => {
You can’t perform that action at this time.
0 commit comments