/* eslint-disable @typescript-eslint/no-unused-vars */ import { Linear } from '@antv/scale'; /** * Maps normalized value to the bounding box of coordinate. * @param params [] * @param x x of the the bounding box of coordinate * @param y y of the the bounding box of coordinate * @param width width of the the bounding box of coordinate * @param height height of the the bounding box of coordinate * @returns transformer */ export var cartesian = function (params, x, y, width, height) { var sx = new Linear({ range: [x, x + width], }); var sy = new Linear({ range: [y, y + height], }); return { transform: function (vector) { var v1 = vector[0], v2 = vector[1]; return [sx.map(v1), sy.map(v2)]; }, untransform: function (vector) { var v1 = vector[0], v2 = vector[1]; return [sx.invert(v1), sy.invert(v2)]; }, }; }; //# sourceMappingURL=cartesian.js.map