WIP: Prototype for lightweight overlay API (canvas-level-rendering)#31382
Draft
joddeepesh-cloud wants to merge 4 commits intomatplotlib:mainfrom
Draft
WIP: Prototype for lightweight overlay API (canvas-level-rendering)#31382joddeepesh-cloud wants to merge 4 commits intomatplotlib:mainfrom
joddeepesh-cloud wants to merge 4 commits intomatplotlib:mainfrom
Conversation
Contributor
|
I'm going to mark this as draft since it's a prototype. Some explanation of the API choices and the resulting capability will help greatly with the discussion |
Contributor
Author
|
Thanks for taking a look and marking this as draft. I agree that the API design needs more explanation. I will update the PR description to clarify the design decisions, intended use cases, and how this integrates with the backend rendering pipeline. This is an early prototype as part of my GSoC proposal, and I’d really appreciate feedback on the overall direction. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status: Draft prototype for discussion
This PR introduces an initial prototype for a lightweight overlay API in Matplotlib.
The goal of this work is to enable temporary graphical primitives (e.g., lines, rectangles) to be rendered directly on the canvas without requiring full figure redraws.
Current implementation includes:
Design Overview
The overlay API is designed to allow temporary graphical primitives to be drawn independently of the main figure rendering pipeline.
Key design decisions:
This approach aims to provide a lightweight, backend-consistent mechanism for interactive drawing, avoiding repeated full redraws.
Motivation
Interactive tools in Matplotlib (e.g., crosshair cursors, selection boxes, measurement guides) often require temporary graphics that are frequently updated. Currently, these workflows rely on full redraws or workarounds, which can impact performance and increase implementation complexity.
This prototype explores a cleaner approach by introducing a dedicated overlay layer.
Notes
This is an early prototype intended for discussion and feedback. The design and API are subject to change.
This work is part of my GSoC 2026 proposal under NumFOCUS, and I would greatly appreciate feedback on the design direction and integration approach.