Skip to content

Commit

Permalink
adopts the new monospace relative width (#1880)
Browse files Browse the repository at this point in the history
(tested by http://localhost:8008/?test=marginsMonospace)
  • Loading branch information
Fil committed Oct 12, 2023
1 parent e1dbe2c commit 0b9889a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/dimensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ export function autoMarginK(
if (scale === "y" || scale === "fy") {
const width = mark.monospace ? monospaceWidth : defaultWidth;
const labelPenalty = actualLabel && (labelAnchor === "center" || (labelAnchor == null && scales[scale].bandwidth));
const l =
max(channels.text.value, (t) => (t ? width(`${t}`) : NaN)) * (mark.monospace ? 0.6 : 1) +
(labelPenalty ? 100 : 0);
const l = max(channels.text.value, (t) => (t ? width(`${t}`) : NaN)) + (labelPenalty ? 100 : 0);
const m = l >= 500 ? marginLarge : l >= 295 ? marginMedium : null;
return m === null
? options
Expand Down

0 comments on commit 0b9889a

Please sign in to comment.