{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/geometry/shape/edge/index.ts"],"names":[],"mappings":";;;AAGA,gCAA8D;AAC9D,+CAA6C;AAC7C,qCAA2C;AAC3C,qDAAmD;AAEnD,IAAM,gBAAgB,GAAG,IAAA,2BAAoB,EAAC,MAAM,EAAE;IACpD,gBAAgB,EAAE,MAAM;IACxB,gBAAgB,EAAhB,UAAiB,SAAqB;QACpC,OAAO,IAAA,0BAAW,EAAC,SAAS,CAAC,CAAC;IAChC,CAAC;CACF,CAAC,CAAC;AAEH,IAAA,oBAAa,EAAC,MAAM,EAAE,MAAM,EAAE;IAC5B,IAAI,EAAJ,UAAK,GAAc,EAAE,SAAiB;QACpC,IAAM,KAAK,GAAG,IAAA,oBAAQ,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;QACtD,IAAM,IAAI,GAAG,IAAA,kBAAW,EAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAChF,OAAO,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE;YAChC,KAAK,wCACA,KAAK,KACR,IAAI,MAAA,GACL;SACF,CAAC,CAAC;IACL,CAAC;IACD,SAAS,EAAT,UAAU,SAAyB;QACjC,OAAO;YACL,MAAM,EAAE,QAAQ;YAChB,KAAK,EAAE;gBACL,CAAC,EAAE,GAAG;gBACN,IAAI,EAAE,SAAS,CAAC,KAAK;aACtB;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,kBAAe,gBAAgB,CAAC","sourcesContent":["import { IGroup } from '../../../dependents';\nimport { Point, ShapeInfo, ShapeMarkerCfg, ShapePoint } from '../../../interface';\n\nimport { registerShape, registerShapeFactory } from '../base';\nimport { getStyle } from '../util/get-style';\nimport { getLinePath } from '../util/path';\nimport { splitPoints } from '../util/split-points';\n\nconst EdgeShapeFactory = registerShapeFactory('edge', {\n defaultShapeType: 'line',\n getDefaultPoints(pointInfo: ShapePoint): Point[] {\n return splitPoints(pointInfo);\n },\n});\n\nregisterShape('edge', 'line', {\n draw(cfg: ShapeInfo, container: IGroup) {\n const style = getStyle(cfg, true, false, 'lineWidth');\n const path = getLinePath(this.parsePoints(cfg.points), this.coordinate.isPolar);\n return container.addShape('path', {\n attrs: {\n ...style,\n path,\n },\n });\n },\n getMarker(markerCfg: ShapeMarkerCfg) {\n return {\n symbol: 'circle',\n style: {\n r: 4.5,\n fill: markerCfg.color,\n },\n };\n },\n});\n\nexport default EdgeShapeFactory;\n"]}