shape.js 998 B

12345678910111213141516171819202122232425262728
  1. var __rest = (this && this.__rest) || function (s, e) {
  2. var t = {};
  3. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  4. t[p] = s[p];
  5. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  6. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  7. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
  8. t[p[i]] = s[p[i]];
  9. }
  10. return t;
  11. };
  12. /**
  13. * Draw a custom shape.
  14. */
  15. export const Shape = (options) => {
  16. const { render } = options, rest = __rest(options, ["render"]);
  17. return (points, value, coordinate, theme) => {
  18. const [[x0, y0]] = points;
  19. return render(Object.assign(Object.assign({}, rest), { x: x0, y: y0 }));
  20. };
  21. };
  22. Shape.props = {
  23. defaultMarker: 'point',
  24. defaultEnterAnimation: 'fadeIn',
  25. defaultUpdateAnimation: 'morphing',
  26. defaultExitAnimation: 'fadeOut',
  27. };
  28. //# sourceMappingURL=shape.js.map