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

Alternative scale zero property (in addition to true or false) #1471

Open
kanitw opened this issue Dec 7, 2018 · 5 comments
Open

Alternative scale zero property (in addition to true or false) #1471

kanitw opened this issue Dec 7, 2018 · 5 comments
Labels
enhancement For enhancement of existing features

Comments

@kanitw
Copy link
Member

kanitw commented Dec 7, 2018

From https://twitter.com/Datawrapper/status/1070702878061416448,

image

I could see we extend the scale's zero property with an object describing automatic criteria such as maximum % that could be added.

@jheer -- I wonder where is the logic for reading scale's zero and adding it to the domain in the codebase? (I searched for "zero" in vega-scale and vega-parser but couldn't find one.)

@kanitw kanitw added the enhancement For enhancement of existing features label Dec 7, 2018
@domoritz
Copy link
Member

domoritz commented Dec 7, 2018

Couldn't you just write an expression that determines the domain based on how far away it is from zero?

@jheer
Copy link
Member

jheer commented Dec 7, 2018

Yes you could! Here is an editor example, with a 0.24 threshold chosen so that one axis adjusts to zero and the other doesn't.

Vega-Lite could generate code like this if desired. That said, in Vega people probably do not want to add new extent transforms and signal definitions. One option would be to update the zero directive to also accept a number indicating a percentage threshold. This would require updating the Scale transform in vega-encode and also the schema definition.

@kanitw
Copy link
Member Author

kanitw commented Dec 15, 2018

Would the monorepo in #1472 land any time soon?

If I have time over the holiday break, I might try to fix this. :)

@jheer
Copy link
Member

jheer commented Dec 15, 2018

Yes, I plan to merge the monorepo to master sometime in the next week. Everything is working, just want to double check everything and update the documentation / README.md files.

@kanitw
Copy link
Member Author

kanitw commented Aug 9, 2022

Ah I was playing with this and found this issue. (FWIW, this is a similar Vega-Lite spec for playing with the threshold)

cc: @yhoonkim

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

No branches or pull requests

3 participants