MCPcopy Index your code
hub / github.com/clientIO/joint / drawGrid

Function drawGrid

examples/isometric/src/utils.ts:93–106  ·  view source on GitHub ↗
(paper: dia.Paper, size: number, step: number, color = '#E0E0E0')

Source from the content-addressed store, hash-verified

91}
92
93export const drawGrid = (paper: dia.Paper, size: number, step: number, color = '#E0E0E0') => {
94 const gridData = [];
95 const j = size;
96 for (let i = 0; i <= j; i++) {
97 gridData.push(`M 0,${i * step} ${j * step},${i * step}`);
98 gridData.push(`M ${i * step}, 0 ${i * step},${j * step}`);
99 }
100 const gridVEl = V('path').attr({
101 'd': gridData.join(' '),
102 'fill': 'none',
103 'stroke': color
104 });
105 gridVEl.appendTo(paper.getLayerNode(dia.Paper.Layers.BACK));
106}
107
108export const switchView = (paper: dia.Paper, view: View, selectedCell: IsometricShape | Link) => {
109 paper.model.getElements().forEach((element: IsometricShape) => {

Callers 1

index.tsFile · 0.90

Calls 1

VFunction · 0.90

Tested by

no test coverage detected