-
Notifications
You must be signed in to change notification settings - Fork 38
Conversation
], | ||
"values": { | ||
"map": { | ||
"doc": "When `symbol-placement` is set to `point`, produces icons whose x-axes are aligned east-west." |
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 about symbol-placement = line?
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.
Whoops, de06217.
], | ||
"values": { | ||
"map": { | ||
"doc": "When `symbol-placement` is set to `point`, produces glyphs whose x-axes are aligned east-west." |
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.
Ditto.
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.
], | ||
"values": { | ||
"==": { | ||
"doc": "The equal-to operator." |
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.
Let's pull in the descriptions from https://www.mapbox.com/mapbox-gl-style-spec/#types-filter for these.
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.
Do you mean literally, as in set inclusion: feature[key] ∈ {v0, ..., vn}
?
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.
How about db47134?
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.
Another option is to use English, for example:
A feature is included when the specified property is one of the specified values.
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.
I think the problem with just saying “equal-to operator” is that it isn’t clear that the left-hand side must be the property name and the right-hand side must be a property value. Even saying “left” and “right” could be confusing, though, given that the JSON representation is ["==", "key", "value"]
rather than ["key", "==", "value"]
.
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.
I think this is pretty clear in the context of GL styling, or if not, is very easily fixed (flip things, using the format key == value
).
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.
I disagree. Equality is the most straightforward of the operators, but for example describing has
as “the existence operator” doesn’t elucidate it for anyone who’s new to filters. How about something like this:
The inequality operator: <var>feature[key]</var> ≠ <var>value</var>.
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.
Yes, that's what I meant by "pull in the descriptions from https://www.mapbox.com/mapbox-gl-style-spec/#types-filter". I think it would also be good to set up the key
and value
variables as the existing documentation does:
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.
Trying this and testing downstream implications in 5848d76.
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.
Downstream isn't affected, since we handle filter operators manually in the SDKs. How do you feel about this @1ec5 @jfirebaugh?
"line": { | ||
"doc": "The label is placed along the line of the geometry." | ||
} | ||
}, | ||
"default": "point", | ||
"doc": "Label placement relative to its geometry. `line` can only be used on LineStrings and Polygons.", |
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.
Let’s move the second sentence to the line
documentation.
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.
"doc": "The text is aligned to the plane of the viewport." | ||
}, | ||
"auto": { | ||
"doc": "Set to the same value as `text-rotation-alignment`." |
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.
Automatically matches the value of
text-rotation-alignment
.
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.
"doc": "The bottom of the text is placed closest to the anchor." | ||
}, | ||
"top-left": { | ||
"doc": "The top left side of the text is placed closest to the anchor." |
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.
s/top left side/top-left corner/
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.
"doc": "The text is not altered." | ||
}, | ||
"uppercase": { | ||
"doc": "The text is uppercased." |
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.
Forces all letters to be displayed in uppercase.
This way there’s no ambiguity about capitalize
-style behavior.
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.
"default": "visible", | ||
"doc": "The display of this layer. `none` hides this layer.", | ||
"doc": "The display of this layer.", |
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.
Whether this layer is displayed.
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.
"doc": "Control whether the translation is relative to the map (north) or viewport (screen)", | ||
"values": { | ||
"map": { | ||
"doc": "The fill is translated relative to the map (north)." |
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 “north” mean here? Does it mean that a higher y value moves the fill’s origin to the north?
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.
"doc": "The fill is translated relative to the map (north)." | ||
}, | ||
"viewport": { | ||
"doc": "The fill is translated relative to the viewport (screen)." |
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 “screen” mean here? Does it mean that a higher y value moves the fill’s origin up? Or down? (I suppose specifying one or the other would be problematic for platform-specific documentation such as mapbox/mapbox-gl-native#6066, but that isn’t the style specification’s problem.)
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.
In order to shorten the descriptions, can we cut the "when set to {val}" part of all the descriptions? I don't think it's necessary. |
They're all supposed to read "When |
], | ||
"values": { | ||
"none": { | ||
"doc": "No scaling is performed." |
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.
"The icon is displayed at its intrinsic aspect ratio." (icon-size
can still scale it.)
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.
"none": { | ||
"doc": "No scaling is performed." | ||
}, | ||
"both": { |
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.
Make this the last property, so they are documented in a natural order.
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.
"doc": "Scaling is done in both x- and y-dimensions." | ||
}, | ||
"width": { | ||
"doc": "Scaling is done in the x-dimension to fit the text's dimensions." |
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.
"The icon is scaled in the x-dimension to fit the width of the text."
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.
], | ||
"values": { | ||
"map": { | ||
"doc": "When `symbol-placement` is set to `point`, produces glyphs whose x-axes are aligned east-west. When set to `line`, produces glyphs whose x-axes are aligned with the line." |
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.
produces glyphs whose x-axes are aligned east-west
"produces glyphs who x-axes" is unnecessarily techincal. This could benefit from plainer language.
Point: Aligns text east-west.
Line: Places text along corresponding line geometry.
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.
Point: Aligns text east-west.
👍
Line: Places text along corresponding line geometry.
There's an important nuance that this doesn't convey; it's the difference between:
╱
↗
╱
↗
╱
and
╱
→
╱
→
╱
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.
|
Oops, still need to hit doc generator etc. |
Doc generator grabbed in 674a1e1. Do we want to update the page layout now after this? Now we have: However, we don't yet capitalize on our new |
Yes, let's stick them in a |
Ok, ready for review again. Downstream work is happening in mapbox/mapbox-gl-native#6508 and is looking good as well. |
@1ec5 Mind re-reviewing and unblocking this? |
], | ||
"values": { | ||
"==": { | ||
"doc": "The equality operator." |
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.
Can we be any more specific? The equality operator ==, as most programmers know it, allows the left and right sides to be reversed. That isn't the case with any of these operators.
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.
Documentation for enum values landed in mapbox/mapbox-gl-style-spec#510. This updates Android, iOS, and macOS documentation code gen scripts to capitalize on them.
Affects a bunch of downstream stuff which is being documented in #497 proper.
Also removes color operations in 44da3a8 per chat with @samanpwbb since these were cut back in #308.
/cc @jfirebaugh @1ec5