-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Unable to embed static rendering on Windows #194
Comments
Hi @LouDnl. Thanks for posting here. The problem here is that oz is trying to generate a static image to embed in the page, which then gets replaced by the live/interactive vega visualization once the dom loads up. To do this, it's incidentally calling out to the I'm happy to accept a PR to make this code Windows compatible, but I don't use Windows, so I'm probably not the best person to work on this. If you're fine not having the statically embedded image (which, to be honest, is a pretty minor convenience in most scenarios; it's mostly there so that if js is turned off, you can still see the plots, such as in Dropbox previews, or for converting to PDF), you can just keep using the existing code unaltered. If it's important to you though, you could try using the WSL for Windows, which was getting pretty good last time I tried it, and to my understanding has only gotten better. Please let me know if I can be of further help with this. Thanks again! |
PS I think the correct behavior here would be for Oz to try to use darkstar to compile a static svg instead of png via the vega npm cli(s) if it's not able to find the latter. The default/fallback behavior here could probably use a review and revamp, as it doesn't always do what you'd want at the moment. |
Hi @metasoarous , thanks for your reply. Is it possible to disable the local generation of a static image by supplying an option? I have tried to find it but failed. |
I think I found a workaround, will use this: (embed-vega-form {:vega-embed-opts {:live-embed? true :static-embed false}}
{:mode :hiccup
:doc [:vega-lite {:description "Bar chart with text labels. Set domain to make the frame cover the labels.",
:data {:values [{:a "A", :b 28},
{:a "B", :b 55},
{:a "C", :b 43}]},
:encoding {:y {:field "a", :type "nominal"},
:x {:field "b", :type "quantitative", :scale {:domain [0, 60]}}},
:layer [{:mark "bar"}, {:mark {:type "text",
:align "left",
:baseline "middle",
:dx 3},
:encoding {:text {:field "b", :type "quantitative"}}}]}]}) |
Almost, this works: (oz/embed-vega-form {:vega-embed-opts {:live-embed? true :static-embed false}}
[:vega-lite {:description "Bar chart with text labels. Set domain to make the frame cover the labels.",
:data {:values [{:a "A", :b 28},
{:a "B", :b 55},
{:a "C", :b 43}]},
:encoding {:y {:field "a", :type "nominal"},
:x {:field "b", :type "quantitative", :scale {:domain [0, 60]}}},
:layer [{:mark "bar"}, {:mark {:type "text",
:align "left",
:baseline "middle",
:dx 3},
:encoding {:text {:field "b", :type "quantitative"}}}]}]) |
If you set |
Hi @metasoarous ,
As requested here is the info for this issue.
#####Description:
I can create a nice vega-lite bar graph, works fine. But for some reason I keep getting the following stacktrace in the background and I'm not even asking it to use CLI. And I am not using a static ambed afaik?
#####OS:
Os is Windows (development system), have not yet tried on linux deployment box.
#####Error:
#####Codeblock:
I can't share the whole codeblock due to code being private
#####Hiccup part embedded in clojure file
The text was updated successfully, but these errors were encountered: