On Friday, June 30, 2017 at 9:43:51 AM UTC+1, Jakub Hampl wrote: > > One way of approaching this is to show the user progress in an interesting > way. In this example > <http://code.gampleman.eu/elm-visualization/ForceDirectedGraph/>, the > computation that calculates the final layout of a network graph (which is > pretty expensive) is animated so the user can watch the algorithm converge. >
Nice example, I like how you can interrupt it by clicking on one of the other examples, so the UI is not getting frozen. One thing about this example, is that is driven off of a timer tick. So if each iteration of the node layout takes say one microsecond of CPU time, and the timer ticks every millisecond - it will only use 1/1000th of the CPU. Its fine for animation. In my case I don't want to use a timer tick to drive the computation, because I want to use 100% of the CPU (or close to it) to complete a computation as quickly as possible, but still not block user interaction. We had a good first Elm Scotland Meetup btw, hope you can make the next one. -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
