kibana-riya
Version:
Kibana is an open source (Apache Licensed), browser based analytics and search dashboard for Elasticsearch. Kibana is a snap to setup and start using. Kibana strives to be easy to get started with, while also being flexible and powerful, just like Elastic
16 lines (12 loc) • 396 B
JavaScript
import _ from 'lodash';
export default function RemoveZeroSlices() {
return function removeZeroSlices(slices) {
if (!slices.children) return slices;
slices = _.clone(slices);
slices.children = slices.children.reduce(function (children, child) {
if (child.size !== 0) { children.push(removeZeroSlices(child)); }
return children;
}, []);
return slices;
};
};