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

How to disable request for tex-svg.js file? #242

Closed
battleoftwok opened this issue Nov 6, 2024 · 7 comments · Fixed by #243
Closed

How to disable request for tex-svg.js file? #242

battleoftwok opened this issue Nov 6, 2024 · 7 comments · Fixed by #243
Assignees

Comments

@battleoftwok
Copy link

The flag plotly_embed_js does not disable the file request https://cdn.jsdelivr.net/npm/[email protected]/es5/tex-svg.js.
I need to disable all requests. Is it possible?

Image

@battleoftwok
Copy link
Author

Code:

let mut plot = Plot::new();
    let line = Scatter::new(coords.clone(), u.clone())
        .mode(Mode::LinesMarkers)
        .marker(Marker::new().size(10).opacity(0.8).color("#242424"));
plot.add_trace(line);
plot.show();

Cargo.toml

[dependencies]
nalgebra = "0.33.0"
nalgebra-sparse = "0.10.0"
ndarray = "0.13"
plotly = { version="0.10.0", features = ["plotly_embed_js"] }
serde = { version = "1.0.213", features = ["derive"] }
serde_yml = "0.0.12"

@andrei-ng
Copy link
Collaborator

andrei-ng commented Nov 8, 2024

plotly_embed_js was meant for enabling/disabling the embedding of the JS Ploty library in the final executable and in the html file itsef as described in the original issue #176 .

It is unrelated to any other JS scripts from the template html files.

To answer the question in the title, no way unless we change the code :)

@battleoftwok
Copy link
Author

So you can add an additional flag to embed tex-svg.js? The thing is that I need to build graphs on a computer that does not have Internet access. And because of the lack of tex-svg.js, before drawing the graph, there are attempts to request this file, which slows down the output of the graph.

@andrei-ng
Copy link
Collaborator

andrei-ng commented Nov 8, 2024

OK, I see. I have to check why tex-svg.js was added (before I joined the project). Probably most straightforward would be to put it also behind the same embed_js flag to reduce complexity and since ultimately as you very well point out the application of it is in the end offline vs online. I will give you an update this weekend

@battleoftwok
Copy link
Author

Thank you very much!

andrei-ng added a commit that referenced this issue Nov 8, 2024
andrei-ng added a commit that referenced this issue Nov 8, 2024
Embed all js libraries when plotly_embed_js flag is enabled

Fixes #242

Signed-off-by: Andrei Gherghescu <[email protected]>
@andrei-ng andrei-ng self-assigned this Nov 8, 2024
@andrei-ng
Copy link
Collaborator

I merged #243 in main which automatically closed the issue. Let me know if your problem was fixed or not when using the main branch.
I plan to make a new release on crates io soon.

@battleoftwok
Copy link
Author

This worked for me! Thank you!

Image

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 a pull request may close this issue.

2 participants