File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -957,6 +957,19 @@ function getTodayForecastPoint(forecastData) {
957957 return forecastData . find ( d => d . date === todayStr ) ;
958958}
959959
960+ function getForecastIndex ( forecastData , targetDate ) {
961+ return forecastData . findIndex ( d => d . date === targetDate ) ;
962+ }
963+
964+ function highlightForecastPoint ( chart , index ) {
965+ if ( ! chart || index < 0 ) return ;
966+ chart . setActiveElements ( [ {
967+ datasetIndex : 0 ,
968+ index : index
969+ } ] ) ;
970+ chart . update ( ) ;
971+ }
972+
960973async function loadForecast ( ) {
961974
962975 const response = await fetch ( "/api/forecast" ) ;
@@ -1140,15 +1153,18 @@ async function loadForecast() {
11401153 if ( points . length ) {
11411154 const index = points [ 0 ] . index ;
11421155 showShapDetails ( forecast [ index ] ) ;
1156+ highlightForecastPoint ( forecastChart , index ) ;
1157+
11431158 }
11441159 } ,
11451160 }
11461161 } ) ;
11471162 const todayPoint = getTodayForecastPoint ( data . forecast ) || data . forecast [ 0 ] ;
11481163 if ( todayPoint ) {
1149- showShapDetails ( todayPoint ) ;
1150- document . getElementById ( "shapDetailCard" ) . style . display = "block" ;
1151- } ;
1164+ showShapDetails ( todayPoint ) ;
1165+ const index = getForecastIndex ( data . forecast , todayPoint . date ) ;
1166+ highlightForecastPoint ( forecastChart , index ) ;
1167+ }
11521168}
11531169
11541170async function loadFeatureImportance ( ) {
You can’t perform that action at this time.
0 commit comments