@visactor/vtable
Version:
canvas table width high performance
59 lines (53 loc) • 2.87 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.initSceneGraph = void 0;
const group_1 = require("../graphic/group");
function initSceneGraph(scene) {
const width = scene.table.tableNoFrameWidth, height = scene.table.tableNoFrameHeight;
scene.tableGroup = new group_1.Group({
x: 0,
y: 0,
width: width,
height: height,
clip: !0,
pickable: !1
}), scene.tableGroup.role = "table";
const colHeaderGroup = createContainerGroup(0, 0, !scene.table.options.enableTreeStickCell);
colHeaderGroup.role = "col-header", scene.colHeaderGroup = colHeaderGroup;
const cornerHeaderGroup = createContainerGroup(0, 0, !scene.table.options.enableTreeStickCell);
cornerHeaderGroup.role = "corner-header", scene.cornerHeaderGroup = cornerHeaderGroup;
const rowHeaderGroup = createContainerGroup(0, 0, !0);
rowHeaderGroup.role = "row-header", scene.rowHeaderGroup = rowHeaderGroup;
const bodyGroup = createContainerGroup(width, 0, !0);
bodyGroup.role = "body", scene.bodyGroup = bodyGroup;
const rightFrozenGroup = createContainerGroup(0, 0, !0);
rightFrozenGroup.role = "right-frozen", scene.rightFrozenGroup = rightFrozenGroup;
const bottomFrozenGroup = createContainerGroup(0, 0, !0);
bottomFrozenGroup.role = "bottom-frozen", scene.bottomFrozenGroup = bottomFrozenGroup;
const componentGroup = createContainerGroup(0, 0);
componentGroup.role = "component", scene.componentGroup = componentGroup;
const rightTopCornerGroup = createContainerGroup(0, 0, !0);
rightTopCornerGroup.role = "corner-right-top-header", scene.rightTopCornerGroup = rightTopCornerGroup;
const rightBottomCornerGroup = createContainerGroup(0, 0, !0);
rightBottomCornerGroup.role = "corner-right-bottom-header", scene.rightBottomCornerGroup = rightBottomCornerGroup;
const leftBottomCornerGroup = createContainerGroup(0, 0, !0);
leftBottomCornerGroup.role = "corner-left-bottom-header", scene.leftBottomCornerGroup = leftBottomCornerGroup,
scene.tableGroup.addChild(bodyGroup), scene.tableGroup.addChild(rowHeaderGroup),
scene.tableGroup.addChild(bottomFrozenGroup), scene.tableGroup.addChild(colHeaderGroup),
scene.tableGroup.addChild(rightFrozenGroup), scene.tableGroup.addChild(rightBottomCornerGroup),
scene.tableGroup.addChild(rightTopCornerGroup), scene.tableGroup.addChild(leftBottomCornerGroup),
scene.tableGroup.addChild(cornerHeaderGroup), scene.tableGroup.addChild(componentGroup);
}
function createContainerGroup(width, height, clip) {
return new group_1.Group({
x: 0,
y: 0,
width: width,
height: height,
clip: null != clip && clip,
pickable: !1
});
}
exports.initSceneGraph = initSceneGraph;
//# sourceMappingURL=init-scenegraph.js.map