Browse Source

Fix null data in arc event listener

pull/1207/head
Masayuki Tanaka 10 years ago
parent
commit
fb51543383
  1. 16
      c3.js
  2. 2
      c3.min.js
  3. 16
      src/arc.js

16
c3.js

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

2
c3.min.js vendored

File diff suppressed because one or more lines are too long

16
src/arc.js

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

Loading…
Cancel
Save