{"action":"created","issue":{"url":"https://api.github.com/repos/altair-viz/altair/issues/533","repository_url":"https://api.github.com/repos/altair-viz/altair","labels_url":"https://api.github.com/repos/altair-viz/altair/issues/533/labels{/name}","comments_url":"https://api.github.com/repos/altair-viz/altair/issues/533/comments","events_url":"https://api.github.com/repos/altair-viz/altair/issues/533/events","html_url":"https://github.com/altair-viz/altair/pull/533","id":301101014,"number":533,"title":"ENH: add RepeatChart & example","user":{"login":"jakevdp","id":781659,"avatar_url":"https://avatars0.githubusercontent.com/u/781659?v=4","gravatar_id":"","url":"https://api.github.com/users/jakevdp","html_url":"https://github.com/jakevdp","followers_url":"https://api.github.com/users/jakevdp/followers","following_url":"https://api.github.com/users/jakevdp/following{/other_user}","gists_url":"https://api.github.com/users/jakevdp/gists{/gist_id}","starred_url":"https://api.github.com/users/jakevdp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakevdp/subscriptions","organizations_url":"https://api.github.com/users/jakevdp/orgs","repos_url":"https://api.github.com/users/jakevdp/repos","events_url":"https://api.github.com/users/jakevdp/events{/privacy}","received_events_url":"https://api.github.com/users/jakevdp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-02-28T16:53:41Z","updated_at":"2018-02-28T20:46:59Z","closed_at":null,"author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/altair-viz/altair/pulls/533","html_url":"https://github.com/altair-viz/altair/pull/533","diff_url":"https://github.com/altair-viz/altair/pull/533.diff","patch_url":"https://github.com/altair-viz/altair/pull/533.patch"},"body":"This PR adds a ``RepeatChart`` which allows repeated specs. For example:\r\n\r\n```python\r\nimport altair as alt\r\nfrom vega_datasets import data\r\n\r\nchart = alt.Chart(data.cars.url).mark_circle().encode(\r\n    alt.X(alt.repeat_column(), type='quantitative'),\r\n    alt.Y(alt.repeat_row(), type='quantitative'),\r\n    color='Origin:N'\r\n).properties(\r\n    width=250,\r\n    height=250\r\n).interactive()\r\n\r\nalt.RepeatChart(chart).set_repeat(\r\n    row=['Horsepower', 'Acceleration', 'Miles_per_Gallon'],\r\n    column=['Miles_per_Gallon', 'Acceleration', 'Horsepower']\r\n)\r\n```\r\n![vega 1](https://user-images.githubusercontent.com/781659/36800495-89418f04-1c64-11e8-8c37-5c812ce6e973.png)\r\n\r\nIf you run this example live, you'll see that panning and zooming are linked across plots.\r\n\r\nI'd initially thought we'd leave the repeat chart out of the top-level API, and instead focus on using Python-side loops to construct these kinds of specs. But in trying to duplicate some of the vega-lite examples, that proved to be very clunky.\r\n\r\nI think the API I proposed here is still a bit awkward, and I'd be happy to hear any thoughts on how it might be improved cc/ @kanitw @domoritz @ellisonbg\r\n"},"comment":{"url":"https://api.github.com/repos/altair-viz/altair/issues/comments/369377156","html_url":"https://github.com/altair-viz/altair/pull/533#issuecomment-369377156","issue_url":"https://api.github.com/repos/altair-viz/altair/issues/533","id":369377156,"user":{"login":"jakevdp","id":781659,"avatar_url":"https://avatars0.githubusercontent.com/u/781659?v=4","gravatar_id":"","url":"https://api.github.com/users/jakevdp","html_url":"https://github.com/jakevdp","followers_url":"https://api.github.com/users/jakevdp/followers","following_url":"https://api.github.com/users/jakevdp/following{/other_user}","gists_url":"https://api.github.com/users/jakevdp/gists{/gist_id}","starred_url":"https://api.github.com/users/jakevdp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakevdp/subscriptions","organizations_url":"https://api.github.com/users/jakevdp/orgs","repos_url":"https://api.github.com/users/jakevdp/repos","events_url":"https://api.github.com/users/jakevdp/events{/privacy}","received_events_url":"https://api.github.com/users/jakevdp/received_events","type":"User","site_admin":false},"created_at":"2018-02-28T20:46:59Z","updated_at":"2018-02-28T20:46:59Z","author_association":"OWNER","body":">What about\r\n```\r\nchart.repeat(\r\n    row=['Horsepower', 'Acceleration', 'Miles_per_Gallon'],\r\n    column=['Miles_per_Gallon', 'Acceleration', 'Horsepower']\r\n)\r\n```\r\n\r\nI like this a lot... let me modify the PR and see how this looks (and then we can compare to the python iteration approach)"}}
{"actor":{"display_login":"jakevdp"}}