{"action":"created","issue":{"url":"https://api.github.com/repos/dc-js/dc.js/issues/1457","repository_url":"https://api.github.com/repos/dc-js/dc.js","labels_url":"https://api.github.com/repos/dc-js/dc.js/issues/1457/labels{/name}","comments_url":"https://api.github.com/repos/dc-js/dc.js/issues/1457/comments","events_url":"https://api.github.com/repos/dc-js/dc.js/issues/1457/events","html_url":"https://github.com/dc-js/dc.js/issues/1457","id":334757351,"node_id":"MDU6SXNzdWUzMzQ3NTczNTE=","number":1457,"title":"dataTable should probably not use .top(), .bottom()","user":{"login":"vikkya","id":26187350,"node_id":"MDQ6VXNlcjI2MTg3MzUw","avatar_url":"https://avatars1.githubusercontent.com/u/26187350?v=4","gravatar_id":"","url":"https://api.github.com/users/vikkya","html_url":"https://github.com/vikkya","followers_url":"https://api.github.com/users/vikkya/followers","following_url":"https://api.github.com/users/vikkya/following{/other_user}","gists_url":"https://api.github.com/users/vikkya/gists{/gist_id}","starred_url":"https://api.github.com/users/vikkya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vikkya/subscriptions","organizations_url":"https://api.github.com/users/vikkya/orgs","repos_url":"https://api.github.com/users/vikkya/repos","events_url":"https://api.github.com/users/vikkya/events{/privacy}","received_events_url":"https://api.github.com/users/vikkya/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-06-22T06:08:24Z","updated_at":"2018-07-29T15:08:53Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\nI'm trying to implement data table(car model name and speed) and select menu (Day- monday and so).\r\nLink to the [demo site](http://dc-example.surge.sh/) \r\nmy json [data](https://api.myjson.com/bins/1150eq) \r\nhere is my code for data table \r\n```js\r\nvar car =  dc.dataTable('#car')\r\n                .dimension(carGrpdDim)\r\n                .group(function (d){ return 'Modal | Speed'})\r\n                .columns([function (d) { return d.key },  function (d) { return d.value.total }])\r\n                .sortBy(function (d) { return d.value.total })\r\n                .order(d3.descending)\r\n                .size(5)\r\n```\r\n\r\nselect menu code\r\n```js\r\nvar day = dc.selectMenu('#day')\r\n            .dimension(dayDim)\r\n            .group(dayGrp)\r\n            .controlsUseVisibility(true)\r\n                .promptText('Day');\r\n            day.title(function (d) {\r\n                return d.key;\r\n            });\r\n```\r\n\r\ni want to show only top 5 cars for the day. So i added `size(5)`  but I'm getting cars with speed 0. Though I have cars with speed greater than 0.\r\n\r\nThanks.\r\n![expected](https://user-images.githubusercontent.com/26187350/41760372-afbf3536-7610-11e8-8737-a9fcfd27eb7d.png)\r\n\r\n![reality](https://user-images.githubusercontent.com/26187350/41760381-beb34b22-7610-11e8-810b-72e697e2f176.png)\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dc-js/dc.js/issues/comments/408684114","html_url":"https://github.com/dc-js/dc.js/issues/1457#issuecomment-408684114","issue_url":"https://api.github.com/repos/dc-js/dc.js/issues/1457","id":408684114,"node_id":"MDEyOklzc3VlQ29tbWVudDQwODY4NDExNA==","user":{"login":"gordonwoodhull","id":1366709,"node_id":"MDQ6VXNlcjEzNjY3MDk=","avatar_url":"https://avatars2.githubusercontent.com/u/1366709?v=4","gravatar_id":"","url":"https://api.github.com/users/gordonwoodhull","html_url":"https://github.com/gordonwoodhull","followers_url":"https://api.github.com/users/gordonwoodhull/followers","following_url":"https://api.github.com/users/gordonwoodhull/following{/other_user}","gists_url":"https://api.github.com/users/gordonwoodhull/gists{/gist_id}","starred_url":"https://api.github.com/users/gordonwoodhull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gordonwoodhull/subscriptions","organizations_url":"https://api.github.com/users/gordonwoodhull/orgs","repos_url":"https://api.github.com/users/gordonwoodhull/repos","events_url":"https://api.github.com/users/gordonwoodhull/events{/privacy}","received_events_url":"https://api.github.com/users/gordonwoodhull/received_events","type":"User","site_admin":false},"created_at":"2018-07-29T15:08:53Z","updated_at":"2018-07-29T15:08:53Z","author_association":"CONTRIBUTOR","body":"Thanks @dahlbyk, that's a separate problem with using groups for the dimension parameter of the dataTable, covered in #1115. (I'm surprised these issues weren't linked already.)\r\n\r\nYour solution would help for that issue but not the one described above. As noted later in that issue, you'll get weird results with your solution if the size of the dimension is greater than `dataTable.size()`, namely you're still seeing the top N but sorted backward.\r\n\r\nAll of this has to do with the dataTable being used for a purpose it wasn't originally intended for. Which is great, and it's neat that there are always workarounds, but one wonders if this all couldn't be designed better. Personally I wonder why we don't just [use DataTables](\r\nhttps://dc-js.github.io/dc.datatables.js)."}}
{"actor":{"display_login":"gordonwoodhull"}}