aboutsummaryrefslogtreecommitdiffstats
path: root/web/nms.gathering.org/speedometer/c3-master/src/api.show.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/nms.gathering.org/speedometer/c3-master/src/api.show.js')
-rw-r--r--web/nms.gathering.org/speedometer/c3-master/src/api.show.js50
1 files changed, 50 insertions, 0 deletions
diff --git a/web/nms.gathering.org/speedometer/c3-master/src/api.show.js b/web/nms.gathering.org/speedometer/c3-master/src/api.show.js
new file mode 100644
index 0000000..08e99e1
--- /dev/null
+++ b/web/nms.gathering.org/speedometer/c3-master/src/api.show.js
@@ -0,0 +1,50 @@
+c3_chart_fn.show = function (targetIds, options) {
+ var $$ = this.internal, targets;
+
+ targetIds = $$.mapToTargetIds(targetIds);
+ options = options || {};
+
+ $$.removeHiddenTargetIds(targetIds);
+ targets = $$.svg.selectAll($$.selectorTargets(targetIds));
+
+ targets.transition()
+ .style('opacity', 1, 'important')
+ .call($$.endall, function () {
+ targets.style('opacity', null).style('opacity', 1);
+ });
+
+ if (options.withLegend) {
+ $$.showLegend(targetIds);
+ }
+
+ $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true});
+};
+
+c3_chart_fn.hide = function (targetIds, options) {
+ var $$ = this.internal, targets;
+
+ targetIds = $$.mapToTargetIds(targetIds);
+ options = options || {};
+
+ $$.addHiddenTargetIds(targetIds);
+ targets = $$.svg.selectAll($$.selectorTargets(targetIds));
+
+ targets.transition()
+ .style('opacity', 0, 'important')
+ .call($$.endall, function () {
+ targets.style('opacity', null).style('opacity', 0);
+ });
+
+ if (options.withLegend) {
+ $$.hideLegend(targetIds);
+ }
+
+ $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true});
+};
+
+c3_chart_fn.toggle = function (targetIds, options) {
+ var that = this, $$ = this.internal;
+ $$.mapToTargetIds(targetIds).forEach(function (targetId) {
+ $$.isTargetToShow(targetId) ? that.hide(targetId, options) : that.show(targetId, options);
+ });
+};