Files
lan-manager/web/node_modules/@antv/g-svg/esm/shape/polygon.js
openclaw 0a5f6a8047 Initial commit: Lan-manager project code
- Go backend (server/)
- Frontend (web/, server/static/)
- Database and deployment files
- Scripts and docs

Co-Authored-By: 狸花猫/Claude-Qwen3.6-Plus 🐾
2026-04-20 00:52:58 +08:00

33 lines
1.1 KiB
JavaScript

import { __extends } from "tslib";
/**
* @fileoverview polygon
* @author dengfuping_develop@163.com
*/
import { each, isArray } from '@antv/util';
import { SVG_ATTR_MAP } from '../constant';
import ShapeBase from './base';
var Polygon = /** @class */ (function (_super) {
__extends(Polygon, _super);
function Polygon() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.type = 'polygon';
_this.canFill = true;
_this.canStroke = true;
return _this;
}
Polygon.prototype.createPath = function (context, targetAttrs) {
var attrs = this.attr();
var el = this.get('el');
each(targetAttrs || attrs, function (value, attr) {
if (attr === 'points' && isArray(value) && value.length >= 2) {
el.setAttribute('points', value.map(function (point) { return point[0] + "," + point[1]; }).join(' '));
}
else if (SVG_ATTR_MAP[attr]) {
el.setAttribute(SVG_ATTR_MAP[attr], value);
}
});
};
return Polygon;
}(ShapeBase));
export default Polygon;
//# sourceMappingURL=polygon.js.map