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

Function createMatrixRect

src/component/matrix/MatrixView.ts:419–438  ·  view source on GitHub ↗
(
    shape: RectShape, style: ItemStyleProps, z2: number
)

Source from the content-addressed store, hash-verified

417// `dataToLayout` is not consistent with this rendering, and the caller (like heatmap) can
418// not precisely align with the matrix border.
419function createMatrixRect(
420 shape: RectShape, style: ItemStyleProps, z2: number
421): Rect {
422 // Currently `subPixelOptimizeRect` can not be used here because it will break rect alignment.
423 // Optimize line and rect with the same direction.
424 const lineWidth = style.lineWidth;
425 if (lineWidth) {
426 const x2Original = shape.x + shape.width;
427 const y2Original = shape.y + shape.height;
428 shape.x = subPixelOptimize(shape.x, lineWidth, true);
429 shape.y = subPixelOptimize(shape.y, lineWidth, true);
430 shape.width = subPixelOptimize(x2Original, lineWidth, true) - shape.x;
431 shape.height = subPixelOptimize(y2Original, lineWidth, true) - shape.y;
432 }
433 return new Rect({
434 shape,
435 style: style,
436 z2,
437 });
438}
439
440function createMatrixLine(shape: Omit<LineShape, 'percent'>, style: LineStyleProps, z2: number): Line {
441 const lineWidth = style.lineWidth;

Callers 2

renderMethod · 0.85
createMatrixCellFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…