echarts4r
echarts4r copied to clipboard
scatter_gl does not work for "cartesian2d"
Is there a plan to make scatterGL available for 2d-plots? The examples are "only" for geo coordinate system. I´ve tried everthing to find a workaround but have not succeeded...
@docalpickausername, could be a silly question, but why would you need GL for 2d plots? The 'cartesian2d' type is doable in GL, but makes sense only for very large datasets. Do you happen to have a link to your data ? (...will help with testing)
@helgasoft I'm afraid not, for reasons I have now forgotten I have not implemented that though echarts.js supports it.
one reason could be that the GPU needs a third coordinate (Z) to start working, otherwise processing is done by the CPU (slower). I don't know how they fake it in geo, but a workaround to look at large two-dimensional data using GPU power is just to set z=0.
quakes %>% mutate(myz=rep(0, nrow(.))) %>%
e_charts(stations) %>%
e_scatter_3d(depth, myz) # 1000 points
data.frame(x=sample(1:100, 10000, replace=TRUE),
y=sample(1:100, 10000, replace=TRUE),
z=rep(0, 10000)) %>%
e_charts(x) %>% e_scatter_3d(y, z) # 10,000 points
@helgasoft First, thanks for taking the time and the suggested workaround. I cannot link to the data because they are confidential customer data.The data are not "sophisticated" - simply time-series (door cycles from trains, compressor load-cycles etc.) - x-axis numeric timestamps and y-axis e.g. current (so you can use your random sample, but scale it up to 500k). We need to be able to plot up to 500k+ datapoints (= the number of rows 1 door produces within one day). Scattergl is the single most important feature to us. We are in predictive analytics and I can imagine that GL for 2d-plots is also a requirement for other companies in this field, rather than "geo". Anyway, echarts is beautiful, the syntax is easy and we look forward to seeing scattergl 2d in the upcoming releases ;-)
@docalpickausername - "Good things come to those who wait" 🍰 I think there is an interim solution for the "scatterGL 2d" problem. With Shiny you can prepare your data in R and use a pure HTML/echarts.js user interface for display. Here is the code . Please reply whether it works for you.
Sorry, I did not know it would be such a valuable feature, I'm a bit overstretched these days but will try to make some time to implement that.
@helgasoft maybe this approach using websocket would provide some more flexibility in the meantime: https://gist.github.com/JohnCoene/8756bc27cac8b21a8697c4261ddeccbd
Hello, any updates on this? I can confirm that this feature would be useful.
I have a 2D high resolution scatter chart with hundreds of points. It seems that the high resolution is causing performance issues which could be solved by using scatter GL.
Apologies, I have not been very responsive of late. Work is taking the vast majority of my time: I will try to look back into this when I find the time.