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

Expose d3.scaleSequential? #56

Closed
mbostock opened this issue Apr 6, 2016 · 0 comments
Closed

Expose d3.scaleSequential? #56

mbostock opened this issue Apr 6, 2016 · 0 comments

Comments

@mbostock
Copy link
Member

mbostock commented Apr 6, 2016

It would be nice for implementing custom scales, e.g., the (highly not recommended!) angry rainbow:

var rainbow = d3.scaleSequential(function(t) {
  return d3.hsl(t * 360, 1, 0.5) + "";
});

Instead, you currently must do something like this if you want a scale:

var rainbow = d3.scaleLinear().interpolate(function() {
  return function(t) {
    return d3.hsl(t * 360, 1, 0.5) + "";
  };
});

But note that this doesn’t really work with a domain of more than two values, and ignores the range. So restricting this to a sequential scale seems more appropriate.

@mbostock mbostock self-assigned this Apr 6, 2016
@mbostock mbostock removed their assignment May 15, 2016
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

1 participant