Comments (7)
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)
from czml3.
I added your suggested tags to beginning/ end of to_html
output and saved as .html but nothing renders in that case.
from czml3.
I think this means producing complete HTML that does not need embedding anywhere else.
from czml3.
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?
from czml3.
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 <html>
, <head>
, and <body>
, but maybe this is perfect for what you need.
Have a look at the to_html
method:
Lines 97 to 103 in 46b4342
from czml3.
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
from czml3.
What exactly didn't work, or what errors did you observe? Would be useful to know so we can try to address them.
from czml3.
Related Issues (20)
- Drawing arrows does not seem to work properly HOT 4
- creating partial ellipsoids HOT 1
- PyPi czml3 release is outdated HOT 7
- Label.pixelOffset does not appear to work HOT 2
- Add version to czml3 HOT 2
- Remove Cesium ion runtime dependency in CZMLWidget HOT 1
- Support JupyterLab HOT 40
- Cesium Widget full screen does not behave properly in Jupyter HOT 5
- Widget window grows vertically HOT 1
- IntervalValue does not accept integer or float HOT 2
- PyPi release cycle HOT 3
- Generate code using JSON schema HOT 14
- Removing white space from document output HOT 5
- support for GeoJSON and __geointerface__ HOT 2
- Default branch was renamed to main
- Lack of support for positional references HOT 1
- Position missing arguments for interval HOT 6
- missing polygon arguments and missing polyline arguments HOT 1
- cesium token HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from czml3.