d3-timeline
d3-timeline copied to clipboard
Is there a way to update the timeline?
Maybe this would be obvious if I knew anything about d3...
If there is a way to update the timeline, could you add it in the documentation?
Thanks!
Hi, the only way that I was success to update the timeline was in the next way:
function update(data) {
// re-init timeline
if (timelineElement) {
timelineElement.remove();
}
timelineElement = d3.select('#my-id').append('svg');
// add data
timelineElement.datum(data).call(timeline); // <- catch here
}
The re-init section is the only way that I found that will "update" the timeline without leave the old version of timeline behind new version.
But, as commented in this snippet, there is a catch.
I've got error in line 599: node(...).attr is not a function
after a few tests I was modified the code in the mention line to:
gParentItem.attr("height", height);
and the error was disappears.
So @kohesion, there is unofficial weird way to update. @denisemauldin any better solution?
need d3 timeline for angular 2 project help....
@hodbauer This is typically the way you would redraw the chart, yes. :)