| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Can we use this PR to talk about the proposed API and the need for it? There are so many other issues and PRs that I am having trouble following what has been said where. I'd really appreciate a few examples as to what this new feature is supposed to look like to the end user, and a bit more discussion as to whether this is worth the complexity. It seems there is one use case where its "lets let the user normalize the unit size of markers given a limited set of options" all the way to "lets let the user arbitrarily transform markers using the full transform stack". Perhaps these are not incompatible, but it would be nice to see what this will look like by the end of all these PRs. Right now the only example I've seen in any of the PRs is the quite esoteric desire to lay out pies charts using scatter, which is pretty gee-whiz, but doesn't strike me as a good argument for any of this functionality. Are there examples that show the power of this approach for actual scatter plots? |
Sorry, something went wrong.
|
@jklymak absolutely! Opened this PR to centralize discussion since, as you say, it was pretty fractured before. I'll let @ImportanceOfBeingErnest speak for the use cases for custom paths for a marker, but we already allow custom paths for markers, that is existing API. This PR is not about allowing custom markers, but allowing us to normalize markers so that they look perceptually uniform (#15703). Since we already allow custom markers, any marker normalization code has to be able to perform its duties when passed an arbitrary path. Thankfully, the formulas for the area/extents/etc of an arbitrary path are actually quite simple (thanks to the fact that our Path objects are just a list of bezier curves), so this PR solves the normalization problem by just implementing the code to compute the area/bbox area/etc of an arbitrary path. Is the issue that you don't see a use-case for custom markers? We'd have to remove existing 3.2.x API to get rid of them. (Although the changes in this PR would go in more or less as-is regardless). |
Sorry, something went wrong.
|
There is a section "Why is this useful?" in my PR #16773. |
Sorry, something went wrong.
|
Just found this issue and wanted to offer my encouragement. It looks like it's going to take substantial effort, but I think it would be a really big improvement. |
Sorry, something went wrong.
|
Since this Pull Request has not been updated in 60 days, it has been marked "inactive." This does not mean that it will be closed, though it may be moved to a "Draft" state. This helps maintainers prioritize their reviewing efforts. You can pick the PR back up anytime - please ping us if you need a review or guidance to move the PR forward! If you do not plan on continuing the work, please let us know so that we can either find someone to take the PR over, or close it. |
Sorry, something went wrong.
|
Closing for lack of activity. While theoretically nice, this is not a priority. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
WIP. A proposal to resolve #15703.
In short, I propose adding one new parameter to MarkerStyle.__init__, and expanding the options currently available for normalization (copied from the proposed docstring of MarkerStyle.__init__):
normalization : str, optional, default: "classic" The normalization of the marker size. Can take several values: *'classic'*, being the default, makes sure custom marker paths are normalized to fit within a unit-square by affine scaling (but leaves built-in markers as-is). *'bbox-width'*, ensure marker path fits in the unit square. *'area'*, rescale so the marker path has unit "signed_area". *'bbox-area'*, rescale so that the marker path's bbox has unit area. *'none'*, in which case no scaling is performed on the marker path. centering : str, optional, default: "classic" The centering of the marker. Can take several values: *'none'*, being the default, does not translate the marker path. The origin in path coordinates is the marker center in this case. *'bbox'*, translates the marker path so that its bbox's center is at the origin. *'center-of-mass'*, translates the marker path so that its center of mass it as the origin. See Path.center_of_mass for details.Goals
A "complete" custom marker system, that allows the user to choose between several options for marker normalization and centering as is most relevant to their particular plotting goals.
Implementation
The marker customization options will require the following new functionality
Any reasonable implementation of the above three methods will require
Each Path function will simply accumulate the values for its BezierSegment counterpart to compute the values for the total path (our Path's right now are simply collections of BezierSegments, even though they're not stored that way explicitly).
Unfortunately, for methods of Path to call methods of BezierSegment, some slight re-arrangements are required to prevent circular import issues (#16812).
Finally, in order to iterate easily over the BezierSegment's that make up the path (to do this accumulation), I'll need to implement
Using iter_segments directly instead requires a HUGE amount repeated code. Incorporating the proposed .iter_bezier functionality into iter_segments leads to an absolutely unwieldy amount of bloat in iter_segments, so the real question I think is just whether this should be added to the public API (it seems like a very good candidate to me, as it produces MUCH cleaner user code than using iter_segments for any code I've had to write, and presents a much more simple model of the underlying Path).
Roadmap
#16812 (*) <- #16832 (*) <- #16859 (*) <- #16888 <- #16889 (*) <- (This PR)
"<-" means "depends on", and "(*)" marks PRs whose implementations are complete and fully ready for review.
PR Checklist