patternfly-timeline
patternfly-timeline copied to clipboard
eventZoom recieves full dataset, not the d3 scale at the end of the zoom.
creating a timeline with eventZoom callback as:
var timelineChart = d3.chart.timeline()
.eventZoom(function (d,i) {console.log(d,i);});
d3.select('#timeline')
.datum(data)
.call(timelineChart);
when zooming, d parameter contains the full datum/data structure, not the d3 scale as stated in the doc.
(how to access to the scale's min+max ?)
did it this way:
var timeline = d3.chart.timeline()
.eventZoom(function (d,i) {
let scale = timeline.Zoom.scales.x.domain(),
startdate = scale[0].getTime(),
enddate = scale[1].getTime();
//...
})