Generating 3D surface plots with Vega?
Asked Answered
F

1

6

A current project requires us to use Vega Visualization Grammar wherever possible and otherwise fall back to D3.js. 3D-surface plots are not part of the Vega's gallery of examples, however Vega Documentation makes me optimistic that we could create our own graph representations. Could somebody advise me how to do generate 3D surface plots with Vega? Any tutorial you suggest? Or maybe even a brief recipe assuming that I have a data set of say a few 100 (x,y,z) tuples?

Edit: The goal is quasi-static graphics with linear-interpolation between the points, in R we would probably do it like with a wireframe.

Obviously, I extensively used search engines, but see many results on astronomic research on α Lyrae.

Funicular answered 19/9, 2018 at 12:51 Comment(6)
don't search for Vega but 3D transformations and you get tons of links to game development, OpenGL, .....Bifacial
You have much more in using WebGL.Bifacial
Thanks for the hint, but the issue is that plotly or WebGL are considered too much. A nice example what I am after is e.g. en.wikipedia.org/wiki/Implied_volatility_surfaceFunicular
Somebody has to do the math, it is you completely or you let some of the tricky math done by WebGL or plotly. If plotly can draw such a graph easily why not use it? Writing plotly in javascript will be a time consuming project.Bifacial
There already is a JS version of plot.ly.Rosierosily
Vega does appear to have unofficial/undocumented 3d visualization support. github.com/vega/vega/issues/1738 It's not yet clear exactly what is/isn't possible via this functionality, but I'm very excited to find out more about it!Waive
L
4

3D surface plots are not supported by Vega. You might try another library, like threejs.

Lucio answered 19/9, 2018 at 16:34 Comment(4)
Is in principle possible to contribute to the Vega project by addening a new plot type? Is there any detailed guide on how to do that?Funicular
threejs is a scene graph library on top of WebGLBifacial
Just to be sure@jakevdp, is it still the case as of 2022?Selfidentity
@Funicular Of course you could contribute to Vega, but given that adding a new type of plot is a very involved process, you're unlikely to find a guide that will walk you through all the steps.V

© 2022 - 2024 — McMap. All rights reserved.