MCPcopy Index your code
hub / github.com/bqplot/bqplot / getPadding

Method getPadding

js/src/HeatMap.ts:210–220  ·  view source on GitHub ↗
(xData: number[], yData: number[])

Source from the content-addressed store, hash-verified

208 }
209
210 private getPadding(xData: number[], yData: number[]) {
211 const numCols = xData.length;
212 const numRows = yData.length;
213
214 return {
215 left: (xData[1] - xData[0]) * 0.5,
216 right: (xData[numCols - 1] - xData[numCols - 2]) * 0.5,
217 bottom: -(yData[1] - yData[0]) * 0.5,
218 top: -(yData[numRows - 1] - yData[numRows - 2]) * 0.5,
219 };
220 }
221
222 computeRectSizes(data, padding1, padding2, reversed = false) {
223 const factor = reversed ? -1 : 1;

Callers 1

getPlottingDataMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected