Giter VIP home page Giter VIP logo

Comments (10)

nlehuby avatar nlehuby commented on July 22, 2024 1

thanks for your reply !

Your proposal is very close to the javascript mapboxgl API, so it would very easy to use. I do approve 👍

from mapboxgl-jupyter.

ryanbaumann avatar ryanbaumann commented on July 22, 2024

@nlehuby great call - right now we wrap the python variable passed to style_url as a string in each jinja template. We should enable an option to pass a python dictionary in JSON format and have the Jinja template format it as a JS object, not a string.

Proposal

Change the parameter name for viz class to style from style_url, and in the viz.py class, check if the style parameter is a url string or a Mapbox GL format JSON object.

Sample Python syntax for a mapboxgl.viz class:

# Stylesheet as Python dictionary in JSON format
mystyle = {my_mapbox_stylesheet}

#Load as a local stylesheet
viz3 = CircleViz(data, access_token=token, color_property='Avg Covered Charges',
                 style=mystyle,
                 color_stops=color_stops, center=[-95, 40], zoom=3)

#Load as a Mapbox Style
viz3 = CircleViz(data, access_token=token, color_property='Avg Covered Charges',
                 style="mapbox://ryanbaumann/styles/mystyle",
                 color_stops=color_stops, center=[-95, 40], zoom=3)

from mapboxgl-jupyter.

ryanbaumann avatar ryanbaumann commented on July 22, 2024

@nlehuby is this an issue you could submit a PR for?

from mapboxgl-jupyter.

ryanbaumann avatar ryanbaumann commented on July 22, 2024

This shipped in #59 !

from mapboxgl-jupyter.

kevalshah90 avatar kevalshah90 commented on July 22, 2024

Stumbled upon this issue while looking for a fix for: https://stackoverflow.com/questions/62751062/mapbox-gl-in-jupyter-notebook-add-custom-marker/.

I'd like to use a custom marker for point coordinates, however, not seeing where do I make the fix.

from mapboxgl-jupyter.

akacarlyann avatar akacarlyann commented on July 22, 2024

Hey there @kevalshah90 , I had started something along those lines with #149. Does something along those lines meet your need? Or are you looking for something that just substitutes a different shape in place of a circle marker? That's not (yet) supported, but definitely something we could look into! Feel free to open a new issue :) https://github.com/mapbox/mapboxgl-jupyter/issues/

from mapboxgl-jupyter.

kevalshah90 avatar kevalshah90 commented on July 22, 2024

from mapboxgl-jupyter.

akacarlyann avatar akacarlyann commented on July 22, 2024

@kevalshah90 ah yes, the maki icons was the direction we decided to go, instead of that old PR I linked. I haven't gotten around to it yet, but glad to hear there's another vote for that feature.

For changing the marker radius, if you are using the CircleViz type, (https://mapbox-mapboxgl-jupyter.readthedocs-hosted.com/en/latest/viz.html#class-circleviz) then you can set the radius as an argument. Here's an example:

viz = CircleViz(data,
                radius=5,
                access_token=token)
viz.show()

Hope that helps!

from mapboxgl-jupyter.

kevalshah90 avatar kevalshah90 commented on July 22, 2024

from mapboxgl-jupyter.

akacarlyann avatar akacarlyann commented on July 22, 2024

Glad to hear it! I think the answer to your question is yes. This repository just implements Python bindings to create visualizations embedded in a Jupyter notebook using Mapbox's JavaScript library. We are currently loading the Mapbox GL JS version 1.5.0 in our HTML template.

Thanks for reaching out! Hoping to revisit some more features on this project again soon :)

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.