Skip to content

Add Makie package extension for plotting IntervalBoxes - #10

Merged
dpsanders merged 5 commits into
mainfrom
makie-extension
Apr 15, 2026
Merged

dpsanders merged 5 commits into
mainfrom
makie-extension

Conversation

@dpsanders

Copy link
Copy Markdown
Member

Summary

  • Add Makie as a weak dependency with a package extension (IntervalBoxesMakieExt)
  • Enables plotting 2D IntervalBoxes as rectangles via poly() by defining Makie.convert_arguments methods
  • The extension converts IntervalBox{2} to Rect2f and integrates with Makie's existing Poly plot type

Usage

using CairoMakie, IntervalBoxes, IntervalArithmetic
boxes = [interval(0,1) × interval(0,1), interval(2,3) × interval(1,2)]
poly(boxes, color=:blue, strokecolor=:black, strokewidth=1)

Test plan

  • Verified IntervalBoxes loads without Makie (extension is nothing)
  • Test plotting with CairoMakie installed

🤖 Generated with Claude Code

dpsanders and others added 5 commits April 13, 2026 18:32
Add a weak dependency on Makie with a package extension that enables
plotting 2D IntervalBoxes as rectangles via poly(). The extension
converts IntervalBox{2} to Rect2f and integrates with Makie's
convert_arguments system.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Define a @recipe PlotIntervalBox that decomposes into poly!(),
supporting both single IntervalBox{2} and vectors. Users can now call:
  plot(box)
  plot(boxes)
  plotintervalbox(box)
  plotintervalbox!(ax, boxes)

The poly() convert_arguments methods are kept as well.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Define a @recipe for IntervalBox{2} that draws rectangles using
Plots.jl's :shape seriestype. Supports both single boxes and vectors.

Usage:
  using Plots, IntervalBoxes, IntervalArithmetic
  plot(interval(0,1) × interval(0,1))
  plot([interval(0,1) × interval(0,1), interval(2,3) × interval(1,2)])

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…v0.3.1

IntervalArithmetic v1 throws InconclusiveBooleanOperation instead of
ArgumentError when comparing intervals with ==.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The ∈ methods were not extending Base.in because ∈ was missing from
the Base imports. This caused Base.in to use its default iteration
path, which called == on intervals and threw InconclusiveBooleanOperation
on Julia 1.12+.

Fix: add ∈ to `import Base`, add a specific method for IntervalType
to throw ArgumentError, and remove the duplicate AbstractVector method
from intervalbox.jl (already defined in arithmetic.jl).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dpsanders
dpsanders merged commit 18f0c31 into main Apr 15, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant