-
Notifications
You must be signed in to change notification settings - Fork 32
Allow standalone export #53
Comments
I think this means producing complete HTML that does not need embedding anywhere else. |
Hi @astrojuanlu! Is there currently any good way to use the CZMLWidget HTML representation outside of a notebook, e.g. embedded within some template page? |
Hi @lalligagger! If I recall correctly, this widget does not (yet) have any jupyter-specific code, it's just a blob of HTML. The only thing missing is Have a look at the Lines 97 to 103 in 46b4342
|
Ok, I haven't been able to get standalone html working but a mashup of the extractor and the approach taken below has me running in a dash app! https://community.plotly.com/t/adding-cesium-app-to-plotly-dash/48336 |
What exactly didn't work, or what errors did you observe? Would be useful to know so we can try to address them. |
I added your suggested tags to beginning/ end of |
The existing "to_html" function actually works, but you need to load RequireJS in the html page you want to hold the resulting widget. For example: from czml3.examples import simple
from czml3.widget import CZMLWidget
view = CZMLWidget(simple)
html = view.to_html()
page = f"""<!DOCTYPE html>
<html>
<head>
<script src="http://requirejs.org/docs/release/2.3.6/comments/require.js"></script>
</head>
<body>
<!-- CZMLWidget -->
{html}
</body>
</html>
"""
# save to file
with open("CesiumJS.html", "w") as file:
file.write(page) |
No description provided.
The text was updated successfully, but these errors were encountered: