-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
Plotly backend #77
Comments
Maybe Patchwork? |
Possibly, but I think that might be lower-level than I was aiming for. I was thinking about wrapping the Plotly javascript object with a socket to change it's data, then let them worry about individual DOM objects. |
I think this issue should include a note about why https://github.com/plotly/Plotly.jl is inadequate for this purpose, for future reference. |
Sure. Afaik, plotly/Plotly.jl is geared towards their cloud plotting API, whereas we want to access the newly released open source javascript lib.
|
I've made a bunch of progress with Plotly, for anyone that wants to start testing things out. Latest is on the dev branch. A bunch of plot types are supported, even including contours and pie-charts, but a lot is still missing. cc: @joshday @EricForgy |
👍 Seems like a great start! |
Has anyone figured out a good way to save a PNG of a Plotly graph automatically (and preferably without opening a browser window). Can I bypass the browser? cc: @spencerlyon2 |
I can do from Julia, but only through a javascript call after an electron window is opened. I'm still trying to come up with a better way to do this. The best case scenario for me would to be able to save in png and pdf from a Julia script and configure at least the dpi. Maybe @jackparmer knows some tricks? |
What is the javascript call for this? I can do the same thing until we find a better solution. |
It's basically this function, specifically the I haven't wrapped it up into something usable yet. I mostly played around at the js console in my electron window and mimicked the body of that function. I didn't have time to expose it from Julia -- though it's just a matter of pasting the code in as a string and letting blink call out to the js console for me. I will say, however, that the quality is very disappointing. I think the image is saved at something like 96 dpi with no ability to configure |
so this is already done completely locally? nice |
Nice progress! Tried it out, and the quality is great. Is it only on my part that the text is a wee bit tiny? |
I second that observation |
I like it that size, but of course you can always change it:
Of course this brings up one of the issues with the Plotly backend, which is that the margins don't properly account for the guide labels. |
In the end it's your decision. But I would encourage you to use the usual defaults. As a user I would expect the plot to look similar to when I create it in R using the |
In principle I am happy as long as I know how to change it (guidefont, legendfont, tickfont, I think I can remember three keywords :)). If I am analysing data on my own, plotting variables I know the range of, then sure, I can live with small numbers. Though, it is a bit small for external communication - in my very humble opinion. |
This brings up a tricky issue. In theory, everything about the plot is already defined before it gets to backend-specific code. That means the PyPlot title should be the same size as the Plotly title (it uses the Plots-default, regardless of what the backend default would be) This is the same for color palettes, etc. I agree that there should be a way to use the backend defaults for certain things, maybe font is one of them? This might require having a default font The other issue it highlights is that there should be a nice way to specify per-user defaults. (I guess you could always add something like this to your
|
Ok I see... it's something weird with Plotly then. Gadfly and PyPlot seem to match. I'll try to figure out what's going on. |
After reading your comment I changed my opinion about the backend defaults. I agree that a consistent experience across different backends is a better idea than using the backend default. I think the Gadfly plot above looks very reasonable. |
A quick question, you've ( @tbreloff ) checked off "lines", and |
I don't think "line" (connected points sorted by x-value) is supported right now, but "path" is supported. This follows Gadfly's naming convention. "path" is the more general of the two. I'm not at my computer to test.
|
I get the naming conventions, but despite the warning, the command gives me the correct result.
So it works, even if an error is thrown saying that it doesn't. I guess because it flows through https://github.com/tbreloff/Plots.jl/blob/366dc1cca99e680a8bc175705344153876269ebc/src/plot.jl#L315-L322 ? So I should maybe interpret the warning as: " you will get a line plot, but not by actually calling the backend directly, rather I do something to the data first" ? |
Perfect thanks. Just need to add it to the supported list then :)
|
Is there a way to drawn onto a ploly surface plot? Last time I tried it said that it isn't allowed. Context: I would like to be able to recreate GIFs like this one from an NVIDIA blog |
You should be able to do this already. This works for me:
The tough part is saving a PNG and creating the animation... Plotly is not the ideal choice because of that. |
I'll check it out, thanks
actually, I would be fine with live animations as well. Would probably be cooler anyway to be able to rotate the thing while it's happening |
I'd like this too, but PyPlot is a better option for both approaches. Right now, I create fresh html for Plotly every time you update/display the plot, so it would pop up 100 browser windows, each with the next frame. Eventually I'd like to incorporate the approaches of @spencerlyon2 and/or @EricForgy to update existing Plotly plots. |
Closing in favor of meta-issue (#316) |
Allow specifying :wand bins
@joshday has put together a Plotly prototype at https://github.com/joshday/PlotlyLocal.jl. I want to review which parts are Plotly-specific, and which are "javascript plotting libs" specific, and generalize as best as possible.
The text was updated successfully, but these errors were encountered: