Skip to content

If y is ordinal, chose a smarter default height based on the domain’s cardinality? #323

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

Closed
mbostock opened this issue Apr 13, 2021 · 1 comment · Fixed by #337
Closed
Labels
enhancement New feature or request

Comments

@mbostock
Copy link
Member

Currently the height of a chart with a y-scale defaults to 396. It’d be nice if y were ordinal that we chose a height that’s appropriate based on the cardinality of the domain. E.g., perhaps ensuring a nice round bandwidth of exactly 19px pixels (with the default padding of 0.1). We’d probably want a minimum and maximum default height if we do this.

@mbostock mbostock added the enhancement New feature or request label Apr 13, 2021
@mbostock mbostock changed the title If y (or fy?) is ordinal, chose a smarter default height based on the domain’s cardinality? If y is ordinal, chose a smarter default height based on the domain’s cardinality? Apr 13, 2021
@mbostock
Copy link
Member Author

(Possibly it needs to be multiplied by the cardinality of the fy domain when faceting?)

Fil added a commit that referenced this issue Apr 22, 2021
@Fil Fil mentioned this issue Apr 22, 2021
Fil added a commit that referenced this issue May 2, 2021
Fil added a commit that referenced this issue May 2, 2021
Fil added a commit that referenced this issue May 2, 2021
mbostock added a commit that referenced this issue May 3, 2021
* automatic height

closes #323

* fix tests

* if y is not ordinal, give it some more space as if it were or cardinality 6

* - use the computed domain
- y is always either ordinal or quantitative
- fy is always ordinal

* tidy

* tweak autoHeight

* fix non-ordinal autoHeight

* automatic height

closes #323

* rebase

* rebase more

* plot outputs

* (auto-height:) with vertical facets, the base height for a cell is half that of a usual plot

* tweak autoHeight

Co-authored-by: Mike Bostock <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant