kibana-123
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
11 lines • 398 B
JavaScript
import _ from 'lodash';
// given an object or array of objects, return the value of the passed param
// if the param is missing, return undefined
export default function findByParam(values, param) {
if (_.isArray(values)) { // point series chart
let index = _.findIndex(values, param);
if (index === -1) return;
return values[index][param];
}
return values[param]; // pie chart
};