@@ -822,6 +822,54 @@ function setActiveTier(tier, options = {}) {
822822 if ( entry ) await replayQuerySession ( entry ) ;
823823 } ;
824824
825+ // Heatmap panel rendering and temporal animation bridges
826+ window . renderCurseurTemps = function ( ) {
827+ const container = document . getElementById ( "curseur-temps-container" ) ;
828+ if ( ! container ) return ;
829+ const render = window . ui ?. composants ?. curseur_temps ?. rendre_curseur_temps ;
830+ if ( typeof render !== "function" ) return ;
831+ const plage = window . ui ?. etat ?. obtenir_plage_heatmap ?. ( ) ?? { debut : 1400 , fin : 2000 } ;
832+ const courante = window . ui ?. etat ?. obtenir_annee_heatmap ?. ( ) ?? plage . debut ;
833+ container . innerHTML = render ( plage . debut , plage . fin , courante ) ;
834+ } ;
835+
836+ window . filtrerHeatmapParAnnee = function ( annee ) {
837+ const vue = window . _heatmapVue ;
838+ if ( vue && typeof vue . filtrer_par_annee === "function" ) vue . filtrer_par_annee ( annee ) ;
839+ } ;
840+
841+ let _heatmapAnimId = null ;
842+ window . jouerAnimationHeatmap = function ( debut , fin , vitesse ) {
843+ if ( _heatmapAnimId ) clearInterval ( _heatmapAnimId ) ;
844+ const step = vitesse || 60 ;
845+ let annee = debut ?? ( window . ui ?. etat ?. obtenir_plage_heatmap ?. ( ) ?. debut ?? 1400 ) ;
846+ const end = fin ?? ( window . ui ?. etat ?. obtenir_plage_heatmap ?. ( ) ?. fin ?? 2000 ) ;
847+ _heatmapAnimId = setInterval ( ( ) => {
848+ annee += 1 ;
849+ if ( annee > end ) { clearInterval ( _heatmapAnimId ) ; _heatmapAnimId = null ; return ; }
850+ window . ui ?. etat ?. definir_annee_heatmap ?. ( annee ) ;
851+ window . filtrerHeatmapParAnnee ( annee ) ;
852+ window . renderCurseurTemps ?. ( ) ;
853+ } , step ) ;
854+ } ;
855+
856+ window . arreterAnimationHeatmap = function ( ) {
857+ if ( _heatmapAnimId ) { clearInterval ( _heatmapAnimId ) ; _heatmapAnimId = null ; }
858+ } ;
859+
860+ window . afficherHeatmapPanel = async function ( mouvementId ) {
861+ const container = document . getElementById ( "heatmap-panel-container" ) ;
862+ if ( ! container ) return ;
863+ container . hidden = false ;
864+ const canvas = document . getElementById ( "heatmap-canvas" ) ;
865+ if ( ! canvas ) return ;
866+ const creer = window . ui ?. visualisations ?. heatmap_vue ?. creer_vue_heatmap ;
867+ if ( typeof creer === "function" ) {
868+ window . _heatmapVue = await creer ( canvas , mouvementId ) ;
869+ }
870+ window . renderCurseurTemps ?. ( ) ;
871+ } ;
872+
825873 function applyTierFromUrl ( ) {
826874 const params = new URLSearchParams ( window . location . search ) ;
827875 const tier = params . get ( "tier" ) ;
0 commit comments