I followed this, but it only told me how to add ipywigets’ built-in widget such as IntSlider. I want to embed open3d’s JVisualizer into a standalone web page.
here’s my code
from open3d import JVisualizer
from ipywidgets.embed import embed_minimal_html
j = JVisualizer()
j.add_geometry(pcd)
embed_minimal_html('export.html', views=[j], title='Widgets export')
and I got a html like this
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Widgets export</title>
</head>
<body>
<!-- Load require.js. Delete this if your page already loads require.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" crossorigin="anonymous"></script>
<script src="https://unpkg.com/@jupyter-widgets/html-manager@^0.18.0/dist/embed-amd.js" crossorigin="anonymous"></script>
<script type="application/vnd.jupyter.widget-state+json">
{
"version_major": 2,
"version_minor": 0,
"state": {
"c24feb038091466b80063940fad944b1": {
"model_name": "LayoutModel",
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"state": {}
},
"21b49d3a55d644c3a914c0f0fb58c7ae": {
"model_name": "JVisualizerModel",
"model_module": "open3d",
"model_module_version": "~0.12.0",
"state": {
"_dom_classes": [],
"geometry_jsons": [
{
"type": "PointCloud",
"points": [
0.0,
0.7484375238418579,
-1.884259819984436,
.... (many lines here)
1.0,
1.0
]
}
],
"layout": "IPY_MODEL_c24feb038091466b80063940fad944b1"
}
}
}
}
</script>
<script type="application/vnd.jupyter.widget-view+json">
{"version_major": 2, "version_minor": 0, "model_id": "21b49d3a55d644c3a914c0f0fb58c7ae"}
</script>
</body>
</html>
then I open it in the chrome and got
So what’s the proper way to do it?