mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-26 03:58:45 +02:00
N°5621 Move C3 0.4.11 to NPM
This commit is contained in:
54
node_modules/c3/src/api.zoom.js
generated
vendored
Normal file
54
node_modules/c3/src/api.zoom.js
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
c3_chart_fn.zoom = function (domain) {
|
||||
var $$ = this.internal;
|
||||
if (domain) {
|
||||
if ($$.isTimeSeries()) {
|
||||
domain = domain.map(function (x) { return $$.parseDate(x); });
|
||||
}
|
||||
$$.brush.extent(domain);
|
||||
$$.redraw({withUpdateXDomain: true, withY: $$.config.zoom_rescale});
|
||||
$$.config.zoom_onzoom.call(this, $$.x.orgDomain());
|
||||
}
|
||||
return $$.brush.extent();
|
||||
};
|
||||
c3_chart_fn.zoom.enable = function (enabled) {
|
||||
var $$ = this.internal;
|
||||
$$.config.zoom_enabled = enabled;
|
||||
$$.updateAndRedraw();
|
||||
};
|
||||
c3_chart_fn.unzoom = function () {
|
||||
var $$ = this.internal;
|
||||
$$.brush.clear().update();
|
||||
$$.redraw({withUpdateXDomain: true});
|
||||
};
|
||||
|
||||
c3_chart_fn.zoom.max = function (max) {
|
||||
var $$ = this.internal, config = $$.config, d3 = $$.d3;
|
||||
if (max === 0 || max) {
|
||||
config.zoom_x_max = d3.max([$$.orgXDomain[1], max]);
|
||||
}
|
||||
else {
|
||||
return config.zoom_x_max;
|
||||
}
|
||||
};
|
||||
|
||||
c3_chart_fn.zoom.min = function (min) {
|
||||
var $$ = this.internal, config = $$.config, d3 = $$.d3;
|
||||
if (min === 0 || min) {
|
||||
config.zoom_x_min = d3.min([$$.orgXDomain[0], min]);
|
||||
}
|
||||
else {
|
||||
return config.zoom_x_min;
|
||||
}
|
||||
};
|
||||
|
||||
c3_chart_fn.zoom.range = function (range) {
|
||||
if (arguments.length) {
|
||||
if (isDefined(range.max)) { this.domain.max(range.max); }
|
||||
if (isDefined(range.min)) { this.domain.min(range.min); }
|
||||
} else {
|
||||
return {
|
||||
max: this.domain.max(),
|
||||
min: this.domain.min()
|
||||
};
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user