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.

hobs
  • 18,473
  • 10
  • 83
  • 106
B--rian
  • 5,578
  • 10
  • 38
  • 89
  • 1
    don't search for `Vega` but `3D transformations` and you get tons of links to game development, OpenGL, ..... – rioV8 Sep 19 '18 at 13:45
  • You have much more in using `WebGL`. – rioV8 Sep 19 '18 at 13:50
  • 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. https://en.wikipedia.org/wiki/Implied_volatility_surface – B--rian Sep 19 '18 at 14:01
  • 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. – rioV8 Sep 19 '18 at 14:07
  • 1
    There already is a JS version of plot.ly. – i alarmed alien Sep 19 '18 at 15:35
  • 2
    Vega does appear to have unofficial/undocumented 3d visualization support. https://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! – metasoarous Apr 04 '19 at 05:34

1 Answers1

4

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

jakevdp
  • 77,104
  • 11
  • 125
  • 160
  • 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? – B--rian Sep 19 '18 at 16:52
  • threejs is a scene graph library on top of WebGL – rioV8 Sep 19 '18 at 17:42
  • Just to be sure@jakevdp, is it still the case as of 2022? – Basj Nov 16 '22 at 11:59
  • 1
    @B--rian 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. – Michael Mior Feb 21 '23 at 12:44