|
|
@ -245,15 +245,18 @@ c3_chart_internal_fn.redrawArc = function (duration, durationForExit, withTransf |
|
|
|
mainArc.enter().append('path') |
|
|
|
mainArc.enter().append('path') |
|
|
|
.attr("class", $$.classArc.bind($$)) |
|
|
|
.attr("class", $$.classArc.bind($$)) |
|
|
|
.style("fill", function (d) { return $$.color(d.data); }) |
|
|
|
.style("fill", function (d) { return $$.color(d.data); }) |
|
|
|
.style("cursor", function (d) { return config.data_selection_isselectable(d) ? "pointer" : null; }) |
|
|
|
.style("cursor", function (d) { return config.interaction_enabled && config.data_selection_isselectable(d) ? "pointer" : null; }) |
|
|
|
.style("opacity", 0) |
|
|
|
.style("opacity", 0) |
|
|
|
.each(function (d) { |
|
|
|
.each(function (d) { |
|
|
|
if ($$.isGaugeType(d.data)) { |
|
|
|
if ($$.isGaugeType(d.data)) { |
|
|
|
d.startAngle = d.endAngle = -1 * (Math.PI / 2); |
|
|
|
d.startAngle = d.endAngle = -1 * (Math.PI / 2); |
|
|
|
} |
|
|
|
} |
|
|
|
this._current = d; |
|
|
|
this._current = d; |
|
|
|
}) |
|
|
|
}); |
|
|
|
.on('mouseover', function (d) { |
|
|
|
mainArc |
|
|
|
|
|
|
|
.attr("transform", function (d) { return !$$.isGaugeType(d.data) && withTransform ? "scale(0)" : ""; }) |
|
|
|
|
|
|
|
.style("opacity", function (d) { return d === this._current ? 0 : 1; }) |
|
|
|
|
|
|
|
.on('mouseover', config.interaction_enabled ? function (d) { |
|
|
|
var updated, arcData; |
|
|
|
var updated, arcData; |
|
|
|
if ($$.transiting) { // skip while transiting
|
|
|
|
if ($$.transiting) { // skip while transiting
|
|
|
|
return; |
|
|
|
return; |
|
|
@ -265,14 +268,14 @@ c3_chart_internal_fn.redrawArc = function (duration, durationForExit, withTransf |
|
|
|
$$.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) |
|
|
|
.on('mousemove', function (d) { |
|
|
|
.on('mousemove', config.interaction_enabled ? function (d) { |
|
|
|
var updated = $$.updateAngle(d), |
|
|
|
var updated = $$.updateAngle(d), |
|
|
|
arcData = $$.convertToArcData(updated), |
|
|
|
arcData = $$.convertToArcData(updated), |
|
|
|
selectedData = [arcData]; |
|
|
|
selectedData = [arcData]; |
|
|
|
$$.showTooltip(selectedData, d3.mouse(this)); |
|
|
|
$$.showTooltip(selectedData, d3.mouse(this)); |
|
|
|
}) |
|
|
|
} : null) |
|
|
|
.on('mouseout', function (d) { |
|
|
|
.on('mouseout', config.interaction_enabled ? function (d) { |
|
|
|
var updated, arcData; |
|
|
|
var updated, arcData; |
|
|
|
if ($$.transiting) { // skip while transiting
|
|
|
|
if ($$.transiting) { // skip while transiting
|
|
|
|
return; |
|
|
|
return; |
|
|
@ -285,16 +288,13 @@ c3_chart_internal_fn.redrawArc = function (duration, durationForExit, withTransf |
|
|
|
$$.revertLegend(); |
|
|
|
$$.revertLegend(); |
|
|
|
$$.hideTooltip(); |
|
|
|
$$.hideTooltip(); |
|
|
|
$$.config.data_onmouseout(arcData, this); |
|
|
|
$$.config.data_onmouseout(arcData, this); |
|
|
|
}) |
|
|
|
} : null) |
|
|
|
.on('click', function (d, i) { |
|
|
|
.on('click', config.interaction_enabled ? function (d, i) { |
|
|
|
var updated = $$.updateAngle(d), |
|
|
|
var updated = $$.updateAngle(d), |
|
|
|
arcData = $$.convertToArcData(updated); |
|
|
|
arcData = $$.convertToArcData(updated); |
|
|
|
if ($$.toggleShape) { $$.toggleShape(this, arcData, i); } |
|
|
|
if ($$.toggleShape) { $$.toggleShape(this, arcData, i); } |
|
|
|
$$.config.data_onclick.call($$.api, arcData, this); |
|
|
|
$$.config.data_onclick.call($$.api, arcData, this); |
|
|
|
}); |
|
|
|
} : null) |
|
|
|
mainArc |
|
|
|
|
|
|
|
.attr("transform", function (d) { return !$$.isGaugeType(d.data) && withTransform ? "scale(0)" : ""; }) |
|
|
|
|
|
|
|
.style("opacity", function (d) { return d === this._current ? 0 : 1; }) |
|
|
|
|
|
|
|
.each(function () { $$.transiting = true; }) |
|
|
|
.each(function () { $$.transiting = true; }) |
|
|
|
.transition().duration(duration) |
|
|
|
.transition().duration(duration) |
|
|
|
.attrTween("d", function (d) { |
|
|
|
.attrTween("d", function (d) { |
|
|
|