Repository navigation
Add start_index option to HeatMapWithTime. - #2348
Open
KhadeerBasha1232 wants to merge 1 commit into
Open
KhadeerBasha1232 wants to merge 1 commit into
KhadeerBasha1232 wants to merge 1 commit into
Conversation
Let users choose which time step the slider shows when the map opens, instead of always starting at the first one. Negative values count from the end, and out-of-range values raise a ValueError. Closes python-visualization#1243 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KhadeerBasha1232
temporarily deployed
to
pypi
November 16, 2026 12:17 — with
GitHub Actions
Inactive
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
start_indextoHeatMapWithTimeCloses #1243
HeatMapWithTimealways opened on the first time step, because the template hardcodedcurrentTime: new Date(1). This adds astart_indexparameter that picks the step the slider shows when the map loads:Details
start_indexis a 0-based position indata, matching how Python lists are indexed. Negative values count from the end, so-1opens on the last step.ValueErrorthat names the allowed range.0, so existing maps render exactly as before.datais not validated, so behaviour there is unchanged.Tests
currentTimefor0,5and-1, and that10and-11raise for 10 time steps.start_indextoo.start_index=5, the slider opens on the 6th label and the heatmap shows that step's data.CI note
The
pre-commit.cifailure isn't from this change. Black wants two blank lines between two tests intests/test_features.py, which also fails onmainsince #2307 and #2346 were merged. #2350 fixes it, and I'll rebase this PR once that's merged. All the test runs (Ubuntu, macOS, Windows × Python 3.11/3.14) pass.