Skip to content

Instantly share code, notes, and snippets.

@stanch
Last active September 25, 2016 17:24
Show Gist options
  • Save stanch/4f852aa22cd589e914407419c36a5775 to your computer and use it in GitHub Desktop.
Save stanch/4f852aa22cd589e914407419c36a5775 to your computer and use it in GitHub Desktop.
TreeSet animation using reftree (https://github.com/stanch/reftree)
import reftree.{Diagram, Utils}
import scala.collection.immutable.TreeSet
val adding = Utils.iterate(TreeSet(1), 15)(s ⇒ s + (s.size + 1))
val removing = Utils.iterate(adding.last, 15)(s ⇒ s - s.size)
Diagram().renderAnimation("treeset", tweakOptions = _.copy(
delay = 200, onionSkin = 0, diffAccent = true,
verticalSpacing = 1.1, highlightColor = "coral1", density = 75
))(adding ++ removing)
@stanch
Copy link
Author

stanch commented Sep 24, 2016

treeset-15

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