-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Improve mapbox.style
description + use mapbox-gl v1.1.1
#4035
Conversation
This description is much clearer 👍 |
💃 from me |
More from @nicolaskruchten on slack: what does this line mean? https://github.com/plotly/plotly.js/blob/master/src/plots/mapbox/layout_attributes.js#L141 Is this line up to date wrt to would be good to clarify this line if it only applies when these will be addressed in this PR. |
Would be good to point out that this is only needed for certain values of |
The relationship between |
The attr for ... or something. that's basically a clearer description of the current behaviour and assumptions IMO. |
That's not exactly true, here's the logic: plotly.js/src/traces/choroplethmapbox/plot.js Lines 106 to 132 in 14133af
The default |
Based off this branch's latest commit here are some TODOs that will done on this branch:
done in b933528
done in b933528
|
This is already a big set of improvements, thank you very much :) One small adjustment to my initial proposal: the phrase |
... when trying to plot a mapbox subplot w/o a Mapbox access token and w/o setting a Mapbox-served style as opposed to simply throwing a "missing token" msg. Also, rename constants.styles -> constants.stylesNonMapbox
@plotly/plotly_js @nicolaskruchten this PR is now Note that I merged master (with @antoinerg 's attributions and non-mapbox styles work) and I bumped |
mapbox.style
descriptionmapbox.style
description + use mapbox-gl v1.1.1
@@ -117,7 +137,7 @@ var attrs = module.exports = overrideAll({ | |||
'Sets the source data for this layer (mapbox.layer.source).', | |||
'Source can be either a URL,', | |||
'a geojson object (with `sourcetype` set to *geojson*)', | |||
'or an array of tile URLS (with `sourcetype` set to *vector*).' | |||
'or an array of URLs (with `sourcetype` set to *vector* or *raster*).' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does sourcetype
have to be if source
is a URL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And actually I would leave the word "tile" in there, as it's not super clear what the URL should point to otherwise. We should try to say what the non-array URL should point to also: an image? a GeoJSON file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now this is:
plotly.js/src/plots/mapbox/layout_attributes.js
Lines 137 to 142 in 29c2bf9
'Sets the source data for this layer (mapbox.layer.source).', | |
'When `sourcetype` is set to *geojson*, `source` can be a URL to a GeoJSON', | |
'or a GeoJSON object.', | |
'When `sourcetype` is set to *vector* or *raster*, `source` can be a URL or', | |
'an array of tile URLs.', | |
'When `sourcetype` is set to *image*, `source` can be a URL to an image.' |
'With `sourcetype` set to *geojson*, *circle*, *line*, *fill* and *symbol* are available', | ||
'but note that *line* and *fill* are not compatible with Point', | ||
'GeoJSON geometries.', | ||
'With `sourcetype` set to *vector*, *circle*, *line*, *fill* and *symbol* are available.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'With `sourcetype` set to *vector*, *circle*, *line*, *fill* and *symbol* are available.', | |
'With `sourcetype` set to *vector*, the following values are allowed: *circle*, *line*, *fill* and *symbol*.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now this is:
plotly.js/src/plots/mapbox/layout_attributes.js
Lines 170 to 178 in 29c2bf9
'Sets the layer type,', | |
'that is the how the layer data set in `source` will be rendered', | |
'With `sourcetype` set to *geojson*, the following values are allowed:', | |
'*circle*, *line*, *fill* and *symbol*.', | |
'but note that *line* and *fill* are not compatible with Point', | |
'GeoJSON geometries.', | |
'With `sourcetype` set to *vector*, the following values are allowed:', | |
' *circle*, *line*, *fill* and *symbol*.', | |
'With `sourcetype` set to *raster* or `*image*`, only the *raster* value is allowed.' |
💃 thanks very much, this is a huge step up in terms of users' ability to bootstrap their understanding of how to do things :) |
@plotly/plotly_js @nicolaskruchten