{"action":"created","issue":{"url":"https://api.github.com/repos/vega/vega-lite-tooltip/issues/34","repository_url":"https://api.github.com/repos/vega/vega-lite-tooltip","labels_url":"https://api.github.com/repos/vega/vega-lite-tooltip/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/vega/vega-lite-tooltip/issues/34/comments","events_url":"https://api.github.com/repos/vega/vega-lite-tooltip/issues/34/events","html_url":"https://github.com/vega/vega-lite-tooltip/issues/34","id":147882017,"number":34,"title":"Underscore prefix","user":{"login":"ZeningQu","id":822034,"avatar_url":"https://avatars.githubusercontent.com/u/822034?v=3","gravatar_id":"","url":"https://api.github.com/users/ZeningQu","html_url":"https://github.com/ZeningQu","followers_url":"https://api.github.com/users/ZeningQu/followers","following_url":"https://api.github.com/users/ZeningQu/following{/other_user}","gists_url":"https://api.github.com/users/ZeningQu/gists{/gist_id}","starred_url":"https://api.github.com/users/ZeningQu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZeningQu/subscriptions","organizations_url":"https://api.github.com/users/ZeningQu/orgs","repos_url":"https://api.github.com/users/ZeningQu/repos","events_url":"https://api.github.com/users/ZeningQu/events{/privacy}","received_events_url":"https://api.github.com/users/ZeningQu/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/vega/vega-lite-tooltip/labels/%23-In%20Progress","name":"#-In Progress","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"ZeningQu","id":822034,"avatar_url":"https://avatars.githubusercontent.com/u/822034?v=3","gravatar_id":"","url":"https://api.github.com/users/ZeningQu","html_url":"https://github.com/ZeningQu","followers_url":"https://api.github.com/users/ZeningQu/followers","following_url":"https://api.github.com/users/ZeningQu/following{/other_user}","gists_url":"https://api.github.com/users/ZeningQu/gists{/gist_id}","starred_url":"https://api.github.com/users/ZeningQu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZeningQu/subscriptions","organizations_url":"https://api.github.com/users/ZeningQu/orgs","repos_url":"https://api.github.com/users/ZeningQu/repos","events_url":"https://api.github.com/users/ZeningQu/events{/privacy}","received_events_url":"https://api.github.com/users/ZeningQu/received_events","type":"User","site_admin":false},"milestone":null,"comments":17,"created_at":"2016-04-12T21:41:29Z","updated_at":"2016-04-13T18:03:15Z","closed_at":null,"body":"Generally we want the user to write a field name without any underscore prefixes in `options.fields` and `options.fieldConfigs`. Then the tooltip plugin supplements the field names with underscore prefixes derived from vlSpec. We want to supplement the user-provided field names in order to match the field names returned by `item.datum`.\r\n\r\nFor aggregated fields, user should provide field name (e.g. `'yield'`). Then tooltip supplements the field name with the aggregate operation (e.g. `'mean_yield'`). This should match the field names in `item.datum`.\r\n\r\nOne exception is the aggregate operation `count`, where the field name is `'*'`. In this case the supplemented field name should be `'count'` instead of `'count_*'`\r\n\r\nFor fields with `timeUnit`, user should provide the field name (e.g. `'date'`). Tooltip supplements the field name with the `timeUnit` (e.g. `'month_date'`).\r\n\r\nFor binned fields, user should provide field name (e.g. `'Acceleration'`). Tooltip supplements the field name with `'bin_'` (e.g. `'bin_Acceleration'`). In runtime the tooltip plugin calculates the range of the bin field (issue #29).\r\n\r\nIf user don't provide `options.fields`, tooltip supplements `options.fields` with all `fieldDefs` in the vlSpec, using the underscore prefixes described above. "},"comment":{"url":"https://api.github.com/repos/vega/vega-lite-tooltip/issues/comments/209571067","html_url":"https://github.com/vega/vega-lite-tooltip/issues/34#issuecomment-209571067","issue_url":"https://api.github.com/repos/vega/vega-lite-tooltip/issues/34","id":209571067,"user":{"login":"ZeningQu","id":822034,"avatar_url":"https://avatars.githubusercontent.com/u/822034?v=3","gravatar_id":"","url":"https://api.github.com/users/ZeningQu","html_url":"https://github.com/ZeningQu","followers_url":"https://api.github.com/users/ZeningQu/followers","following_url":"https://api.github.com/users/ZeningQu/following{/other_user}","gists_url":"https://api.github.com/users/ZeningQu/gists{/gist_id}","starred_url":"https://api.github.com/users/ZeningQu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZeningQu/subscriptions","organizations_url":"https://api.github.com/users/ZeningQu/orgs","repos_url":"https://api.github.com/users/ZeningQu/repos","events_url":"https://api.github.com/users/ZeningQu/events{/privacy}","received_events_url":"https://api.github.com/users/ZeningQu/received_events","type":"User","site_admin":false},"created_at":"2016-04-13T18:03:15Z","updated_at":"2016-04-13T18:03:15Z","body":"@kanitw I think I still prefer having `aggregate` as an array. Unlike Vega-Lite, which needs to actually perform the aggregation operation functions on fields, in tooltip I only need the names of the aggregations so that I can do name-matching. So it's easier to have all the aggregation functions in one place. It would be easier to tell whether a field name is valid in that way.\r\n\r\nAlso, when `showAllFields` is `false`, I will go through the list of `fields` to get the list of custom fields. If there are repeated fields in the list because of multiple aggregation functions I will have to combine them anyway. In general we only want to show one row per field in the tooltip, even if the field has multiple aggregations.\r\n\r\nWhat do you think?"}}