MCPcopy Index your code
hub / github.com/apache/echarts / render

Method render

src/component/matrix/MatrixView.ts:57–139  ·  view source on GitHub ↗
(matrixModel: MatrixModel, ecModel: GlobalModel)

Source from the content-addressed store, hash-verified

55 type = MatrixView.type;
56
57 render(matrixModel: MatrixModel, ecModel: GlobalModel) {
58
59 this.group.removeAll();
60
61 const group = this.group;
62 const coordSys = matrixModel.coordinateSystem;
63 const rect = coordSys.getRect();
64 const xDimModel = matrixModel.getDimensionModel('x');
65 const yDimModel = matrixModel.getDimensionModel('y');
66 const xDim = xDimModel.dim;
67 const yDim = yDimModel.dim;
68
69 // PENDING:
70 // reuse the existing text and rect elements for performance?
71
72 renderDimensionCells(
73 group,
74 matrixModel,
75 ecModel
76 );
77
78 createBodyAndCorner(
79 group,
80 matrixModel,
81 xDim,
82 yDim,
83 ecModel
84 );
85
86 const borderZ2Option = matrixModel.getShallow('borderZ2', true);
87 const outerBorderZ2 = retrieve2(borderZ2Option, Z2_OUTER_BORDER);
88 const dividerLineZ2 = outerBorderZ2 - 1;
89
90 // Outer border and overall background. Use separate elements because of z-order:
91 // The overall background should appear below any other elements.
92 // But in most cases, the outer border and the divider line should be above the normal cell borders -
93 // especially when cell borders have different colors. But users may highlight some specific cells by
94 // overstirking their border, in which case it should be above the outer border.
95 const bgStyle = matrixModel.getModel('backgroundStyle').getItemStyle(
96 ['borderWidth']
97 );
98 bgStyle.lineWidth = 0;
99 const borderStyle = matrixModel.getModel('backgroundStyle').getItemStyle(
100 ['color', 'decal', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY']
101 );
102 borderStyle.fill = 'none';
103 const bgRect = createMatrixRect(rect.clone(), bgStyle, Z2_BACKGROUND);
104 const borderRect = createMatrixRect(rect.clone(), borderStyle, outerBorderZ2);
105 bgRect.silent = true;
106 borderRect.silent = true;
107 group.add(bgRect);
108 group.add(borderRect);
109
110 // Header split line.
111 const xDimCell0 = xDim.getUnitLayoutInfo(0, 0);
112 const yDimCell0 = yDim.getUnitLayoutInfo(1, 0);
113 if (xDimCell0 && yDimCell0) {
114 if (xDim.shouldShow()) {

Callers

nothing calls this directly

Calls 14

renderDimensionCellsFunction · 0.85
createBodyAndCornerFunction · 0.85
createMatrixRectFunction · 0.85
createMatrixLineFunction · 0.85
getDimensionModelMethod · 0.80
getShallowMethod · 0.80
getItemStyleMethod · 0.80
getUnitLayoutInfoMethod · 0.80
getLineStyleMethod · 0.80
getRectMethod · 0.45
getModelMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected