|
|
|
@ -3670,12 +3670,13 @@
|
|
|
|
|
$$.api.show(id); |
|
|
|
|
} else { |
|
|
|
|
$$.api.toggle(id); |
|
|
|
|
$$.isTargetToShow(id) ? $$.api.focus(id) : $$.api.revert(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.on('mouseover', function (id) { |
|
|
|
|
$$.d3.select(this).classed(CLASS.legendItemFocused, true); |
|
|
|
|
if (!$$.transiting) { |
|
|
|
|
if (!$$.transiting && $$.isTargetToShow(id)) { |
|
|
|
|
$$.api.focus(id); |
|
|
|
|
} |
|
|
|
|
if (config.legend_item_onmouseover) { |
|
|
|
@ -4286,17 +4287,23 @@
|
|
|
|
|
return format ? format(value, ratio) : $$.defaultArcValueFormat(value, ratio); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
c3_chart_internal_fn.expandArc = function (targetIds, withoutFadeOut) { |
|
|
|
|
var $$ = this, targets, noneTargets; |
|
|
|
|
c3_chart_internal_fn.expandArc = function (targetIds) { |
|
|
|
|
var $$ = this, interval; |
|
|
|
|
|
|
|
|
|
targetIds = $$.mapToTargetIds(targetIds); |
|
|
|
|
// MEMO: avoid to cancel transition
|
|
|
|
|
if ($$.transiting) { |
|
|
|
|
interval = window.setInterval(function () { |
|
|
|
|
if (!$$.transiting) { |
|
|
|
|
window.clearInterval(interval); |
|
|
|
|
$$.expandArc(targetIds); |
|
|
|
|
} |
|
|
|
|
}, 10); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
targets = $$.svg.selectAll($$.selectorTargets(targetIds, '.' + CLASS.chartArc)), |
|
|
|
|
noneTargets = $$.svg.selectAll('.' + CLASS.arc).filter(function (data) { |
|
|
|
|
return targetIds.indexOf(data.data.id) < 0; |
|
|
|
|
}); |
|
|
|
|
targetIds = $$.mapToTargetIds(targetIds); |
|
|
|
|
|
|
|
|
|
targets.each(function (d) { |
|
|
|
|
$$.svg.selectAll($$.selectorTargets(targetIds, '.' + CLASS.chartArc)).each(function (d) { |
|
|
|
|
if (! $$.shouldExpand(d.data.id)) { return; } |
|
|
|
|
$$.d3.select(this).selectAll('path') |
|
|
|
|
.transition().duration(50) |
|
|
|
@ -4309,18 +4316,16 @@
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
if (!withoutFadeOut) { |
|
|
|
|
noneTargets.style("opacity", 0.3); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
c3_chart_internal_fn.unexpandArc = function (targetIds) { |
|
|
|
|
var $$ = this, targets; |
|
|
|
|
var $$ = this; |
|
|
|
|
|
|
|
|
|
if ($$.transiting) { return; } |
|
|
|
|
|
|
|
|
|
targetIds = $$.mapToTargetIds(targetIds); |
|
|
|
|
targets = $$.svg.selectAll($$.selectorTargets(targetIds, '.' + CLASS.chartArc)); |
|
|
|
|
|
|
|
|
|
targets.selectAll('path.' + CLASS.arc) |
|
|
|
|
$$.svg.selectAll($$.selectorTargets(targetIds, '.' + CLASS.chartArc)).selectAll('path') |
|
|
|
|
.transition().duration(50) |
|
|
|
|
.attr("d", $$.svgArc); |
|
|
|
|
$$.svg.selectAll('.' + CLASS.arc) |
|
|
|
@ -5369,7 +5374,7 @@
|
|
|
|
|
this.defocus(); |
|
|
|
|
candidates.classed(CLASS.focused, true).classed(CLASS.defocused, false); |
|
|
|
|
if ($$.hasArcType()) { |
|
|
|
|
$$.expandArc(targetIds, true); |
|
|
|
|
$$.expandArc(targetIds); |
|
|
|
|
} |
|
|
|
|
$$.toggleFocusLegend(targetIds, true); |
|
|
|
|
|
|
|
|
@ -5402,7 +5407,7 @@
|
|
|
|
|
var $$ = this.internal, candidates; |
|
|
|
|
|
|
|
|
|
targetIds = $$.mapToTargetIds(targetIds); |
|
|
|
|
candidates = $$.svg.selectAll($$.selectorTargets(targetIds.filter($$.isTargetToShow, $$))); |
|
|
|
|
candidates = $$.svg.selectAll($$.selectorTargets(targetIds)); // should be for all targets
|
|
|
|
|
|
|
|
|
|
candidates.classed(CLASS.focused, false).classed(CLASS.defocused, false); |
|
|
|
|
if ($$.hasArcType()) { |
|
|
|
@ -5426,9 +5431,7 @@
|
|
|
|
|
targets.transition() |
|
|
|
|
.style('opacity', 1, 'important') |
|
|
|
|
.call($$.endall, function () { |
|
|
|
|
targets.style('opacity', null).style('opacity', 1) |
|
|
|
|
.classed(CLASS.focused, false) |
|
|
|
|
.classed(CLASS.defocused, false); |
|
|
|
|
targets.style('opacity', null).style('opacity', 1); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
if (options.withLegend) { |
|
|
|
@ -5450,9 +5453,7 @@
|
|
|
|
|
targets.transition() |
|
|
|
|
.style('opacity', 0, 'important') |
|
|
|
|
.call($$.endall, function () { |
|
|
|
|
targets.style('opacity', null).style('opacity', 0) |
|
|
|
|
.classed(CLASS.focused, false) |
|
|
|
|
.classed(CLASS.defocused, false); |
|
|
|
|
targets.style('opacity', null).style('opacity', 0); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
if (options.withLegend) { |
|
|
|
|