Skip to content

Commit

Permalink
fix: fixing the scrollbar of the individual orbital parameters histor…
Browse files Browse the repository at this point in the history
…y (#460)
  • Loading branch information
Thibault authored and GitHub committed Jun 25, 2025
1 parent 5fbe936 commit 4ae5217
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default function HistoricalSolarCycleData() {
): any {
const extremes = this.axis.getExtremes();
const zoomLevel = extremes.max - extremes.min; // Get the current zoom range
if (zoomLevel <= 18 * 30 * 24 * 3600 * 1000) {
if (zoomLevel <= 8 * 12 * 30 * 24 * 3600 * 1000) {
// If zoomed in to less than or equal to 1 month
return Highcharts.dateFormat(
"%b %Y",
Expand Down
15 changes: 10 additions & 5 deletions frontend/src/app/satellites/[satelliteSlug]/orbitDataGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,20 @@ const OrbitDataGraph: React.FC<OrbitDataProps> = ({
if (periodType === "m") {
scrollBarTimeFrame.current = number;
SBThumbWidth =
Math.round((svgSize.width * 0.8 * number * 10) / months) /
10;
months >= number
? Math.round(
(svgSize.width * 0.8 * number * 10) / months,
) / 10
: svgSize.width * 0.8 - 40.5;
setSBThumbWidth(SBThumbWidth);
} else if (periodType === "y") {
scrollBarTimeFrame.current = number * 12;
SBThumbWidth =
Math.round(
(svgSize.width * 0.8 * number * 12 * 10) / months,
) / 10;
months >= 12 * number
? Math.round(
(svgSize.width * 0.8 * number * 12 * 10) / months,
) / 10
: svgSize.width * 0.8 - 40.5;
setSBThumbWidth(SBThumbWidth);
}
}
Expand Down

0 comments on commit 4ae5217

Please sign in to comment.