@chart-plugins/superset-indicator-chart
Version:
Indicator chart plugin for Apache Superset
11 lines • 637 B
JavaScript
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import { buildQueryContext } from '@superset-ui/core';
export default function buildQuery(formData) {
const {
metrics,
order_desc
} = formData;
return buildQueryContext(formData, baseQueryObject => [_extends({}, baseQueryObject, {
orderby: (metrics || []).map(metric => [metric, order_desc])
})]);
}