(data: ScaleDataValue[], out?: number[])
| 152 | } |
| 153 | |
| 154 | clampData(data: ScaleDataValue[], out?: number[]): number[] { |
| 155 | const xScale = this.getAxis('x').scale; |
| 156 | const yScale = this.getAxis('y').scale; |
| 157 | const xAxisExtent = xScale.getExtent(); |
| 158 | const yAxisExtent = yScale.getExtent(); |
| 159 | const x = xScale.parse(data[0]); |
| 160 | const y = yScale.parse(data[1]); |
| 161 | out = out || []; |
| 162 | out[0] = Math.min( |
| 163 | Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x), |
| 164 | Math.max(xAxisExtent[0], xAxisExtent[1]) |
| 165 | ); |
| 166 | out[1] = Math.min( |
| 167 | Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), |
| 168 | Math.max(yAxisExtent[0], yAxisExtent[1]) |
| 169 | ); |
| 170 | |
| 171 | return out; |
| 172 | } |
| 173 | |
| 174 | pointToData(point: number[], clamp?: boolean, out?: number[]): number[] { |
| 175 | out = out || []; |
no test coverage detected