2 ms·
"But with Canvas I have to manually redraw the Graph any time the state changes. In addition, to keep things snappy, I have to calculate which commits and conne
by mikepurvis 17y ago
"But with Canvas I have to manually redraw the Graph any time the state changes. In addition, to keep things snappy, I have to calculate which commits and connections are currently viewable and ONLY draw those. This results in a substantial amount of code that is completely unnecessary in Flash."
Seems to me you could still do this in Canvas—just make a big wide one, and throw it in an overflow:scroll div.
You wouldn't even have to draw it all upfront. Just flag the elements you've drawn so far, and lazily draw the rest as they come into view (there's a scroll event you could capture to make this happen even more seamlessly).
- tlrobinson 17y agoUnfortunately very large canvases suffer from poor performance in certain browsers. At least as of ~1 year ago.
- mikepurvis 17y agoHmm. Nonetheless, I feel like you could do this somehow. I'm not a github user, so I don't know just how wide these things get, but perhaps you could do series of canvases placed side-by-side, at least on the browsers which require the workaround?
- oozcitak 17y agoThey can get quite wide and deep. See spree's network graph for example: http://github.com/railsdog/spree/network http://github.com/railsdog/spree/network
- stevelosh 17y agoHomebrew's is crazy too (619 forks): http://github.com/mxcl/homebrew/network http://github.com/mxcl/homebrew/network