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 for zoom + data driven functions #16

Merged
merged 2 commits into from
Apr 19, 2016
Merged

support for zoom + data driven functions #16

merged 2 commits into from
Apr 19, 2016

Conversation

ansis
Copy link
Contributor

@ansis ansis commented Apr 16, 2016

👀 @lucaswoj


} else {
var property = parameters.property === undefined ? '$zoom' : parameters.property;
var zoomAndDataDependent = typeof parameters.stops[0][0] === 'object';
var dataDependent = zoomAndDataDependent || parameters.property !== undefined;
Copy link

@lucaswoj lucaswoj Apr 18, 2016

Choose a reason for hiding this comment

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

What we've been referring to as "data-driven functions" I think we should rebrand as "property functions" or "feature functions" or "feature property functions" before shipping. "Data-driven" is a more ambiguous name that potentially encompasses a larger suite of features including "feature property functions"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. Will this also apply to how we talk about these things externally? Which do you prefer?

Choose a reason for hiding this comment

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

I'm ok with talking about data-driven styling in general. This specific feature, however, I have been and will continue to refer to as "property functions."

We support "property functions", "zoom functions", and "property-and-zoom functions" all of which can be referred to as "functions."

Choose a reason for hiding this comment

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

I'm not necessarily preferring "property functions" over "feature functions", that's just the terminology I've been test-driving lately.

I've realized more recently that the isPaintValueFeatureConstant and isPaintValueZoomConstant would segue more nicely into the "feature functions" naming scheme.

@@ -258,7 +256,7 @@ test('isConstant', function(t) {
property: 'mapbox'
});

t.notOk(f.isGlobalConstant);
t.ok(f.isZoomConstant);
t.notOk(f.isFeatureConstant);

t.end();

Choose a reason for hiding this comment

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

Would it be possible to add unit tests for "zoom and feature" functions?

@ansis
Copy link
Contributor Author

ansis commented Apr 19, 2016

@lucaswoj can you 👀 the changes and tests in 1adb9b3 ?

@lucaswoj
Copy link

Looks good! 🚢

@ansis ansis merged commit 08bcfb8 into master Apr 19, 2016
@ansis ansis deleted the zoom-and-data branch April 19, 2016 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants