{"action":"created","issue":{"url":"https://api.github.com/repos/esbullington/react-d3/issues/213","labels_url":"https://api.github.com/repos/esbullington/react-d3/issues/213/labels{/name}","comments_url":"https://api.github.com/repos/esbullington/react-d3/issues/213/comments","events_url":"https://api.github.com/repos/esbullington/react-d3/issues/213/events","html_url":"https://github.com/esbullington/react-d3/pull/213","id":76525858,"number":213,"title":"Added a ViewBoxMixin that lets charts configure their viewbox","user":{"login":"samdalton","id":327903,"avatar_url":"https://avatars.githubusercontent.com/u/327903?v=3","gravatar_id":"","url":"https://api.github.com/users/samdalton","html_url":"https://github.com/samdalton","followers_url":"https://api.github.com/users/samdalton/followers","following_url":"https://api.github.com/users/samdalton/following{/other_user}","gists_url":"https://api.github.com/users/samdalton/gists{/gist_id}","starred_url":"https://api.github.com/users/samdalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samdalton/subscriptions","organizations_url":"https://api.github.com/users/samdalton/orgs","repos_url":"https://api.github.com/users/samdalton/repos","events_url":"https://api.github.com/users/samdalton/events{/privacy}","received_events_url":"https://api.github.com/users/samdalton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-14T23:32:15Z","updated_at":"2015-05-28T17:44:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/esbullington/react-d3/pulls/213","html_url":"https://github.com/esbullington/react-d3/pull/213","diff_url":"https://github.com/esbullington/react-d3/pull/213.diff","patch_url":"https://github.com/esbullington/react-d3/pull/213.patch"},"body":"Following discussion on this issue here: https://github.com/esbullington/react-d3/issues/204 I implemented a proposed solution and show it working for the AreaChart. The remaining charts have yet to be updated. By using the `ViewBoxMixin` charts can accept a `viewBoxObject` prop that will let charts access outer chart dimensions as pixel values, and generate a string viewBox value that can be set on the svg element. See the AreaChart for an example. Comments/thoughts appreciated - this doesn't need to be merged in but is rather another starting point for the discussions that seemed to have stagnated a bit."},"comment":{"url":"https://api.github.com/repos/esbullington/react-d3/issues/comments/106520503","html_url":"https://github.com/esbullington/react-d3/pull/213#issuecomment-106520503","issue_url":"https://api.github.com/repos/esbullington/react-d3/issues/213","id":106520503,"user":{"login":"samdalton","id":327903,"avatar_url":"https://avatars.githubusercontent.com/u/327903?v=3","gravatar_id":"","url":"https://api.github.com/users/samdalton","html_url":"https://github.com/samdalton","followers_url":"https://api.github.com/users/samdalton/followers","following_url":"https://api.github.com/users/samdalton/following{/other_user}","gists_url":"https://api.github.com/users/samdalton/gists{/gist_id}","starred_url":"https://api.github.com/users/samdalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samdalton/subscriptions","organizations_url":"https://api.github.com/users/samdalton/orgs","repos_url":"https://api.github.com/users/samdalton/repos","events_url":"https://api.github.com/users/samdalton/events{/privacy}","received_events_url":"https://api.github.com/users/samdalton/received_events","type":"User","site_admin":false},"created_at":"2015-05-28T17:44:58Z","updated_at":"2015-05-28T17:44:58Z","body":"@yang-wei @esbullington I've updated this branch with the `LegendChart` updated to use a table cell layout to scale. I've updated the other relevant legend charts to fully support the ViewBoxMixin and did a bit of clean up on old width calculation logic that is no longer necessary. The docs are updated to show this and it seems to work pretty well!\r\n\r\nYou'll notice in the example I'm giving the chart a fixed height but a 100% width, this is to keep one dimension consistent, and scale it down on the y axis when resizing.\r\n\r\nPlease let me know if you have any comments/questions on this approach, but it essentially mirrors what we've got going in production with our fork."}}