-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Add title tag #24
Add title tag #24
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pull request. This is a good feature to add.
As it is, the new Title
element can't be used with most of the drawing elements (e.g. Rectangle
doesn't have an append
method). I suggest adding an appendTitle
method to DrawingBasicElement
similar to appendAnim
. Something like
def appendTitle(self, text, **kwargs):
self.children.append(Title(text, **kwargs))
See my comments to improve code quality.
Also, please add this to the examples. I don't think it needs its own example so I would just add a title to the rectangle in example 1 (with a code comment saying what it does).
This updates based on the comments in the pull request, and updates the example SVG as well.
@cduck Thanks for the comments! I think I addressed everything you brought up, but I wasn't totally sure if I chose the right name for the parent class. Does this align with what you're thinking? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. This looks good. Just two minor changes then I'll merge it.
Thank you! |
drawSvg/elements.py
Outdated
''' A line of text within the Text element. ''' | ||
TAG_NAME = 'tspan' | ||
class _TextContainingElement(DrawingBasicElement): | ||
''' A private parent class used for elements that only have plain text content. ''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to wrap to 80 characters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, sorry for really drawing this review out into tedium ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem. This only happens because I haven't added continuous integration to the project yet.
And with my last commit, a careless vim keystroke has included my command into the commit message. I'm happy to either rebase and squash or whatever works for you, since I've really shown my clumsiness here. |
I squash all PRs when I merge and usually use the PR description as the final commit message. |
Ah, great -- thank you for your patience. :)
…On Wed, Oct 7, 2020 at 3:01 PM Casey Duckering ***@***.***> wrote:
I squash all PRs when I merge and usually use the PR description as the
final commit message.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#24 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAVXO7DSHIROGEHKLN64RLSJTCLLANCNFSM4SFA4NHQ>
.
|
Merged and published version 1.7.0 (https://pypi.org/project/drawSvg/1.7.0/). Thanks for your help. |
This adds a "title" tag, which can be used as described in the answer here:
https://stackoverflow.com/questions/10643426/how-to-add-a-tooltip-to-an-svg-graphic
to add a tooltip. For instance,