@visactor/vchart
Version:
charts lib based @visactor/VGrammar
42 lines (33 loc) • 1.51 kB
JavaScript
import { Factory } from "./../core/factory";
import { registerShadowRoot, registerSymbol } from "@visactor/vrender-kits";
import { registerSymbolDataLabel } from "@visactor/vrender-components";
import { createSymbol } from "@visactor/vrender-core";
import { isNil } from "@visactor/vutils";
import { BaseMark } from "./base";
export class CellMark extends BaseMark {
constructor() {
super(...arguments), this.type = CellMark.type;
}
_getDefaultStyle() {
return Object.assign(Object.assign({}, super._getDefaultStyle()), {
fill: void 0,
lineWidth: 0,
padding: 0
});
}
_createGraphic(attrs = {}) {
return createSymbol(attrs);
}
_transformGraphicAttributes(g, attrs, groupAttrs) {
var _a, _b, _c;
const symbolAttrs = super._transformGraphicAttributes(g, attrs, groupAttrs), symbolType = null !== (_b = null !== (_a = symbolAttrs.shape) && void 0 !== _a ? _a : symbolAttrs.symbolType) && void 0 !== _b ? _b : null === (_c = g.attribute) || void 0 === _c ? void 0 : _c.symbolType;
return isNil(symbolType) ? symbolAttrs.symbolType = "rect" : symbolAttrs.symbolType = symbolType,
symbolAttrs;
}
}
CellMark.type = "cell";
export const registerCellMark = () => {
Factory.registerMark(CellMark.type, CellMark), Factory.registerGraphicComponent("symbol", createSymbol),
registerShadowRoot(), registerSymbol(), registerSymbolDataLabel();
};
//# sourceMappingURL=cell.js.map