UNPKG

@visactor/vchart

Version:

charts lib based @visactor/VGrammar

27 lines (21 loc) 885 B
import { Factory } from "./../core/factory"; import { GrammarMarkType } from "@visactor/vgrammar-core"; import { BaseMark } from "./base/base-mark"; export class ComponentMark extends BaseMark { constructor(name, option) { super(name, option), this.type = "component", this._componentType = option.componentType, this._mode = option.mode; } _initProduct(group) { const view = this.getVGrammarView(), id = this.getProductId(); this._product = view.mark(GrammarMarkType.component, null != group ? group : view.rootMark, { componentType: this._componentType, mode: this._mode }).id(id), this._compiledProductId = id; } } ComponentMark.type = "component"; export const registerComponentMark = () => { Factory.registerMark(ComponentMark.type, ComponentMark); }; //# sourceMappingURL=component.js.map