quil / quil-site

Source code of quil.info
http://quil.info
Eclipse Public License 1.0
7 stars 13 forks source link

Optimize floating graph. #17

Closed nbeloglazov closed 8 years ago

nbeloglazov commented 8 years ago

@johnnyhoffman, can you take a look? I refactored code but didn't change any logic (I believe). One adidtional optimization I think is to extract edges once, in setup instead of doing it each time in draw because edges don't change over time so I think we could do it once.

johnnyhoffman commented 8 years ago

I looked through your changes and they all seem very appropriate. Particularly, the uses of destructuring and for solve a lot of tasks that I struggled to write clean code for - so thank you, I learned from it.

I agree that edges could be extracted just once at the beginning. Instead of potentially making a mess by making a pull request of this pull request, I'm annotating the commit with my simple proposed changes that I have tested.

nbeloglazov commented 8 years ago

Thanks! Added edges to state in :setup.

nbeloglazov commented 8 years ago

Aand, it's live: http://quil.info/?example=floating%20graph http://quil.info/sketches/show/example_floating-graph

nbeloglazov commented 8 years ago

Thanks for the beautiful sketch, Johny!

johnnyhoffman commented 8 years ago

You're welcome, and thanks for helping me get it live!