UNPKG

@visactor/vmind

Version:

<div align="center"> <a href="https://github.com/VisActor#gh-light-mode-only" target="_blank"> <img alt="VisActor Logo" width="200" src="https://github.com/VisActor/.github/blob/main/profile/logo_500_200_light.svg"/> </a> <a href="https://githu

29 lines (24 loc) 1.08 kB
import { AtomName } from "../../types/atom"; import { BaseAtom } from "../base"; import { runOperactionsOfSpec } from "./utils"; import { Factory } from "../../core/factory"; export class VChartSpec extends BaseAtom { constructor(context, option) { super(context, option), this.name = AtomName.VCHART_SPEC, this.isLLMAtom = !1; } buildDefaultContext(context) { return Object.assign(Object.assign({}, context), { spec: {} }); } _runWithOutLLM() { const {prevSpec: prevSpec, originalSpec: originalSpec, operations: operations} = this.context, baseSpec = null != prevSpec ? prevSpec : originalSpec; if (!operations || !operations.length) return this.context.spec = baseSpec, this.context; const {spec: newSpec} = runOperactionsOfSpec(baseSpec, operations); return this.context.prevSpec = baseSpec, this.context.spec = newSpec, this.context; } } export const registerVChartSpecAtom = () => { Factory.registerAtom(AtomName.VCHART_SPEC, VChartSpec); }; //# sourceMappingURL=index.js.map