ContinuumIO/bokeh — pull request #291 by jqmp (2014-01-25 19:30:38+00:00)
Title: Better ticking for datetime data (and regular data)

As discussed in email.

Improvements
---------------------
- For datetime axes, the ticks are now "nice" time values; i.e., round multiples of minutes, hours, days, etc.

- For both datetime and regular axes, ticks no longer flicker as you zoom in and out.

Remaining issues
--------------------------
- The tests in test/common/ticking_test.coffee are broken, as the functions they test no longer exist. I can delete this file, or, if it's important to you, add new tests. You'll have to remind me how to run the tests though; Paddy told me, but I forgot.

- The plumbing code that figures out which type of ticking to use -- basically everything outside of ticking.coffee -- is just the simplest hack I could think of. I don't have a good grip on the rest of the architecture, so some advice here would be welcome.

- I feel like there's probably a better architecture than the Scale object I used (it's not exactly the same as in Chaco), but this one works.

- There is still the issue of converting Python times (in seconds) to JS times (in millis); right now I'm assuming the conversion happens in the user's Python code, which I think is what the previous code did, but which does not seem to match what the existing Python examples expect. I'm happy to discuss this further.

- Some cases could be improved (e.g., special handling for years; maybe the exact tick choices could be better; etc.), but those changes should be straightforward.