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 and updated PNG download buttons in Plotly #139

Merged
merged 9 commits into from
Jun 15, 2021

Conversation

jakublala
Copy link
Contributor

Fixes #120

src/map/map.ts Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/map/map.ts Outdated Show resolved Hide resolved
src/static/png-icon.svg Outdated Show resolved Hide resolved
src/static/svg-icon.svg Outdated Show resolved Hide resolved
Copy link
Contributor

@Luthaf Luthaf left a comment

Choose a reason for hiding this comment

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

This feature is working very well, I have some suggestions to improve the user interface.

In addition to the comments below, the modebar now looks a bit strange:

Capture d’écran 2021-06-14 à 10 19 30

Could we

  • move the download as SVG/PNG buttons to the left of the modebar?
  • use thicker lines in the icons? They look very thin compared to the other icons.

src/map/map.ts Outdated
Comment on lines 123 to 124
width: gd._fullLayout.width,
height: gd._fullLayout.height,
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a bit small, and the plot ends up pixelated. I think we should multiply the width/height by 2, and make sure this is at least 600px in each direction.

Copy link
Contributor

Choose a reason for hiding this comment

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

This proved to be harder than expected =( Changing the size of the plot also changes the spacing between points; and using the scale parameter does scale the plot up; but the resulting plot is still pixelated. I think this is because we are using scattergl trace, and plotly does not re-render the plot on a large canvas, but instead use the already existing one.

src/map/map.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@Luthaf Luthaf left a comment

Choose a reason for hiding this comment

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

Looks good, just a small any to remove! Here again, make sure to squash commits before merging, either manually or with the github UI

src/map/map.ts Outdated Show resolved Hide resolved
Co-authored-by: Guillaume Fraux <luthaf@luthaf.fr>
@jakublala jakublala merged commit 99bc538 into lab-cosmo:master Jun 15, 2021
@jakublala jakublala deleted the PlotlyButtons branch June 15, 2021 15:38
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.

Allow saving the map to SVG
2 participants