Skip to content

helper method to add text to the corner or center of a graphic #738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kushalkolar
Copy link
Member

@kushalkolar kushalkolar commented Feb 24, 2025

very simple, API subject to change later, text moves if the graphic offset changes, or if the data changes in the case of lines and scatters

image

@kushalkolar kushalkolar requested a review from clewis7 as a code owner February 24, 2025 09:12
@kushalkolar kushalkolar marked this pull request as draft February 24, 2025 09:44
@clewis7
Copy link
Member

clewis7 commented Feb 24, 2025

I think this could be super useful. Even in the kmeans example, I was thinking about how nice it would be to have a label for each centroid point. Although, that would be giving a label to each point in a scatter, as opposed to a single label for a graphic. Should we support both?

The only potential issue that I see is if the graphics were super close to each other and the labels overlapped. How to reconcile potential readability issues. I guess making it easy to change what corner or position on the graphic the text is would be easiest.

@kushalkolar
Copy link
Member Author

I think this could be super useful. Even in the kmeans example, I was thinking about how nice it would be to have a label for each centroid point. Although, that would be giving a label to each point in a scatter, as opposed to a single label for a graphic. Should we support both?

In that case a user can easily create TextGraphic with the offset set near the scatter point. Maybe for scatters we override add_text() and have the option to place it w.r.t. a bbox corner or w.r.t. certain scatter indices?

The only potential issue that I see is if the graphics were super close to each other and the labels overlapped. How to reconcile potential readability issues. I guess making it easy to change what corner or position on the graphic the text is would be easiest.

This can come later.

@kushalkolar
Copy link
Member Author

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.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy