MCPcopy
hub / github.com/apache/echarts / createBodyOrCornerCells

Function createBodyOrCornerCells

src/component/matrix/MatrixView.ts:199–256  ·  view source on GitHub ↗
(
        bodyCornerOptionRoot: TBodyOrCornerKind,
        bodyOrCorner: MatrixBodyCorner<TBodyOrCornerKind>,
        dimForCoordX: MatrixDim, // Can be `matrix.y` (transposed) for corners.
        dimForCoordY: MatrixDim, // Can be `matrix.x` (trnasposed) for corners.
    )

Source from the content-addressed store, hash-verified

197 }
198
199 function createBodyOrCornerCells<TBodyOrCornerKind extends MatrixBodyOrCornerKind>(
200 bodyCornerOptionRoot: TBodyOrCornerKind,
201 bodyOrCorner: MatrixBodyCorner<TBodyOrCornerKind>,
202 dimForCoordX: MatrixDim, // Can be `matrix.y` (transposed) for corners.
203 dimForCoordY: MatrixDim, // Can be `matrix.x` (trnasposed) for corners.
204 ): void {
205 // Prevent inheriting from ancestor.
206 const parentCellModel = new Model(matrixModel.getShallow(bodyCornerOptionRoot, true));
207 const parentItemStyleModel = parentCellModel.getModel('itemStyle');
208 const parentLabelModel = parentCellModel.getModel('label');
209
210 const itx = new ListIterator<MatrixCellLayoutInfo>();
211 const ity = new ListIterator<MatrixCellLayoutInfo>();
212 const xyLocator: number[] = [];
213 const tooltipOption = matrixModel.getShallow('tooltip', true);
214
215 for (dimForCoordY.resetLayoutIterator(ity, 1); ity.next();) {
216 for (dimForCoordX.resetLayoutIterator(itx, 0); itx.next();) {
217 const xLayout = itx.item;
218 const yLayout = ity.item;
219
220 vectorUtil.set(xyLocator, xLayout.id.x, yLayout.id.y);
221 const bodyCornerCell = bodyOrCorner.getCell(xyLocator);
222
223 // If in span of an other body or corner cell, never render it.
224 if (bodyCornerCell && bodyCornerCell.inSpanOf && bodyCornerCell.inSpanOf !== bodyCornerCell) {
225 continue;
226 }
227
228 const shape = {} as RectLike;
229 if (bodyCornerCell && bodyCornerCell.span) {
230 BoundingRect.copy(shape, bodyCornerCell.spanRect);
231 }
232 else {
233 xLayout.dim.getLayout(shape, 0, xyLocator[0]);
234 yLayout.dim.getLayout(shape, 1, xyLocator[1]);
235 }
236
237 const bodyCornerCellOption = bodyCornerCell ? bodyCornerCell.option : null;
238
239 createMatrixCell(
240 xyLocator,
241 matrixModel,
242 group,
243 ecModel,
244 bodyCornerCellOption,
245 parentItemStyleModel,
246 parentLabelModel,
247 parentCellModel,
248 shape,
249 bodyCornerCellOption ? bodyCornerCellOption.value : null,
250 Z2_BODY_CORNER_CELL_DEFAULT,
251 tooltipOption,
252 bodyCornerOptionRoot
253 );
254 }
255 }
256 } // End of createBodyOrCornerCells

Callers 1

createBodyAndCornerFunction · 0.85

Calls 7

getModelMethod · 0.95
nextMethod · 0.95
createMatrixCellFunction · 0.85
getShallowMethod · 0.80
resetLayoutIteratorMethod · 0.80
getLayoutMethod · 0.65
getCellMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…