holman / spark

▁▂▃▅▂▇ in your shell.
http://zachholman.com/spark/
MIT License
6.01k stars 290 forks source link

Add support for natural and base10 logs as optional transforms #99

Open szaydel opened 6 years ago

szaydel commented 6 years ago

I thought this might be a useful addition at least for some people. I find that I often have numbers that benefit from log transformation, and this changeset solves that for me.

All tests appear to be passing, and in my own testing it seems like things work well. It works with negative values as well, though results are going to be suspect.

Hopefully you'll find this useful. Thanks!

spark: Generates sparklines for a set of data.
  it_shows_help_with_no_argv:                      [PASS]
  it_graphs_argv_data:                             [PASS]
  it_charts_pipe_data:                             [PASS]
  it_charts_spaced_data:                           [PASS]
  it_charts_way_spaced_data:                       [PASS]
  it_handles_decimals:                             [PASS]
  it_charts_100_lt_300:                            [PASS]
  it_charts_50_lt_100:                             [PASS]
  it_charts_4_lt_8:                                [PASS]
  it_charts_no_tier_0:                             [PASS]
  it_equalizes_at_midtier_on_same_data:            [PASS]
=========================================================
Tests:   11 | Passed:  11 | Failed:   0