cal-heatmap
cal-heatmap copied to clipboard
When I jumpTo and highlight afterwards i sometime get some error
If i use jumpTo function to change the domain and the highlight function afterwards to highlight then new date
$MONTH_CALENDAR.jumpTo(newDate);
$MONTH_CALENDAR.highlight(newDate);
i sometime get an error: Uncaught TypeError: Cannot read property 'length' of undefined;
Uncaught TypeError: Cannot read property 'length' of undefined d3.js:763
bind d3.js:763
d3_selectionPrototype.data d3.js:818
CalHeatMap.fill cal-heatmap.js:1354
CalHeatMap.highlight cal-heatmap.js:2825
setDayOnMonthCalendar hours_add.js:163
(anonymous function) hours_add.js:319
jQuery.event.dispatch jquery-1.10.0.js:5107
elemData.handle
The error shows in the d3 library because wrong data is passed, I presume, and group is undefined:
function bind(group, groupData) {
var i, n = group.length,
Care to share a sample of the data in order to reproduce this issue ?
Sorry, I actually migrated my calendar to standard Jquery.
I remember the data was one month of hours logs. So i would have timestamps for each day of the month and totals (2 decimal entries) for that day. E.g.: { timestamp(01-11-2014) : 8.00, timestamp(02-11-2014): 7.50, ...... timestamp(30-11-2014):7.80}
I realize this is not much help. I guess you can close the issue if you can not reproduce the error and somebody will report it if it appears again.
I also got such issue, and I think it may be reproduced by triggering something like
cal.update(data);
cal.options.data = data;
while previous domain change animation is still active. At least I was able to eliminate the issue by preventing the update during animation.
@Yurko-Fedoriv is right... this error occurs if an update is attempted while an animation is still in progress. I prevented it by wrapping the update in a timeout equal to the animationDuration
if a jumpTo
was necessary
Merged into v4