Polygon.js 1.3 KB

1234567891011121314151617181920212223242526272829
  1. "use strict";
  2. var __assign = (this && this.__assign) || function () {
  3. __assign = Object.assign || function(t) {
  4. for (var s, i = 1, n = arguments.length; i < n; i++) {
  5. s = arguments[i];
  6. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
  7. t[p] = s[p];
  8. }
  9. return t;
  10. };
  11. return __assign.apply(this, arguments);
  12. };
  13. Object.defineProperty(exports, "__esModule", { value: true });
  14. var core_1 = require("@logicflow/core");
  15. function Polygon(_a) {
  16. var _b = _a.fillOpacity, fillOpacity = _b === void 0 ? 1 : _b, _c = _a.strokeWidth, strokeWidth = _c === void 0 ? 1 : _c, _d = _a.strokeOpacity, strokeOpacity = _d === void 0 ? 1 : _d, _e = _a.fill, fill = _e === void 0 ? 'transparent' : _e, _f = _a.stroke, stroke = _f === void 0 ? '#000' : _f, points = _a.points, _g = _a.className, className = _g === void 0 ? 'lf-basic-shape' : _g;
  17. var attrs = {
  18. fill: fill,
  19. fillOpacity: fillOpacity,
  20. strokeWidth: strokeWidth,
  21. stroke: stroke,
  22. strokeOpacity: strokeOpacity,
  23. points: '',
  24. className: className,
  25. };
  26. attrs.points = points.map(function (point) { return point.join(','); }).join(' ');
  27. return (core_1.h("polygon", __assign({}, attrs)));
  28. }
  29. exports.default = Polygon;