gphat/chart-clicker — pull request #14 by rbt (2013-01-02 05:43:18+00:00)
Title: Feature/divvy

The user sets tick_division_type to one of the below module names (or their own module). This is loaded on the first call to divvy() and _real_divvy() is executed.

Divvy() was moved to Axis.pm from Data::Range.pm because it is a presentation side effect rather than something to do with the data itself. Producing a logarithmic display for the graph does not change the data which could be used in more than one location.

Exact is the old mechanism of dividing the space into equal tick segments.

![exact](https://f.cloud.github.com/assets/372764/37748/48b989a2-549e-11e2-997b-e45f9d7f8e64.png)

LinearRounded produces values which are (close to?) visually pleasing (nice whole figures) while keeping the number of ticks somewhere around what the user requested (default of 5).

![linearrounded](https://f.cloud.github.com/assets/372764/37747/48afb8aa-549e-11e2-977c-0d12e6f8440d.png)

LinearExpandGraph is an experimental mechanism taken from branch divvy_strategy. In my opinion LinearRounded produces better results but having multiple examples shows that the module loading functions correctly.

![linearexpandgraph](https://f.cloud.github.com/assets/372764/37749/48e0eb78-549e-11e2-8573-6889a2c845fe.png)

Most importantly, users may create and use their own Divvy mechanism. Time based divvy logic will be somewhat different than the simple number set I have done; so I expect the number of Divvy modules to increase.

Implementing a Logarithmic divvy() from here is straight forward. The rest of the adjustments for logarithmic output isn't so obvious.