UNPKG

zz-chart

Version:

Alauda Chart components by Alauda Frontend Team

48 lines 1.17 kB
import { get } from 'lodash-es'; export class Coordinate { constructor(ctrl) { this.name = 'coordinate'; this.isTransposed = false; this.ctrl = ctrl; this.render(); } render() { // .. this.setOption(); } update() { // .. this.setOption(); } setOption() { this.option = get(this.ctrl.getOption(), this.name); if (this.option) { this.isTransposed = this.option?.transposed; } } transpose() { this.isTransposed = true; } getOptions() { const option = get(this.ctrl.getOption(), this.name); if (typeof option === 'object' && option.transposed) { this.isTransposed = option.transposed; } return this.isTransposed ? { scales: { y: { ori: 0, }, }, axes: [ {}, { side: 2, }, ], } : {}; } } //# sourceMappingURL=coordinate.js.map