feelpp / antora-ui

https://feelpp.github.io/antora-ui/
Mozilla Public License 2.0
0 stars 2 forks source link

Creation of a macro for vtk.js #16

Closed prudhomm closed 1 year ago

ggrossetie commented 1 year ago

For vtk I think we should create an AsciiDoc macro.

Currently, we are using a passthrough with HTML:

++++
<div class="stretchy-wrapper-16_9">
<div id="vtkVisuSection1" style="margin: auto; width: 100%; height: 100%;      padding: 10px;"></div>
</div>
<script type="text/javascript">
  feelppVtkJs.createSceneImporter(vtkVisuSection1, {
    fileURL: "https://girder.math.unistra.fr/api/v1/file/5ad4bff6b0e9574027047d77/download",
    objects: { "deformation":[ { scene:"displacement" }, { scene:"von_mises" }, { scene:"pid" } ] }
});
</script>
++++

Here's the same sample using the vtk macro:

[vtk,url=https://girder.math.unistra.fr/api/v1/file/5ad4bff6b0e9574027047d77/download]
....
{
  "deformation": [
    { scene:"displacement" }, 
    { scene:"von_mises" }, 
    { scene:"pid" } 
  ] 
}
....

@prudhomm maybe we should create a dedicated issue for trame?

prudhomm commented 1 year ago

Actually what you see is vtkjs code @ggrossetie . Trame provide a framework for various plotting tools including vtkjs plotly pyvista... Perhaps the work should focus on trame plus vtkjs and plotly as 'plugins' and then extend to other plotting tool later?

ggrossetie commented 1 year ago

Trame is a web application with a running Python server. As far as I know the Python code is executed server-side and it has its own client/UI. I'm not sure how we can integrate it into a static web documentation site.

Whereas VTK.js and Plotly are JavaScript libraries for visualization in the browser. Am I missing something?

prudhomm commented 1 year ago

Trame is indeed a python webapp. basically we would need to embed it in the antora page and have a server somewhere doing the rendering. The webapp in itself is our "problem", do you think we could have a nice macro to do the embedding and configure what we see in the Trame frame ?

prudhomm commented 1 year ago

Trame is indeed a python webapp. basically we would need to embed it in the antora page and have a server somewhere doing the rendering. The webapp in itself is our "problem", do you think we could have a nice macro to do the embedding and configure what we see in the Trame frame ?

prudhomm commented 1 year ago

Trame is indeed a python webapp. basically we would need to embed it in the antora page and have a server somewhere doing the rendering. The webapp in itself is our "problem", do you think we could have a nice macro to do the embedding and configure what we see in the Trame frame ?

prudhomm commented 1 year ago

Trame is indeed a python webapp. basically we would need to embed it in the antora page and have a server somewhere doing the rendering. The webapp in itself is our "problem", do you think we could have a nice macro to do the embedding and configure what we see in the Trame frame ?

ggrossetie commented 1 year ago

Trame is indeed a python webapp. basically we would need to embed it in the antora page and have a server somewhere doing the rendering. The webapp in itself is our "problem", do you think we could have a nice macro to do the embedding and configure what we see in the Trame frame

As far as I understand, the UI is also defined server-side in the Python webapp. In Antora, we can use an <iframe> to embed the index.html page from the trame webapp.

vincentchabannes commented 1 year ago

@ggrossetie je t'ai rajouté au repo feelpp-js, il y a le code qui permet de générer la lib js disponible dans antora-ui. Ça fait très longtemps que je n'y a pas touché. En résumé, j'étais parti d'un example de vtk.js et j'avais rajouté les checkbox/combobox en haut à gauche permettant de modifier la visu.

Il faudrait probablement prévoir la mise à jour de vtk.js (qui est en retard de plusieurs années) et peut-être améliorer l'interface actuelle.