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

Added SVG Pane #85

Merged
merged 4 commits into from
Oct 8, 2018
Merged

Added SVG Pane #85

merged 4 commits into from
Oct 8, 2018

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented Oct 8, 2018

Adds an SVG pane, unlike other image types the size and/or aspect ratio of the SVG cannot be easily computed ahead of time, but it still seems default to its native size unless explicitly overridden.

screen shot 2018-10-08 at 2 13 10 am

@codecov-io
Copy link

codecov-io commented Oct 8, 2018

Codecov Report

Merging #85 into master will increase coverage by 0.06%.
The diff coverage is 97.56%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #85      +/-   ##
==========================================
+ Coverage   91.48%   91.55%   +0.06%     
==========================================
  Files          23       23              
  Lines        3537     3577      +40     
==========================================
+ Hits         3236     3275      +39     
- Misses        301      302       +1
Impacted Files Coverage Δ
panel/tests/test_panes.py 98.52% <100%> (+0.11%) ⬆️
panel/pane.py 80.82% <95%> (+0.82%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 92148d8...e53b164. Read the comment docs.

@philippjfr philippjfr merged commit 7c7517a into master Oct 8, 2018
panel/pane.py Show resolved Hide resolved
@jbednar
Copy link
Member

jbednar commented Oct 8, 2018

Have you tested networkx, which generates graphviz objects that have _repr_svg_?

@philippjfr
Copy link
Member Author

I tested shapely which has a _repr_svg_, don't think networkx will be any different.

@jbednar
Copy link
Member

jbednar commented Oct 8, 2018

Graphviz objects work, but they don't seem to default to their native width as promised:

image

@philippjfr
Copy link
Member Author

philippjfr commented Oct 8, 2018

Not sure there is anything we can do about it tbh, there is simply no reliable way to determine the size or aspect ratio of the svg ahead of time.

@jbednar
Copy link
Member

jbednar commented Oct 8, 2018

Not sure what you mean by "ahead of time"; the SVG is static once the Pane is instantiated in this case, right?

@philippjfr
Copy link
Member Author

By ahead of time I mean before it is rendered into the browser's DOM.

@jbednar
Copy link
Member

jbednar commented Oct 8, 2018

Ah. There might be some Python libraries that could at least return the aspect ratio without rendering it, and probably a bounding box, though of course the browser might not respect that. But not something to work on now...

@philippjfr philippjfr deleted the svg branch October 17, 2018 02:07
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.

3 participants