This repository was archived by the owner on Jun 16, 2026. It is now read-only.
Add date slider for filtering protocols by activation date#13
Closed
cmehat wants to merge 1 commit into
Closed
Conversation
Refactor index.html with extracted marker helpers (addMarker, clearAll, showAll). Add play/pause button for animated timeline. Add date range slider (bottom-left) to filter protocols by activation date. Slider disables during playback and re-enables on stop. Testnet-only protocols only shown at max slider position.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 7 comments.
Comments suppressed due to low confidence (1)
docs/index.html:229
filterByDate()assumesactivationDatecan be compared directly to the slider timestamp, but the slider should operate on calendar days. Precomputing a normalized UTC-day timestamp per entry avoids repeated parsing and ensures inclusions are correct for the displayed date.
entries = Object.keys(data).map(function (name) {
var d = data[name];
d.name = name;
return d;
}).filter(function (d) {
| var PROTOCOLS_URL = "https://raw.githubusercontent.com/cotezos/tezosprotocolmap/main/protocols.json"; | ||
| var COLOR_MAINNET = "#1f77b4"; | ||
| var COLOR_TESTNET = "#ff7f0e"; | ||
| var DAY_MS = 86400000; |
Comment on lines
+258
to
+264
| var dates = entries | ||
| .filter(function (d) { return d.activationDate; }) | ||
| .map(function (d) { return new Date(d.activationDate).getTime(); }); | ||
|
|
||
| if (dates.length > 0) { | ||
| var minDate = Math.min.apply(null, dates); | ||
| var maxDate = Date.now(); |
Comment on lines
+201
to
+207
| var d = entries[i]; | ||
| if (d.activationDate) { | ||
| if (new Date(d.activationDate).getTime() <= timestamp) { | ||
| addMarker(i); | ||
| count++; | ||
| } | ||
| } else { |
Comment on lines
+69
to
+74
| if (d.voting) { | ||
| html += "<br>Voted: Epoch " + esc(String(d.voting.epoch)) + | ||
| " \u2014 " + esc(d.voting.result) + | ||
| "<br>Ballots: " + d.voting.yayBallots + " yay, " + | ||
| d.voting.nayBallots + " nay, " + d.voting.passBallots + " pass"; | ||
| } |
| playBtn.href = "#"; | ||
| playBtn.title = "Play/Pause timeline"; | ||
| playBtn.textContent = "\u25B6"; | ||
| playBtn.setAttribute("role", "button"); |
| sliderLabel.style.cssText = "font-size:12px;margin-bottom:6px;color:#333;font-weight:500;"; | ||
| sliderLabel.textContent = "All protocols"; | ||
| sliderInput = L.DomUtil.create("input", "", container); | ||
| sliderInput.type = "range"; |
| @@ -12,20 +12,25 @@ | |||
| body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; } | |||
| #title { height: 36px; display: flex; align-items: center; padding: 0 14px; background: #1a1a2e; color: #fff; font-size: 14px; font-weight: 600; letter-spacing: 0.3px; } | |||
| #title span { opacity: 0.6; margin-left: 8px; font-weight: 400; } | |||
Contributor
Author
|
This project has moved to oyatrino/tezosprotocolmap, where this work has already been merged. Closing as part of deprecating this repository. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Note: This PR includes the full refactored index.html. Merge after timeline playback PR.
Test plan