Skip to content
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 svg traitlet, more examples #1

Merged
merged 2 commits into from Jun 28, 2016
Merged

Conversation

bollwyvl
Copy link
Contributor

First off, 😍 the work.

This adds SVG output with XMLSerializer... seems to work ok! Not sure if this is what you were talking about in the google group thread.

I added some examples (and some navigation between them).

@ricklupton
Copy link
Owner

Thanks! Looks great, though there are a couple of typos in saving SVG to a file -- could you fix them?
The extra examples are good.

I was hoping there might be a way that the widget itself could have an SVG representation, so that it would automatically work in nbviewer without needing to separately display SVG(widget.svg), but it seems like this will be complicated since it would have to be updated after the widget instance has been displayed.

self._auto_svg_filename = None

def save_svg(self, filename):
data = base64.decodebytes(bytes(self.png, 'ascii'))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.svg

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, didn't need to do anything, really, to the data, so just passing it directly

@bollwyvl
Copy link
Contributor Author

the widget itself could have an SVG representation

Ah, that's a longer con... I don't know what parts of the situation are missing: you might need to publish on npm, do some extra embedding steps, etc.

Any thoughts, @SylvainCorlay?

@ricklupton ricklupton merged commit 592623e into ricklupton:master Jun 28, 2016
@ricklupton
Copy link
Owner

Thanks for the fixes.

@bollwyvl
Copy link
Contributor Author

Thanks! Looking forward to seeing how it develops!

On 05:40, Tue, Jun 28, 2016 ricklupton notifications@github.com wrote:

Thanks for the fixes.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#1 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AACxRPRqHx99I5tYReTjRKX15QsrT7r0ks5qQOvxgaJpZM4I9XwB
.

ricklupton pushed a commit that referenced this pull request Oct 9, 2018
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.

None yet

2 participants