The zoom() getter now correctly returns current domain
@ -24,6 +24,14 @@ describe('c3 api zoom', function () {
};
});
it('should return the correct extent', function () {
var zoomDomain = chart.zoom(),
expectedDomain = chart.internal.x.domain();
expect(+zoomDomain[0]).toBe(+expectedDomain[0]);
expect(+zoomDomain[1]).toBe(+expectedDomain[1]);
it('should be zoomed properly', function () {
var target = [3, 5], domain;
chart.zoom(target);
@ -15,8 +15,10 @@ c3_chart_fn.zoom = function (domain) {
$$.redraw({withY: $$.config.zoom_rescale, withSubchart: false});
}
$$.config.zoom_onzoom.call(this, $$.x.orgDomain());
return domain;
} else {
return $$.x.domain();
c3_chart_fn.zoom.enable = function (enabled) {
var $$ = this.internal;