| 1234567891011121314151617181920212223242526 |
- import { Path } from '@antv/g';
- import { ScaleInX } from './scaleInX';
- /**
- * Scale mark from nothing to desired shape in x direction.
- */
- export const GrowInX = (options) => {
- return (from, to, value, coordinate, defaults) => {
- const [shape] = from;
- const { height, width } = shape.getBoundingClientRect();
- const clipPath = new Path({
- style: {
- path: `M0,0L${width},0L${width},${height}L0,${height}Z`,
- },
- });
- shape.appendChild(clipPath);
- shape.style.clipPath = clipPath;
- const animation = ScaleInX(options)([clipPath], to, value, coordinate, defaults);
- animation.finished.then(() => {
- clipPath.remove();
- shape.style.clipPath = null;
- });
- return animation;
- };
- };
- GrowInX.props = {};
- //# sourceMappingURL=growInX.js.map
|