Skip to content

Commit

Permalink
feat: geoTimeSlider
Browse files Browse the repository at this point in the history
  • Loading branch information
hongfaqiu committed May 22, 2024
1 parent 0a9b0a4 commit 5878021
Show file tree
Hide file tree
Showing 8 changed files with 1,461 additions and 750 deletions.
712 changes: 408 additions & 304 deletions README.md

Large diffs are not rendered by default.

Binary file added img/geoTimeSlider.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 12 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,18 @@ <h2>Simplify geoTimeScale</h2>
<h2>Complete geoTimeScale ( Equal distance )</h2>
<div id="geoTimeScale"></div>

<h1>GeoTimeSlider</h1>
<div id="geoTimeSlider"></div>


<script src="https://cdn.jsdelivr.net/npm/d3@7"></script>
<script src="./dist/index.umd.js"></script>

<script type="module">
import TimeScaleVersions from './timescales.js';

function clearAll() {
["geoTimeFullWidth", "unequal", "geoTimeSmall", "geoTimeScale-simple", "geoTimeScale"].map(id => {
["geoTimeFullWidth", "unequal", "geoTimeSmall", "geoTimeScale-simple", "geoTimeScale", "geoTimeSlider"].map(id => {
const item = document.getElementById(id)
if (item) item.innerHTML = ''
})
Expand Down Expand Up @@ -178,6 +182,13 @@ <h2>Complete geoTimeScale ( Equal distance )</h2>
geoTimeScale1.stage = this.value
geoTimeScale2.stage = this.value
}

// geotimeSlider
const geoTimeSlider = new timeLine.GeoTimeSlider("#geoTimeSlider", intervals, {
onChange: (val) => {
console.log(val);
}
})

})
}
Expand Down
Loading

0 comments on commit 5878021

Please sign in to comment.