This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Add layer predicate editor to macosapp#7553
Closed
1ec5 wants to merge 1 commit into
Closed
Conversation
|
@1ec5, thanks for your PR! By analyzing this pull request, we identified @boundsj, @friedbunny and @jfirebaugh to be potential reviewers. |
b729e30 to
ff0c583
Compare
Contributor
Author
|
This PR depends on some of the fixes in #7548. |
ff0c583 to
d11ead6
Compare
d11ead6 to
b764fa7
Compare
Contributor
|
Stale. |
Added a Layer Filter panel to the bottom of the macosapp document window that edits the selected layer’s predicate. Subclassed NSPredicateEditorRowTemplate to allow for arbitrary key paths in a single template and also to represent an aggregate value as a token field.
b764fa7 to
c3b1735
Compare
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
This pull request has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a Layer Filter panel to the bottom of the macosapp document window that edits the selected layer’s predicate. A standard NSPredicateEditor bound to the style layer array controller provides the draggable, nestable rule editing UI. A custom subclass of NSPredicateEditorRowTemplate allows for arbitrary key paths in a single template and also represents an aggregate value (for the “is one of” operator) as a token field. (NSPredicateEditorRowTemplate only supports simple values by default. An editable table view would’ve been better, but NSPredicateEditor assumes fixed-height rows.) The predicate editor has a standard row template for compound predicates and a custom row template for each major value type (string, integer, floating-point number, etc.). Edits to this UI take effect immediately.
As of writing, this editor is able to display predicates for the vast majority of layers in the Mapbox Streets style, and basic criteria can be edited without problems. Adding a criterion doesn’t quite work yet, and editing an “is one of” criterion often doesn’t round-trip correctly.
$typekey that uses a segmented control(For consistency with macOS and Apple applications, “filter” is the user-facing term, while “predicate” remains the API term to avoid confusion with other “filter” concepts.)
Depends on #7548.