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

Method computeRectSizes

js/src/HeatMap.ts:222–234  ·  view source on GitHub ↗
(data, padding1, padding2, reversed = false)

Source from the content-addressed store, hash-verified

220 }
221
222 computeRectSizes(data, padding1, padding2, reversed = false) {
223 const factor = reversed ? -1 : 1;
224
225 return data.map((d, i) => {
226 if (i == 0) {
227 return factor * (data[1] - d) * 0.5 + padding1;
228 } else if (i == data.length - 1) {
229 return factor * (d - data[i - 1]) * 0.5 + padding2;
230 } else {
231 return factor * (data[i + 1] - data[i - 1]) * 0.5;
232 }
233 });
234 }
235
236 private getElementFill(color: number | null) {
237 if (color === null) {

Callers 1

getPlottingDataMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected