If you don't want a library but a complete product, I will do a small advertisement for OrgPad.com here. It is completely free currently and we plan on keeping a basic account free, with no adds etc. forever. OrgPad is used quite a bit in alternative education here in Czechia because it is very simple and opens usable ways to less linear education and thinking. It seems kids even in the 4th or 5th grade like it a lot.
You can actually browse explicitly published OrgPages at https://orgpad.com/list even without an account. There is quite a bit of JavaScript, that is calculating the topologically stable auto-layout and animations. That runs best in Google Chrome, because it just calculates this kind of JavaScript the quickest. We will probably rewrite the animations from React Motion to something that could be better accelerated. Basically, the idea is, JavaScript will calculate certain CSS values for transformations etc. using differential equations - this will make for nice physical animations. This should land sometime in January if all goes well. We also work on our own collaborative editor inside the cell/ unit that should be a lot simpler and enable us to e.g. do also things like table calculation in spreadsheets or maybe even enable simple music scores/ snippets.
Btw. this is all written in ClojureScript/ Clojure. You can watch more about it in Pavel Klavík's talk here: https://www.youtube.com/watch?v=4UoIfeb31UU