Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support 'symlog' scale #105

Closed
wass88 opened this issue May 22, 2017 · 6 comments
Closed

Support 'symlog' scale #105

wass88 opened this issue May 22, 2017 · 6 comments

Comments

@wass88
Copy link

wass88 commented May 22, 2017

Matplotlib supports 'symlog' scale.
https://matplotlib.org/examples/scales/scales.html

Symlog is defined as the following expression.

(-1 < x < 1) ? x :
(x >= 1) ? log(x) :
  -log(-x)

This scale is useful for extensive domains.

Is it possible to support symlog in d3-scale? Otherwise, is there a workaround to use custom scales?

@mbostock
Copy link
Member

Seems like a reasonable suggestion.

@danielnaab
Copy link

@mbostock If I were to look into this - is there a preferred implementation direction? One could add an option to the log scale, or create a separate symlog module.

If a separate module, I'm curious if there is a good pattern to follow to extend the log scale without duplicating code.

Any suggestions would be greatly appreciated!

@slavikdenis
Copy link

Looks great so far :) Would be really great if it would work with generating axis and rescaling while zoom and pan! Keep up the good work @danielnaab

@mattpitkin
Copy link

It would be great to see the symlog scale (in part so it can be included in Vega vega/vega#1392, Vega-Lite vega/vega-lite#4127, and Altair vega/altair#1077) and it looks like @danielnaab has done nice work on it. Is there likely to be movement on merging #134 soon?

@jkreft-usgs
Copy link

@danielnaab just added documentation as requested by @curran

@mbostock mbostock mentioned this issue Jan 6, 2019
Merged
13 tasks
mbostock added a commit that referenced this issue Jan 6, 2019
mbostock added a commit that referenced this issue Jan 6, 2019
@mbostock
Copy link
Member

I have an implementation in #156 slated for release in d3-scale 2.2.0. I ended up using a slightly different formulation of symlog, though, as recommended in “A bi-symmetric log transformation for wide-range data” by Webber, 2012.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants