@visactor/vchart
Version:
charts lib based @visactor/VGrammar
37 lines (31 loc) • 1.1 kB
JavaScript
import { Factory } from "./../core/factory";
import { BaseMark } from "./base/base-mark";
import { registerLinkPathGlyph } from "@visactor/vgrammar-core";
export class LinkPathMark extends BaseMark {
constructor() {
super(...arguments), this.type = LinkPathMark.type;
}
_getDefaultStyle() {
return Object.assign(Object.assign({}, super._getDefaultStyle()), {
x: 0,
y: 0,
x0: 0,
y0: 0,
x1: 100,
y1: 100,
thickness: 1,
round: !0
});
}
_initProduct(group) {
const view = this.getVGrammarView(), id = this.getProductId(), direction = this.getStyle("direction");
this._product = view.glyph("linkPath", null != group ? group : view.rootMark).id(id).configureGlyph({
direction: direction
}), this._compiledProductId = id;
}
}
LinkPathMark.type = "linkPath";
export const registerLinkPathMark = () => {
registerLinkPathGlyph(), Factory.registerMark(LinkPathMark.type, LinkPathMark);
};
//# sourceMappingURL=link-path.js.map