Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support linestring #92

Merged
merged 22 commits into from
Apr 26, 2018
Merged

Conversation

akacarlyann
Copy link
Collaborator

@akacarlyann akacarlyann commented Apr 15, 2018

Adds class for LinestringViz with geojson and vector data source support. Line color and width are data-driven styled. Addresses #4, #81.

Still working on:

  • legend refinement
  • default color/line width test (make sure consistent with latest CircleViz and ChoroplethViz)
  • bugfix for match-type color on vector linestring example
  • clean up example linestring-viz.ipynb

@akacarlyann akacarlyann mentioned this pull request Apr 15, 2018
@akacarlyann akacarlyann force-pushed the support-linestring branch 2 times, most recently from e34ce79 to 937eb1a Compare April 16, 2018 21:37
@akacarlyann
Copy link
Collaborator Author

@ryanbaumann Ready for you to take a first look.

Bug mentioned above is actually fixed with a refinement to the color_map function (when I wrote it I assumed match-type would entail non-numeric stops, given numeric color stops and color_function_type = 'match', color_map is interpolating rather than returning the default color). Fix would be adding an argument to color_map to override this behavior for 'match' color_function_type and numeric stops. I can open a separate PR for that -- thoughts?

@ryanbaumann
Copy link
Contributor

New PR for the bug fix on color_map @akacarlyann 👍 .

This is amazing. Taking a look now.

@ryanbaumann
Copy link
Contributor

Dropping an example here of what this looks like (Mount Diablo elevation contours styled by width and color based on elevation) from your example notebook @akacarlyann

@ryanbaumann ryanbaumann self-requested a review April 17, 2018 13:22
@ryanbaumann ryanbaumann added this to the 0.7.0 milestone Apr 17, 2018
@akacarlyann
Copy link
Collaborator Author

Perfect! I knew you'd have something in the wings for this.

@ryanbaumann
Copy link
Contributor

@akacarlyann will target a PR review tomorrow

Copy link
Contributor

@ryanbaumann ryanbaumann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just add the extra label style properties to match the other viz types @akacarlyann and all set!

"text-offset": [0,-1]
},
"paint": {
"text-halo-color": "white",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make text-color, halo-color, halo-width, and text-size adjustable to math other visuals labels. https://github.com/mapbox/mapboxgl-jupyter/blob/master/mapboxgl/templates/circle.html#L38

{% if labelProperty %}
"text-field": "{{ labelProperty }}",
{% endif %}
"text-size" : generateInterpolateExpression('zoom', [[0,8],[22,16]] ),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise in the vector linestring layer - add style modifiers for text-color, text-size, halo-color, halo-width

Copy link
Collaborator Author

@akacarlyann akacarlyann Apr 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ryanbaumann ! Added these in 3e9fac4. Looks like I'll need to update ChoroplethViz too in a separate issue.

@ryanbaumann
Copy link
Contributor

Nice @akacarlyann! Add the new lable style property options to the Markdown Docs, then 🚢 ! So excited to get this one into python dev's hands.

@akacarlyann
Copy link
Collaborator Author

@ryanbaumann Added LinestringViz to viz.md in 9bf8311.

@ryanbaumann ryanbaumann merged commit ea49a97 into mapbox:master Apr 26, 2018
@akacarlyann akacarlyann deleted the support-linestring branch December 2, 2019 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants