Comments (10)
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.
@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.
@nlehuby is this an issue you could submit a PR for?
from mapboxgl-jupyter.
This shipped in #59 !
from mapboxgl-jupyter.
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.
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.
from mapboxgl-jupyter.
@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.
from mapboxgl-jupyter.
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)
- Mapbox Jupyter doesn't render ChoroplethViz HOT 7
- New feature to edit colour legends title
- TemplateNotFound in conda environment HOT 7
- Coverage/Coveralls hangs indefinitely HOT 1
- Examples don't work as shown, due to Jupyter "Blocking request with no referer" HOT 5
- Support MapboxGL 'step' expression for color and height function types HOT 5
- Is there a way to hide the "token = os.getenv('MAPBOX_ACCESS_TOKEN')" HOT 5
- Will Mapbox add support for JupyterLab? HOT 6
- Please add interactive callback events to this widget.
- Adding search for map HOT 1
- Heat Map in time HOT 3
- Subplot support HOT 4
- How to hide the legends for GraduatedCircleViz? HOT 1
- Example displays base map but not points HOT 2
- any chance multiple viz can be combined in a single view? HOT 1
- viz.create_html() rounds lat/lng to 4 decimal places which drops accuracy to 11m
- How to hide null/Nan values on a CircleViz ? HOT 3
- Uncaught Error: An API access token is required to use Mapbox GL.
- Mapboxgl cannot be imported on Windows 10 after conda install
- mapbox doesn't render points on jupyter notebook running on Databricks. HOT 1
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 mapboxgl-jupyter.