ArasLabs / workflow-timeline

This project demonstrates how to implement a timeline view of an item's workflow process.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix auto-scaling issue

EliJDonahue opened this issue · comments

If you don't specify a scale for the timeline, vis.js will determine the best scale and use that to render the diagram. If some tasks have a duration of seconds or milliseconds, vis.js tries to pick a scale that will accurately reflect their duration. This is a problem because there is a 1000-line maximum on the number of lines/units that vis.js will display.

If you have tasks that last seconds (ex: created an item for testing and immediately voted) and tasks that last days (ex: waited to vote, or pending tasks with an estimated duration), the diagram just won't display and the console will log an error about the maximum number of lines.

One possible solution is to round timestamps to the nearest minute or hour before defining the objects in memory used by the vis.js timeline. This won't be super accurate, but it won't harm the underlying data in the database and it may allow the diagram to load.

It may also be possible to specify min/max scales for the timeline. I think that would be a preferable solution if vis.js supports it.