Browse Source

Avoid updating arc targets when it's not needed - #172

pull/888/head
Masayuki Tanaka 10 years ago
parent
commit
f29b97146c
  1. 6
      c3.js
  2. 4
      c3.min.js
  3. 1
      src/api.transform.js
  4. 5
      src/core.js

6
c3.js

@ -413,7 +413,10 @@
$$.updateTargetsForLine(targets); $$.updateTargetsForLine(targets);
//-- Arc --// //-- Arc --//
if ($$.updateTargetsForArc) { $$.updateTargetsForArc(targets); } if ($$.hasArcType() && $$.updateTargetsForArc) { $$.updateTargetsForArc(targets); }
/*-- Sub --*/
if ($$.updateTargetsForSubchart) { $$.updateTargetsForSubchart(targets); } if ($$.updateTargetsForSubchart) { $$.updateTargetsForSubchart(targets); }
/*-- Show --*/ /*-- Show --*/
@ -6238,6 +6241,7 @@
options.withTransitionForTransform = false; options.withTransitionForTransform = false;
$$.transiting = false; $$.transiting = false;
$$.setTargetType(targetIds, type); $$.setTargetType(targetIds, type);
$$.updateTargets($$.data.targets); // this is needed when transforming to arc
$$.updateAndRedraw(options); $$.updateAndRedraw(options);
}; };

4
c3.min.js vendored

File diff suppressed because one or more lines are too long

1
src/api.transform.js

@ -11,5 +11,6 @@ c3_chart_internal_fn.transformTo = function (targetIds, type, optionsForRedraw)
options.withTransitionForTransform = false; options.withTransitionForTransform = false;
$$.transiting = false; $$.transiting = false;
$$.setTargetType(targetIds, type); $$.setTargetType(targetIds, type);
$$.updateTargets($$.data.targets); // this is needed when transforming to arc
$$.updateAndRedraw(options); $$.updateAndRedraw(options);
}; };

5
src/core.js

@ -408,7 +408,10 @@ c3_chart_internal_fn.updateTargets = function (targets) {
$$.updateTargetsForLine(targets); $$.updateTargetsForLine(targets);
//-- Arc --// //-- Arc --//
if ($$.updateTargetsForArc) { $$.updateTargetsForArc(targets); } if ($$.hasArcType() && $$.updateTargetsForArc) { $$.updateTargetsForArc(targets); }
/*-- Sub --*/
if ($$.updateTargetsForSubchart) { $$.updateTargetsForSubchart(targets); } if ($$.updateTargetsForSubchart) { $$.updateTargetsForSubchart(targets); }
/*-- Show --*/ /*-- Show --*/

Loading…
Cancel
Save