Skip to content
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

Examples. #8

Closed
9 of 11 tasks
mbostock opened this issue May 7, 2016 · 8 comments
Closed
9 of 11 tasks

Examples. #8

mbostock opened this issue May 7, 2016 · 8 comments

Comments

@mbostock mbostock changed the title Examples Examples. May 9, 2016
@syntagmatic
Copy link

syntagmatic commented May 9, 2016

  • dragging rects in a partition graph to reorder subtrees (using d3.hierarchy's node.sort)

This example's almost ready to go, just waiting for d3-drag to be included in (alpha 36?). Currently clicking will flip every subtree. http://stamen.github.io/metag/partition/thiocyanate-reorderable.html

@mbostock
Copy link
Member Author

@syntagmatic I’ll release a new alpha build soon, but I’ve just released d3-drag 0.1 so you could also use the modules individually if you want to test. Something like this:

<script src="https://d3js.org/d3.v4.0.0-alpha.35.js"></script>
<script>

d3_dispatch =
d3_selection = d3;

</script>
<script src="https://d3js.org/d3-drag.v0.1.js"></script>

@syntagmatic
Copy link

Doesn't quite work-- looks like drag needs the new d3_selection.customEvent. I'll try including all the modules separately when I get the chance... unless you publish the new alpha first!

@mbostock
Copy link
Member Author

mbostock commented May 11, 2016 via email

@mbostock
Copy link
Member Author

mbostock commented May 11, 2016

I’ve just published alpha 36 alpha 37 (had an oopsie).

@mbostock
Copy link
Member Author

Close enough!

@syntagmatic
Copy link

Thanks, got an initial drag of subtrees working:

http://stamen.github.io/metag/partition/thiocyanate-draggable.html

partition-draggable

Right now you need to cross the midpoint of the next node to reorder... it feels a bit too stubborn. Once I get the interaction feeling better I'll post a reference bl.ock.

@mbostock
Copy link
Member Author

Nice work! I might try smooth interpolation when reordering, too. It tends to work better with interaction than transitions because interaction can rapidly trigger reorderings which would interrupt fixed-duration transitions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants