@antv/g2
Version:
the Grammar of Graphics in Javascript
20 lines • 831 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.preprocessOption = void 0;
const flow_1 = require("../../utils/flow");
const style_1 = require("./style");
function preprocessOption(options) {
const convertedOptions = adapter(options);
// If there are children, recursively convert each child node.
if (convertedOptions.children && Array.isArray(convertedOptions.children)) {
convertedOptions.children = convertedOptions.children.map((child) => preprocessOption(child));
}
return convertedOptions;
}
exports.preprocessOption = preprocessOption;
// Entry point for all syntactic sugar functions.
function adapter(options) {
//@todo define a type for params of flow
return (0, flow_1.flow)(style_1.columnWidthRatio)(options);
}
//# sourceMappingURL=index.js.map
;