{"action":"opened","issue":{"url":"https://api.github.com/repos/dc-js/dc.js/issues/1196","repository_url":"https://api.github.com/repos/dc-js/dc.js","labels_url":"https://api.github.com/repos/dc-js/dc.js/issues/1196/labels{/name}","comments_url":"https://api.github.com/repos/dc-js/dc.js/issues/1196/comments","events_url":"https://api.github.com/repos/dc-js/dc.js/issues/1196/events","html_url":"https://github.com/dc-js/dc.js/issues/1196","id":172535526,"number":1196,"title":"geoChoropleth: Alter underlying topojson WITHOUT re-rendering","user":{"login":"aaronrudkin","id":14701267,"avatar_url":"https://avatars.githubusercontent.com/u/14701267?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronrudkin","html_url":"https://github.com/aaronrudkin","followers_url":"https://api.github.com/users/aaronrudkin/followers","following_url":"https://api.github.com/users/aaronrudkin/following{/other_user}","gists_url":"https://api.github.com/users/aaronrudkin/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronrudkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronrudkin/subscriptions","organizations_url":"https://api.github.com/users/aaronrudkin/orgs","repos_url":"https://api.github.com/users/aaronrudkin/repos","events_url":"https://api.github.com/users/aaronrudkin/events{/privacy}","received_events_url":"https://api.github.com/users/aaronrudkin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-22T19:36:00Z","updated_at":"2016-08-22T19:36:00Z","closed_at":null,"body":"I have a geoChoropleth of the US that shows a political party's control of a given state at a given time. One of the functions I have implemented is a smooth animation where the user can drag a bar through history to an arbitrary year and see how data changes or just press play and watch the advance of time. This looks great--I do it by switching crossfilter groups on the fly and redrawing the map. Smooth transitions, looks great, good performance. For areas of the continent that are not yet states, I simply grey them out so users have a visual cue as to why they are not present in the data.\r\n\r\nOne limitation of this is that, in point of fact, the actual shapes of states change a good deal during the course of history, beyond just joining and leaving the United States. The partitioning of Virginia is one good example, but actually many states started out having large swaths of mostly unoccupied land which were later carved away into territories and then finally admitted as new states later. As a result, my map is anachronistic up until Hawaii and Alaska join. This is an acceptable limitation for the project, but not an ideal one, so I'd like to fix it.\r\n\r\nI can get around this by dynamically loading a new json for each time period. It's not difficult:\r\n```javascript\r\nd3.json(\"/static/json/states\"+loadNum+\".json\", function(error, stateboundaries)\r\n        {\r\n                if(!error)\r\n                {\r\n                        var mapTopo = topojson.feature(stateboundaries, stateboundaries.objects.states).features;\r\n                        partyMapChart.overlayGeoJson(mapTopo, 'state', function(d) { return d.id; })\r\n                }\r\n        });\r\n```\r\n\r\nBut now, having substituted the data, I need to draw the new map. However, just running `partyMapChart.redraw()` will not actually update the underlying GeoJson overlay the way it would for a group switch. Instead, I need to force `partyMapChart.render()`. This is unfortunate, because it breaks the transition animations (suppose a state does not change, and should be coloured dark blue both before and after the switch: instead, we see a flash of white and another fade to dark blue). This creates  sort of strobe effect that is very unpleasant. Also, we use a custom legend overlay that we have hooked to a `postRender` listener, so the legend disappears and flashes in again. \r\n\r\nAny advice for the best way to do this? If not, I'd like to suggest the ability to update the json overlay without re-rendering as an enhancement.\r\n\r\nThe project is private and due to grant restrictions shouldn't be shared before it is ready, so I'd prefer not to give a working example, but if you have difficulty grasping the issue I'm running into I could try to come up with one. "}}
{"actor":{"display_login":"aaronrudkin"}}