@visactor/vchart
Version:
charts lib based @visactor/VGrammar
40 lines (30 loc) • 1.41 kB
JavaScript
import { Factory } from "./../core/factory";
import { BaseLineMark, LINE_SEGMENT_ATTRIBUTES } from "./base/base-line";
import { registerLineOrAreaAnimation } from "../animation/config";
import { registerArea, registerShadowRoot } from "@visactor/vrender-kits";
import { registerLineDataLabel, registerSymbolDataLabel } from "@visactor/vrender-components";
import { createArea } from "@visactor/vrender-core";
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