Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- feat: `labs()` fields default to `auto`; pass `none` to suppress an axis or legend title and reclaim the space it reserved. (#12)
- feat: `element-blank()` on a text surface (axis, plot, or legend title) collapses the space the text would reserve. (#12)
- feat: `width`/`height` accept `auto` to fill the available space of a bounded container. (#10)
- fix: binning geoms reject a non-positive `bins` with a clear error instead of dividing by zero. (#38)
- fix: contour stats skip incomplete cells when the `(x, y, z)` grid is sparse instead of panicking. (#37)
- fix: `scale-*-manual()` with an empty `values` array reports a clear error instead of an opaque divide-by-zero. (#36)
- fix: number formatters carry a fraction that rounds up to a whole unit (e.g., `0.9999995` no longer renders as `0.1`), and `format-scientific` keeps its mantissa in `[1, 10)`. (#35)
Expand Down
4 changes: 4 additions & 0 deletions src/utils/bin.typ
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
let n-bins = if binwidth != none and binwidth > 0 {
calc.max(1, int(calc.ceil((hi - lo) / binwidth)))
} else {
assert(
bins != none and bins > 0,
message: "bins must be a positive integer; got " + repr(bins),
)
bins
}
(n-bins: n-bins, width: (hi - lo) / n-bins)
Expand Down
Loading