growInX.js 1022 B

123456789101112131415161718192021222324252627282930
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.GrowInX = void 0;
  4. const g_1 = require("@antv/g");
  5. const scaleInX_1 = require("./scaleInX");
  6. /**
  7. * Scale mark from nothing to desired shape in x direction.
  8. */
  9. const GrowInX = (options) => {
  10. return (from, to, value, coordinate, defaults) => {
  11. const [shape] = from;
  12. const { height, width } = shape.getBoundingClientRect();
  13. const clipPath = new g_1.Path({
  14. style: {
  15. path: `M0,0L${width},0L${width},${height}L0,${height}Z`,
  16. },
  17. });
  18. shape.appendChild(clipPath);
  19. shape.style.clipPath = clipPath;
  20. const animation = (0, scaleInX_1.ScaleInX)(options)([clipPath], to, value, coordinate, defaults);
  21. animation.finished.then(() => {
  22. clipPath.remove();
  23. shape.style.clipPath = null;
  24. });
  25. return animation;
  26. };
  27. };
  28. exports.GrowInX = GrowInX;
  29. exports.GrowInX.props = {};
  30. //# sourceMappingURL=growInX.js.map