@visactor/vchart
Version:
charts lib based @visactor/VGrammar
40 lines (30 loc) • 1.44 kB
JavaScript
import { Factory } from "./../core/factory";
import { BaseLineMark, LINE_SEGMENT_ATTRIBUTES } from "./base/base-line";
import { registerLineOrAreaAnimation } from "../animation/config";
import { registerLineDataLabel } from "@visactor/vrender-components/label/line";
import { registerSymbolDataLabel } from "@visactor/vrender-components/label/symbol";
import { createArea, registerArea, registerShadowRoot } from "../vrender-bridge";
const AREA_SEGMENT_ATTRIBUTES = [ ...LINE_SEGMENT_ATTRIBUTES, "fill", "fillOpacity", "background", "texture", "texturePadding", "textureSize", "textureColor" ];
export class AreaMark extends BaseLineMark {
constructor() {
super(...arguments), this.type = AreaMark.type, this._isValidPointChannel = channel => [ "x", "y", "x1", "y1", "defined" ].includes(channel);
}
_getDefaultStyle() {
return Object.assign(Object.assign({}, super._getDefaultStyle()), {
lineWidth: 0
});
}
_getSegmentAttributes() {
return AREA_SEGMENT_ATTRIBUTES;
}
_getIgnoreAttributes() {
return [];
}
}
AreaMark.type = "area";
export const registerAreaMark = () => {
Factory.registerMark(AreaMark.type, AreaMark), registerShadowRoot(), registerArea(),
registerLineDataLabel(), registerSymbolDataLabel(), registerLineOrAreaAnimation(),
Factory.registerGraphicComponent("area", createArea);
};
//# sourceMappingURL=area.js.map