(lines: VegaDeckGl.types.StyledLine[])
| 131 | } |
| 132 | |
| 133 | function minMaxPoints(lines: VegaDeckGl.types.StyledLine[]) { |
| 134 | const points: number[][] = []; |
| 135 | lines.forEach(line => { |
| 136 | [line.sourcePosition, line.targetPosition].forEach(point => { |
| 137 | points.push(point); |
| 138 | }); |
| 139 | }); |
| 140 | return [0, 1].map(dim => { |
| 141 | const minMax: { min: number, max: number } = { min: null, max: null }; |
| 142 | points.forEach(point => { |
| 143 | if (minMax.max == null) { |
| 144 | minMax.max = point[dim]; |
| 145 | } else { |
| 146 | minMax.max = Math.max(minMax.max, point[dim]); |
| 147 | } |
| 148 | if (minMax.min == null) { |
| 149 | minMax.min = point[dim]; |
| 150 | } else { |
| 151 | minMax.min = Math.min(minMax.min, point[dim]); |
| 152 | } |
| 153 | }); |
| 154 | return minMax; |
| 155 | }); |
| 156 | } |
no test coverage detected