Uh oh!
There was an error while loading. Please reload this page.
automatic height - #337
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- y is always either ordinal or quantitative - fy is always ordinal
Uh oh!
There was an error while loading. Please reload this page.
I've revised all the test/plots/ :
(I think that athletes-sport-weight is also a bit too tall—540 would be nicer than 640—, but that's already a manual setting.) |
795fd23 to
86fece1Compare# Conflicts: # src/plot.js # test/output/caltrain.svg
Fil
commented
May 2, 2021
the large height comes from my solution is to consider that as soon as a chart has vertical facets, the auto height of a facet should be halved: - const nfy = fy ? fy.scale.domain().length : 1;- return !!(y || fy) * Math.max(1, Math.min(60, ny * nfy)) * 20 + !!fx * 30 + 60;+ const nfy = fy ? fy.scale.domain().length : 2;+ return !!(y || fy) * Math.max(1, Math.min(60, ny * nfy)) * 10 + !!fx * 30 + 60;In the test plots this change impacts only: ballotStatusRace, mobyDickFaceted, penguinMassSex and penguinMassSexSpecies. |
…lf that of a usual plot
mbostock
commented
May 3, 2021
I’ve committed a further tweak. I prefer that adding faceting does not affect the natural height of bands, but that if the subplots don’t have an ordinal y scale, that we partition the target height of 400px for each facet, but down to a minimum of ~140px for each facet. |
Fil
commented
May 3, 2021
(post-facto approved) |
closes#323
It's not dramatically affecting any of the test plots (for example test/plots/athletes-sport-sex.js' height was fixed manually at 500px, and becomes 508px with this heuristic).