| 12345678910111213141516171819202122232425262728293031323334 |
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.cartesian = void 0;
- /* eslint-disable @typescript-eslint/no-unused-vars */
- var scale_1 = require("@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
- */
- var cartesian = function (params, x, y, width, height) {
- var sx = new scale_1.Linear({
- range: [x, x + width],
- });
- var sy = new scale_1.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)];
- },
- };
- };
- exports.cartesian = cartesian;
- //# sourceMappingURL=cartesian.js.map
|