Skip to content

faceted time #1018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 46 commits into
base: mbostock/time
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
74c6996
time and facets
Fil Jul 29, 2022
f7ac0a4
Avoid duplicating points (since Ii represents currentTime, it's === t…
Fil Jul 29, 2022
8acc5b1
a bit cleaner
Fil Jul 29, 2022
a68f332
optimization: don't interpolate same values (in particular, colors)
Fil Jul 29, 2022
3d86d4a
transforms *almost* work now
Fil Jul 29, 2022
5a9abae
a test for faceting (even more broken than the others)
Fil Jul 29, 2022
c086ee4
checkpoint
Fil Aug 1, 2022
6005af8
facets closer to working
Fil Aug 1, 2022
38d0c3c
a few broken tests
Fil Aug 1, 2022
3f0e2e4
reassemble after initializers (should work with dodge)
Fil Aug 1, 2022
4f9c586
object consistency, avoid interpolating strings
Fil Aug 1, 2022
6373d24
fix time filters on the box examples
Fil Aug 1, 2022
64ea634
pass the subdimensions to time facets
Fil Aug 1, 2022
1fdb546
key
Fil Aug 2, 2022
25131da
slightly better for exit
Fil Aug 2, 2022
b62f924
test plots
Fil Aug 2, 2022
9a0e97a
object consistency is now obtained by the key accessor (or default key)
Fil Aug 2, 2022
61a60cf
allows several marks to play together even when their time domains ar…
Fil Aug 2, 2022
02cdbfe
animation: "fade" vs animation: "interpolate" fixes the issue with ou…
Fil Aug 3, 2022
126d717
* delay, duration, tweens
Fil Aug 3, 2022
c22af4f
remove the animation=fade setting, seems we can live without it (for …
Fil Aug 4, 2022
78eeef1
implement the https://developer.mozilla.org/en-US/docs/Web/API/HTMLMe…
Fil Aug 4, 2022
96d195a
fix setTime/ended; use window.CustomEvent
Fil Aug 4, 2022
5c23cca
ensure deterministic tests
Fil Aug 4, 2022
4bbc1ac
support playbackRate
Fil Aug 5, 2022
27b7f0e
when pausing, we need to draw
Fil Aug 5, 2022
1b483a9
stop ticking when we're detached from the dom
Fil Aug 5, 2022
b4814f3
nicer ticks for the bar chart race
Fil Aug 5, 2022
fd3a3f6
improve bar chart race
Fil Aug 5, 2022
85d1c02
revert 3d86d4abd since we have time facets now
Fil Aug 5, 2022
941db98
ordinal times
Fil Aug 5, 2022
219087a
expose time scale
Fil Aug 8, 2022
f54cf64
data source
Fil Aug 8, 2022
eb5e0a1
time key
Fil Aug 9, 2022
0b51175
animate bins, and a todo for groups
Fil Aug 9, 2022
4b04ab3
an example plot which doesn't fully work (the bins appear and vanish …
Fil Aug 9, 2022
18ef5bf
bins work by adding fake data to fill up the empty bins
Fil Aug 10, 2022
5ae6d20
ensure paused is boolean
Fil Aug 10, 2022
3aa4c72
immediately apply currentTime changes
Fil Aug 10, 2022
0b2db83
nicer gapminder-bin test
Fil Aug 10, 2022
6e165a4
multiple time snapshots
Fil Aug 10, 2022
db7c46f
more time snapshots
Fil Aug 10, 2022
5e37062
format commit (just to get CI to work)
Fil Aug 10, 2022
4e7bb98
move animation code to time.js
Fil Aug 10, 2022
a1d9ee0
draft documentation for time (to merge in README when all is set)
Fil Aug 10, 2022
1fc07ea
some todos
Fil Aug 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove the animation=fade setting, seems we can live without it (for …
…example, setting key: (d,i)=>i would be a way to say that we only want enters and exits?)
  • Loading branch information
Fil committed Aug 4, 2022
commit c22af4fde4d3bf54588d219bcc51a3a5ca1b7fa6
2 changes: 1 addition & 1 deletion src/marks/box.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function boxX(data, {
ruleY(data, group({x1: loqr1, x2: hiqr2}, {x, y, stroke, strokeOpacity, ...options})),
barX(data, group({x1: "p25", x2: "p75"}, {x, y, fill, fillOpacity, ...options})),
tickX(data, group({x: "p50"}, {x, y, stroke, strokeOpacity, strokeWidth, sort, ...options})),
dot(data, map({x: oqr}, {x, y, z: y, stroke, strokeOpacity, animation: "fade", ...options}))
dot(data, map({x: oqr}, {x, y, z: y, stroke, strokeOpacity, ...options}))
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,9 @@ export function plot(options = {}) {
const I1 = facet.filter(i => T[i] === time1); // following keyframe
const K0 = new Set(I0.map(i => K[i]));
const K1 = new Set(I1.map(i => K[i]));
const Kenter = mark.animation === "fade" ? K1 : difference(K1, K0);
const Kupdate = mark.animation === "fade" ? new Set([]) : intersection(K0, K1);
const Kexit = mark.animation === "fade" ? K0 : difference(K0, K1);
const Kenter = difference(K1, K0);
const Kupdate = intersection(K0, K1);
const Kexit = difference(K0, K1);
const enter = I1.filter(i => Kenter.has(K[i]));
const update = I0.filter(i => Kupdate.has(K[i]));
const target = update.map(i => I1.find(j => K[i] === K[j])); // TODO: use an index
Expand Down