{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-style-spec/issues/613","repository_url":"https://api.github.com/repos/mapbox/mapbox-gl-style-spec","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-style-spec/issues/613/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-style-spec/issues/613/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-style-spec/issues/613/events","html_url":"https://github.com/mapbox/mapbox-gl-style-spec/issues/613","id":192990141,"number":613,"title":"Rationalize and simplify the taxonomy of functions","user":{"login":"jfirebaugh","id":98601,"avatar_url":"https://avatars.githubusercontent.com/u/98601?v=3","gravatar_id":"","url":"https://api.github.com/users/jfirebaugh","html_url":"https://github.com/jfirebaugh","followers_url":"https://api.github.com/users/jfirebaugh/followers","following_url":"https://api.github.com/users/jfirebaugh/following{/other_user}","gists_url":"https://api.github.com/users/jfirebaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/jfirebaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfirebaugh/subscriptions","organizations_url":"https://api.github.com/users/jfirebaugh/orgs","repos_url":"https://api.github.com/users/jfirebaugh/repos","events_url":"https://api.github.com/users/jfirebaugh/events{/privacy}","received_events_url":"https://api.github.com/users/jfirebaugh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":17,"created_at":"2016-12-01T23:18:07Z","updated_at":"2016-12-02T20:00:38Z","closed_at":null,"body":"The space of function types is currently difficult to grok because there are effectively two axes of function types:\r\n\r\n* identity, exponential, interval, and categorical\r\n* zoom, property, zoom-and-property\r\n\r\nIt's not well documented or easy to grasp how these two axes combine, or what combinations are valid. I've tried to do so in #604, but this doesn't remove the underlying complexity from the domain model.\r\n\r\n**I believe that in order for users to use functions effectively, we need to rationalize and simplify our taxonomy.**\r\n\r\nHere's what I propose:\r\n\r\n1. A single `type` axis and property for functions, with the following values:\r\n   * `continuous` -- a function in which stop domain values represent sample points in a continuous domain\r\n   * `discrete` -- a function in which stop domain values enumerate a discrete domain\r\n   * `identity` -- the identity function\r\n   * `composite` -- the type formerly known as \"zoom-and-property\"\r\n1. The `type` property is always required and never deduced from other property values. Implementations and user interfaces can always look at this value and then decide what to do; they never have to implement a type-deduction algorithm, which would need to be synchronized between implementations and updated as new rules are introduced.\r\n1. A `property` property is optional for `continuous` functions, and required for `discrete` and `identity` functions (see below for `composite` functions). If present, the function is said to be a \"data-driven function\". If absent, the function is said to be a \"zoom-driven function\".\r\n1. A `continuous` or `composite` function supports the following properties:\r\n   * `interpolation` -- possible values are `\"exponential\"` (default for \"interpolated\" properties; allowed only for interpolated properties) and `\"step-after\"` (default for \"piecewise-constant\" properties; replaces the previous `interval` function type).\r\n   * `interpolation-base` -- renamed from `base`. Permitted only with `\"interpolation\": \"exponential\"`.\r\n   * `interpolation-color-space` -- renamed from `colorSpace`. Permitted only only with `\"interpolation\": \"exponential\"` and when the range type is `color`.\r\n1. Stop domain values for `composite` functions are floating point zoom level values. Stop range values for `composite` functions are functions, with types limited to `continuous` and `discrete`.\r\n   * However all such \"inner\" functions must share the same `type`, `property`, and `interpolation-*` properties. The `property` value is always required.\r\n   * The \"outer\" composite function may have `interpolation-*` properties that differ from the inner functions.\r\n   * Ideally we would enforce these requirements via object structure somehow, but I'm not sure of the best way to do so.\r\n\r\nBecause this proposal involves numerous breaking changes, it would most likely have to involve introducing a new version of the style specification. I think that reducing the complexity of the function taxonomy would be worth a style version bump, even if we made no other breaking changes.\r\n\r\ncc @mapbox/gl @mapbox/appbox "},"comment":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-style-spec/issues/comments/264548545","html_url":"https://github.com/mapbox/mapbox-gl-style-spec/issues/613#issuecomment-264548545","issue_url":"https://api.github.com/repos/mapbox/mapbox-gl-style-spec/issues/613","id":264548545,"user":{"login":"lucaswoj","id":281306,"avatar_url":"https://avatars.githubusercontent.com/u/281306?v=3","gravatar_id":"","url":"https://api.github.com/users/lucaswoj","html_url":"https://github.com/lucaswoj","followers_url":"https://api.github.com/users/lucaswoj/followers","following_url":"https://api.github.com/users/lucaswoj/following{/other_user}","gists_url":"https://api.github.com/users/lucaswoj/gists{/gist_id}","starred_url":"https://api.github.com/users/lucaswoj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucaswoj/subscriptions","organizations_url":"https://api.github.com/users/lucaswoj/orgs","repos_url":"https://api.github.com/users/lucaswoj/repos","events_url":"https://api.github.com/users/lucaswoj/events{/privacy}","received_events_url":"https://api.github.com/users/lucaswoj/received_events","type":"User","site_admin":false},"created_at":"2016-12-02T20:00:38Z","updated_at":"2016-12-02T20:00:38Z","body":"> It isn't moot once we introduce default values for discrete functions. #480\r\n\r\nGood point. Could it make sense to have a `\"interpolation\": \"default-value\"` mode?\r\n\r\n> Depending our implementation, _invalid_ domain values may result in a different output values. The behaviour in this case could be controlled by the user via the `interpolation` parameter.\r\n"}}
{"actor":{"display_login":"lucaswoj"}}