Browse Source

Fix #1052

Added check as function might return null
pull/1053/head
GermainBergeron 10 years ago
parent
commit
29178c1f63
  1. 20
      c3.js
  2. 2
      c3.min.js
  3. 20
      src/arc.js

20
c3.js

@ -4836,18 +4836,22 @@
return; return;
} }
updated = $$.updateAngle(d); updated = $$.updateAngle(d);
if (updated) {
arcData = $$.convertToArcData(updated); arcData = $$.convertToArcData(updated);
// transitions // transitions
$$.expandArc(updated.data.id); $$.expandArc(updated.data.id);
$$.api.focus(updated.data.id); $$.api.focus(updated.data.id);
$$.toggleFocusLegend(updated.data.id, true); $$.toggleFocusLegend(updated.data.id, true);
$$.config.data_onmouseover(arcData, this); $$.config.data_onmouseover(arcData, this);
}
} : null) } : null)
.on('mousemove', config.interaction_enabled ? function (d) { .on('mousemove', config.interaction_enabled ? function (d) {
var updated = $$.updateAngle(d), var updated = $$.updateAngle(d);
arcData = $$.convertToArcData(updated), if (updated) {
var arcData = $$.convertToArcData(updated),
selectedData = [arcData]; selectedData = [arcData];
$$.showTooltip(selectedData, this); $$.showTooltip(selectedData, this);
}
} : null) } : null)
.on('mouseout', config.interaction_enabled ? function (d) { .on('mouseout', config.interaction_enabled ? function (d) {
var updated, arcData; var updated, arcData;
@ -4855,6 +4859,7 @@
return; return;
} }
updated = $$.updateAngle(d); updated = $$.updateAngle(d);
if (updated) {
arcData = $$.convertToArcData(updated); arcData = $$.convertToArcData(updated);
// transitions // transitions
$$.unexpandArc(updated.data.id); $$.unexpandArc(updated.data.id);
@ -4862,12 +4867,17 @@
$$.revertLegend(); $$.revertLegend();
$$.hideTooltip(); $$.hideTooltip();
$$.config.data_onmouseout(arcData, this); $$.config.data_onmouseout(arcData, this);
}
} : null) } : null)
.on('click', config.interaction_enabled ? function (d, i) { .on('click', config.interaction_enabled ? function (d, i) {
var updated = $$.updateAngle(d), var updated = $$.updateAngle(d);
arcData = $$.convertToArcData(updated); if (updated) {
if ($$.toggleShape) { $$.toggleShape(this, arcData, i); } var arcData = $$.convertToArcData(updated);
if ($$.toggleShape) {
$$.toggleShape(this, arcData, i);
}
$$.config.data_onclick.call($$.api, arcData, this); $$.config.data_onclick.call($$.api, arcData, this);
}
} : null) } : null)
.each(function () { $$.transiting = true; }) .each(function () { $$.transiting = true; })
.transition().duration(duration) .transition().duration(duration)

2
c3.min.js vendored

File diff suppressed because one or more lines are too long

20
src/arc.js

@ -265,18 +265,22 @@ c3_chart_internal_fn.redrawArc = function (duration, durationForExit, withTransf
return; return;
} }
updated = $$.updateAngle(d); updated = $$.updateAngle(d);
if (updated) {
arcData = $$.convertToArcData(updated); arcData = $$.convertToArcData(updated);
// transitions // transitions
$$.expandArc(updated.data.id); $$.expandArc(updated.data.id);
$$.api.focus(updated.data.id); $$.api.focus(updated.data.id);
$$.toggleFocusLegend(updated.data.id, true); $$.toggleFocusLegend(updated.data.id, true);
$$.config.data_onmouseover(arcData, this); $$.config.data_onmouseover(arcData, this);
}
} : null) } : null)
.on('mousemove', config.interaction_enabled ? function (d) { .on('mousemove', config.interaction_enabled ? function (d) {
var updated = $$.updateAngle(d), var updated = $$.updateAngle(d);
arcData = $$.convertToArcData(updated), if (updated) {
var arcData = $$.convertToArcData(updated),
selectedData = [arcData]; selectedData = [arcData];
$$.showTooltip(selectedData, this); $$.showTooltip(selectedData, this);
}
} : null) } : null)
.on('mouseout', config.interaction_enabled ? function (d) { .on('mouseout', config.interaction_enabled ? function (d) {
var updated, arcData; var updated, arcData;
@ -284,6 +288,7 @@ c3_chart_internal_fn.redrawArc = function (duration, durationForExit, withTransf
return; return;
} }
updated = $$.updateAngle(d); updated = $$.updateAngle(d);
if (updated) {
arcData = $$.convertToArcData(updated); arcData = $$.convertToArcData(updated);
// transitions // transitions
$$.unexpandArc(updated.data.id); $$.unexpandArc(updated.data.id);
@ -291,12 +296,17 @@ c3_chart_internal_fn.redrawArc = function (duration, durationForExit, withTransf
$$.revertLegend(); $$.revertLegend();
$$.hideTooltip(); $$.hideTooltip();
$$.config.data_onmouseout(arcData, this); $$.config.data_onmouseout(arcData, this);
}
} : null) } : null)
.on('click', config.interaction_enabled ? function (d, i) { .on('click', config.interaction_enabled ? function (d, i) {
var updated = $$.updateAngle(d), var updated = $$.updateAngle(d);
arcData = $$.convertToArcData(updated); if (updated) {
if ($$.toggleShape) { $$.toggleShape(this, arcData, i); } var arcData = $$.convertToArcData(updated);
if ($$.toggleShape) {
$$.toggleShape(this, arcData, i);
}
$$.config.data_onclick.call($$.api, arcData, this); $$.config.data_onclick.call($$.api, arcData, this);
}
} : null) } : null)
.each(function () { $$.transiting = true; }) .each(function () { $$.transiting = true; })
.transition().duration(duration) .transition().duration(duration)

Loading…
Cancel
Save