-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Open
Labels
topic: geometry managerLayoutEngine, Constrained layout, Tight layoutLayoutEngine, Constrained layout, Tight layout
Description
Constrained layout works pretty well for a number of cases, but the code is pretty convoluted. It has bothered me for a while that it uses the constraint solver, but the constraints are so regulated that they really can just be solved with a bit of calculation.
I probably wouldn't have sat down to redo this on my own, but I burnt up some of my Claude tokens and made a new layout engine that is pretty close to feature compatible with constrained layout.
Pros:
- no kiwisolver dependency: the kiwisolver folks have been great, but it is a C dependency and hence a bit fragile to packaging quirks.
- the code is less indirect, and I'd say easier to follow.
- It is faster for large grids (though such grids are perhaps well beyond anything most people should be making anyway)
Cons:
- it is still in it infancy compared to constrained layout
- it does not deal with fixed aspect ratio plots (yet), like compressed layout does.
- it is not pixel perfect comparison (see the comparison here). You can also see how it does on the test images at https://github.com/jklymak/mpl-direct-layout/tree/main/tests/baseline_images
Posting for feedback on strategy here. It could be a standalone package, it could be another layout manager, or we could try and replace constrained layout altogether with it (though I'd want to wait a bit to put it through more tests).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
topic: geometry managerLayoutEngine, Constrained layout, Tight layoutLayoutEngine, Constrained layout, Tight layout
