Browse Source

Fix bug for zoom.rescale - #738

pull/742/head
Masayuki Tanaka 10 years ago
parent
commit
de50260043
  1. 11
      c3.js
  2. 4
      c3.min.js
  3. 5
      src/core.js
  4. 3
      src/subchart.js
  5. 3
      src/zoom.js

11
c3.js

@ -427,7 +427,7 @@
c3_chart_internal_fn.redraw = function (options, transitions) {
var $$ = this, main = $$.main, d3 = $$.d3, config = $$.config;
var areaIndices = $$.getShapeIndices($$.isAreaType), barIndices = $$.getShapeIndices($$.isBarType), lineIndices = $$.getShapeIndices($$.isLineType);
var withY, withSubchart, withTransition, withTransitionForExit, withTransitionForAxis, withTransform, withUpdateXDomain, withUpdateOrgXDomain, withTrimXDomain, withLegend, withEventRect;
var withY, withSubchart, withTransition, withTransitionForExit, withTransitionForAxis, withTransform, withUpdateXDomain, withUpdateOrgXDomain, withTrimXDomain, withLegend, withEventRect, withDimension;
var hideAxis = $$.hasArcType();
var drawArea, drawBar, drawLine, xForText, yForText;
var duration, durationForExit, durationForAxis;
@ -445,6 +445,7 @@
withTrimXDomain = getOption(options, "withTrimXDomain", true);
withLegend = getOption(options, "withLegend", false);
withEventRect = getOption(options, "withEventRect", true);
withDimension = getOption(options, "withDimension", true);
withTransitionForExit = getOption(options, "withTransitionForExit", withTransition);
withTransitionForAxis = getOption(options, "withTransitionForAxis", withTransition);
@ -457,7 +458,7 @@
// update legend and transform each g
if (withLegend && config.legend_show) {
$$.updateLegend($$.mapToIds($$.data.targets), options, transitions);
} else if ((!config.axis_rotated && withY) || (config.axis_rotated && withUpdateXDomain)) {
} else if (withDimension) {
// need to update dimension (e.g. axis.y.tick.values) because y tick values should change
// no need to update axis in it because they will be updated in redraw()
$$.updateDimension(true);
@ -5192,7 +5193,8 @@
withTransition: false,
withY: $$.config.zoom_rescale,
withSubchart: false,
withUpdateXDomain: true
withUpdateXDomain: true,
withDimension: false
});
$$.config.subchart_onbrush.call($$.api, x.orgDomain());
};
@ -5277,7 +5279,8 @@
withTransition: false,
withY: config.zoom_rescale,
withSubchart: false,
withEventRect: false
withEventRect: false,
withDimension: false
});
if (d3.event.sourceEvent.type === 'mousemove') {
$$.cancelClick = true;

4
c3.min.js vendored

File diff suppressed because one or more lines are too long

5
src/core.js

@ -422,7 +422,7 @@ c3_chart_internal_fn.updateTargets = function (targets) {
c3_chart_internal_fn.redraw = function (options, transitions) {
var $$ = this, main = $$.main, d3 = $$.d3, config = $$.config;
var areaIndices = $$.getShapeIndices($$.isAreaType), barIndices = $$.getShapeIndices($$.isBarType), lineIndices = $$.getShapeIndices($$.isLineType);
var withY, withSubchart, withTransition, withTransitionForExit, withTransitionForAxis, withTransform, withUpdateXDomain, withUpdateOrgXDomain, withTrimXDomain, withLegend, withEventRect;
var withY, withSubchart, withTransition, withTransitionForExit, withTransitionForAxis, withTransform, withUpdateXDomain, withUpdateOrgXDomain, withTrimXDomain, withLegend, withEventRect, withDimension;
var hideAxis = $$.hasArcType();
var drawArea, drawBar, drawLine, xForText, yForText;
var duration, durationForExit, durationForAxis;
@ -440,6 +440,7 @@ c3_chart_internal_fn.redraw = function (options, transitions) {
withTrimXDomain = getOption(options, "withTrimXDomain", true);
withLegend = getOption(options, "withLegend", false);
withEventRect = getOption(options, "withEventRect", true);
withDimension = getOption(options, "withDimension", true);
withTransitionForExit = getOption(options, "withTransitionForExit", withTransition);
withTransitionForAxis = getOption(options, "withTransitionForAxis", withTransition);
@ -452,7 +453,7 @@ c3_chart_internal_fn.redraw = function (options, transitions) {
// update legend and transform each g
if (withLegend && config.legend_show) {
$$.updateLegend($$.mapToIds($$.data.targets), options, transitions);
} else if ((!config.axis_rotated && withY) || (config.axis_rotated && withUpdateXDomain)) {
} else if (withDimension) {
// need to update dimension (e.g. axis.y.tick.values) because y tick values should change
// no need to update axis in it because they will be updated in redraw()
$$.updateDimension(true);

3
src/subchart.js

@ -166,7 +166,8 @@ c3_chart_internal_fn.redrawForBrush = function () {
withTransition: false,
withY: $$.config.zoom_rescale,
withSubchart: false,
withUpdateXDomain: true
withUpdateXDomain: true,
withDimension: false
});
$$.config.subchart_onbrush.call($$.api, x.orgDomain());
};

3
src/zoom.js

@ -59,7 +59,8 @@ c3_chart_internal_fn.redrawForZoom = function () {
withTransition: false,
withY: config.zoom_rescale,
withSubchart: false,
withEventRect: false
withEventRect: false,
withDimension: false
});
if (d3.event.sourceEvent.type === 'mousemove') {
$$.cancelClick = true;

Loading…
Cancel
Save