From f35ad93e8777501f197e7424cfd935e24f90f514 Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Mon, 25 Nov 2024 11:36:58 -0800 Subject: [PATCH] document ordinal aspectRatio --- docs/features/plots.md | 2 +- docs/features/scales.md | 2 +- src/plot.d.ts | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/features/plots.md b/docs/features/plots.md index ce1e3e89ed..362178cdf5 100644 --- a/docs/features/plots.md +++ b/docs/features/plots.md @@ -224,7 +224,7 @@ The default **width** is 640. On Observable, the width can be set to the [standa Plot does not adjust margins automatically to make room for long tick labels. If your *y* axis labels are too long, you can increase the **marginLeft** to make more room. Also consider using a different **tickFormat** for short labels (*e.g.*, `s` for SI prefix notation), or a scale **transform** (say to convert units to millions or billions). ::: -The **aspectRatio** option , if not null, computes a default **height** such that a variation of one unit in the *x* dimension is represented by the corresponding number of pixels as a variation in the *y* dimension of one unit. +The **aspectRatio** option , if not null, computes a default **height** such that a variation of one unit in the *x* dimension is represented by the corresponding number of pixels as a variation in the *y* dimension of one unit. The **aspectRatio** option is recommended only when *x* and *y* domains share the same units, such as millimeters. When a position scale is [ordinal](./scales#discrete-scales) (*point* or *band*), consecutive domain values are treated as one unit length apart; for example, if both *x* and *y* are ordinal, then an aspect ratio of one produces a square grid.