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

divergent colorBar in DT table centred on 0.5 #46

Open
rb643 opened this issue Nov 17, 2022 · 1 comment
Open

divergent colorBar in DT table centred on 0.5 #46

rb643 opened this issue Nov 17, 2022 · 1 comment

Comments

@rb643
Copy link

rb643 commented Nov 17, 2022

Amazing resource! My JS is a little rusty but would it be possible to create a divergent colorbar that is centred on 0.5 and ranges [0,1]?

I am not sure how to adapt the sprintf JS lines in the function to do that?

@federicomarini
Copy link
Owner

Hi Richard @rb643 ,
You can see from the source code itself that my js-fu is also not so optimal.
The solution I took is inspired by the answer I found on StackOverflow: https://stackoverflow.com/questions/33521828/stylecolorbar-center-and-shift-left-right-dependent-on-sign/33524422#33524422
Probably it is possible to "simply" adapt that? Still, goes beyond my knowledge of javascript 😞

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