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

HTML export relies on local path #262

Open
erihe251 opened this issue Jul 22, 2021 · 4 comments
Open

HTML export relies on local path #262

erihe251 opened this issue Jul 22, 2021 · 4 comments

Comments

@erihe251
Copy link

erihe251 commented Jul 22, 2021

Describe the bug
When saving the plot as HTML, the resulting file references script files by paths local to the current installation. The files are thus only usable on the computer where they were created.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the plot window
  2. Click on Export as HTML
  3. Open HTML file in editor
  4. See path like: file:///C:/Users/XXX/AppData/Roaming/QGIS/QGIS3/profiles/default/python/plugins/DataPlotly/jsscripts/polyfill.min.js

Desktop:

  • OS: Windows 10
  • QGIS 3.18
  • DataPlotly 3.7.1

Additional context
I have not used plotly, but it seems like it should be possible to either create HTML-files that rely on a copy of plotly hosted online by a CDN, or create HTML-files that contain the necessary libraries and can thus be used offline without any local depencies.

If this is not an option, I think it would be nice to mention somewhere that the HTML-files have this local depency.

@erihe251 erihe251 added the bug label Jul 22, 2021
@erihe251
Copy link
Author

erihe251 commented Jul 23, 2021

A quick fix is to change this line in plot_factory.py so that include_plotlyjs= is 'cdn' instead of False.

Options for include_plotlyjs can be found here.

@ghtmtt
Copy link
Owner

ghtmtt commented Jul 27, 2021

@erihe251 the idea to add the parameter include_plotlyjs=False was exactly meant for offline usage. Plotly main API have been enhanced quite recently. We will have a look and try to incorporate the new features.

@ghtmtt
Copy link
Owner

ghtmtt commented Apr 13, 2022

@erihe251 I'm converting this issue to a feature request given that the plugin works as expected and is meant to be used offline.

@ghtmtt ghtmtt added enhancement and removed bug labels Apr 13, 2022
@erihe251
Copy link
Author

erihe251 commented Apr 15, 2022

@ghtmtt Sounds reasonable to me. I made a pull request to add a comment to the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants