energy-visualization-sankey 1.0.21 → 1.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7647,9 +7647,7 @@
7647
7647
  animationServiceRef.updateSliderIndicator();
7648
7648
  });
7649
7649
  // Create timeline sliders
7650
- const rangeSliderElement = document.getElementById('evs-range-slider');
7651
- this.sliderWidth = rangeSliderElement ?
7652
- rangeSliderElement.getBoundingClientRect().width : 1200;
7650
+ this.sliderWidth = this.configService.WIDTH;
7653
7651
  // Top year labels
7654
7652
  const svgTopYear = select('#evs-axis-top')
7655
7653
  .style('margin', '-5px')
@@ -8170,8 +8168,10 @@
8170
8168
  // Compute thumb center in viewport coordinates, then translate to offset-parent space.
8171
8169
  // Using getBoundingClientRect differences means scroll position cancels out automatically.
8172
8170
  const thumbCenterViewport = sliderRect.left + (thumbWidth / 2) + (progress * effectiveWidth);
8173
- // Indicator rendered width = 50px (width) + 5px + 5px (padding-left/right) = 60px (content-box).
8174
- const indicatorWidth = 60;
8171
+ // Use the actual rendered width so centering is correct regardless of whether the host
8172
+ // project applies box-sizing: border-box (e.g. Nuxt/Vue resets) or content-box (plain HTML).
8173
+ // offsetWidth always reflects the true painted width including padding.
8174
+ const indicatorWidth = indicator.offsetWidth;
8175
8175
  return (thumbCenterViewport - parentLeft) - (indicatorWidth / 2);
8176
8176
  }
8177
8177
  applyIndicatorPosition(indicator, position, year) {