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

Conditional Formatting in Heatmap #496

Closed
tchakravarty opened this issue May 30, 2016 · 4 comments
Closed

Conditional Formatting in Heatmap #496

tchakravarty opened this issue May 30, 2016 · 4 comments

Comments

@tchakravarty
Copy link

Nicolas, thanks so much for the wonderful library. I wanted to ask if there is a simple way to use conditional formatting rather than a continuous palette for the heatmap renderer? For example:

  • green if value between [a, b)
  • yellow if value between [b, c)
  • red if value between [c, d]

Thanks.

@nicolaskruchten
Copy link
Owner

There's no built-in way of doing that but by copying and modifying the heatmap code it should be pretty trivial :)

@tchakravarty
Copy link
Author

Thanks for the reply @nicolaskruchten. I did try to take a look at your code to see if I could adapt it, but I gave up when I realized it was CoffeeScript. :-) Instead, I wrote up some pretty hacky looking DOM manipulations on top of the Table renderer, which seems to be holding for now. Can I request that there be a conditional formatting renderer in the next release? Great library, much appreciated.

@nicolaskruchten
Copy link
Owner

OK. CoffeeScript is fully compatible with Javascript, and if you're more comfortable with Javascript you could modify the compiled CoffeeScript output... As to your request, it's noted, but the best kind of request is a Pull Request ;)

@nicolaskruchten
Copy link
Owner

You can now specify a custom color scale function, see the example here: http://nicolas.kruchten.com/pivottable/examples/montreal_2014.html

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

No branches or pull requests

2 participants