Giter VIP home page Giter VIP logo

Comments (8)

ryanbaumann avatar ryanbaumann commented on July 22, 2024 1

@anderl80 yes, if you include your map data parameter as a geojson-format python dictionary, then the data for your map will be packaged up inside your exported map HTML file and can be opened just by opening the HTML file in a browser.

from mapboxgl-jupyter.

sherl0cks avatar sherl0cks commented on July 22, 2024

appears that you can do something along these lines and works well enough. let me know if there is a more interesting solution. else, we can close this.

viz = GraduatedCircleViz(...)

html = open("100000_markers.html", "w")
html.write( viz.create_html() )
html.close()

from mapboxgl-jupyter.

ryanbaumann avatar ryanbaumann commented on July 22, 2024

@sherl0cks this is a very common need - I vote we add an export function for each viz object. Html file would be one option, image another option, PDF a 3rd option, possibly other options to come.

from mapboxgl-jupyter.

sherl0cks avatar sherl0cks commented on July 22, 2024

that works for me. we need to make sure the feature it is added to an example when it is built.

from mapboxgl-jupyter.

ryanbaumann avatar ryanbaumann commented on July 22, 2024

@sherl0cks great, added an initial example using your code - see it in this repo at /examples or at www.mapbox.com/labs/jupyter

Let's leave this ticket open as a placeholder for a broader export viz functionality.

from mapboxgl-jupyter.

sherl0cks avatar sherl0cks commented on July 22, 2024

@ryanbaumann nice. thanks for quick turn around

from mapboxgl-jupyter.

ryanbaumann avatar ryanbaumann commented on July 22, 2024

Here is the export to HTML approach captured in the example notebook:

with open('viz.html', 'w') as f:
    f.write(viz.create_html())
# Python2
python -m SimpleHTTPServer 8080   
# Python 3
python3 -m http.server 8080   

from mapboxgl-jupyter.

anderl80 avatar anderl80 commented on July 22, 2024

Can I share a map with clusters to someone else without starting a web server?

from mapboxgl-jupyter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.