diff --git a/.gitignore b/.gitignore index 0c8b97f4b..5b014fbc1 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ nezha-fronted/src/components/page/dashboard/testData.js nezha-fronted/src/components/common/rightBox/tempRoghtBox.vue nezha-fronted/exportHtml/ nezha-fronted/src/a.txt +nezha-fronted/src/components/common/testTopology.vue diff --git a/nezha-fronted/src/assets/css/font/iconfont.js b/nezha-fronted/src/assets/css/font/iconfont.js index 3d1f9837d..c9e12976f 100644 --- a/nezha-fronted/src/assets/css/font/iconfont.js +++ b/nezha-fronted/src/assets/css/font/iconfont.js @@ -1 +1 @@ -!function(a){var h,c,l,z,o,i='',v=(v=document.getElementsByTagName("script"))[v.length-1].getAttribute("data-injectcss"),t=function(a,h){h.parentNode.insertBefore(a,h)};if(v&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(a){console&&console.log(a)}}function m(){o||(o=!0,l())}function p(){try{z.documentElement.doScroll("left")}catch(a){return void setTimeout(p,50)}m()}h=function(){var a,h=document.createElement("div");h.innerHTML=i,i=null,(h=h.getElementsByTagName("svg")[0])&&(h.setAttribute("aria-hidden","true"),h.style.position="absolute",h.style.width=0,h.style.height=0,h.style.overflow="hidden",h=h,(a=document.body).firstChild?t(h,a.firstChild):a.appendChild(h))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(c=function(){document.removeEventListener("DOMContentLoaded",c,!1),h()},document.addEventListener("DOMContentLoaded",c,!1)):document.attachEvent&&(l=h,z=a.document,o=!1,p(),z.onreadystatechange=function(){"complete"==z.readyState&&(z.onreadystatechange=null,m())})}(window); \ No newline at end of file +!function(a){var h,c,l,z,o,i='',v=(v=document.getElementsByTagName("script"))[v.length-1].getAttribute("data-injectcss"),t=function(a,h){h.parentNode.insertBefore(a,h)};if(v&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(a){console&&console.log(a)}}function m(){o||(o=!0,l())}function p(){try{z.documentElement.doScroll("left")}catch(a){return void setTimeout(p,50)}m()}h=function(){var a,h=document.createElement("div");h.innerHTML=i,i=null,(h=h.getElementsByTagName("svg")[0])&&(h.setAttribute("aria-hidden","true"),h.style.position="absolute",h.style.width=0,h.style.height=0,h.style.overflow="hidden",h=h,(a=document.body).firstChild?t(h,a.firstChild):a.appendChild(h))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(c=function(){document.removeEventListener("DOMContentLoaded",c,!1),h()},document.addEventListener("DOMContentLoaded",c,!1)):document.attachEvent&&(l=h,z=a.document,o=!1,p(),z.onreadystatechange=function(){"complete"==z.readyState&&(z.onreadystatechange=null,m())})}(window) diff --git a/nezha-fronted/src/components/chart/chart/chartAutotopology.vue b/nezha-fronted/src/components/chart/chart/chartAutotopology.vue index 0b96e814e..703024b07 100644 --- a/nezha-fronted/src/components/chart/chart/chartAutotopology.vue +++ b/nezha-fronted/src/components/chart/chart/chartAutotopology.vue @@ -46,7 +46,7 @@ export default { this.isInit = false this.$get('monitor/project', { pageSize: -1 }).then(res => { this.topologyLoading = true - const axiosAll = [] + let axiosAll = [] let temp = [] if (res.data.list.length === 0) { this.topologyLoading = false @@ -65,8 +65,10 @@ export default { res2.forEach(item => { temp.push(item) }) + // temp.push(res2[2]) this.allProject = JSON.parse(JSON.stringify(temp)) temp = null + axiosAll = null this.topologyLoading = false }) }) @@ -100,7 +102,10 @@ export default { } }, mounted () { - + this.queryAllProjectData() + }, + beforeDestroy () { + this.allProject = [] } } diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/index.d.ts b/nezha-fronted/src/components/common/@topology/activity-diagram/index.d.ts new file mode 100644 index 000000000..66e4261f8 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/index.d.ts @@ -0,0 +1,5 @@ +export * from './src/final'; +export * from './src/fork'; +export * from './src/swimlaneH'; +export * from './src/swimlaneV'; +export * from './src/register'; diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/index.js b/nezha-fronted/src/components/common/@topology/activity-diagram/index.js new file mode 100644 index 000000000..65d21e838 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/index.js @@ -0,0 +1,6 @@ +export * from './src/final' +export * from './src/fork' +export * from './src/swimlaneH' +export * from './src/swimlaneV' +export * from './src/register' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/index.js.map b/nezha-fronted/src/components/common/@topology/activity-diagram/index.js.map new file mode 100644 index 000000000..8f31fa0f5 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../packages/activity-diagram/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/package.json b/nezha-fronted/src/components/common/@topology/activity-diagram/package.json new file mode 100644 index 000000000..a73465741 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/package.json @@ -0,0 +1,65 @@ +{ + "_args": [ + [ + "@topology/activity-diagram@0.3.0", + "D:\\a\\nezha-fronted\\nezha-fronted" + ] + ], + "_from": "@topology/activity-diagram@0.3.0", + "_id": "@topology/activity-diagram@0.3.0", + "_inBundle": false, + "_integrity": "sha512-9uceHdbT1MY++/2crNlZmFMVmz6sI4OqH7aUQuBT8q9RDXA7t2prFd7lx4UfaIyQqDYtYtpeCHLPlhRLsEooZg==", + "_location": "/@topology/activity-diagram", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@topology/activity-diagram@0.3.0", + "name": "@topology/activity-diagram", + "escapedName": "@topology%2factivity-diagram", + "scope": "@topology", + "rawSpec": "0.3.0", + "saveSpec": null, + "fetchSpec": "0.3.0" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/@topology/activity-diagram/-/activity-diagram-0.3.0.tgz", + "_spec": "0.3.0", + "_where": "D:\\a\\nezha-fronted\\nezha-fronted", + "author": { + "name": "alsmile123@qq.com" + }, + "bugs": { + "url": "https://github.com/le5le-com/topology/issues" + }, + "description": "A activity diagram tool using le5le-topology.", + "gitHead": "78f2a53ca1839c89b56e2e498d17ba4eb987ad14", + "homepage": "https://github.com/le5le-com/topology#readme", + "keywords": [ + "topology", + "activity", + "diagram", + "canvas" + ], + "license": "ISC", + "main": "index.js", + "name": "@topology/activity-diagram", + "peerDependencies": { + "@topology/core": "^0.3.0" + }, + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/le5le-com/topology.git" + }, + "scripts": { + "build": "tsc && npm run copy", + "copy": "copyfiles package.json ../../dist/activity-diagram/" + }, + "types": "index.d.ts", + "version": "0.3.0" +} diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/final.d.ts b/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/final.d.ts new file mode 100644 index 000000000..a6f11bb00 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/final.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function activityFinal(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/final.js b/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/final.js new file mode 100644 index 000000000..bbc9e8174 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/final.js @@ -0,0 +1,10 @@ +export function activityFinal (ctx, node) { + ctx.beginPath() + ctx.ellipse(node.rect.x + node.rect.width / 2, node.rect.y + node.rect.height / 2, node.rect.width / 2, node.rect.height / 2, 0, 0, Math.PI * 2) + ctx.stroke() + ctx.beginPath() + ctx.fillStyle = ctx.strokeStyle + ctx.ellipse(node.rect.x + node.rect.width / 2, node.rect.y + node.rect.height / 2, node.rect.width / 4, node.rect.height / 4, 0, 0, Math.PI * 2) + ctx.fill() +} +// # sourceMappingURL=final.js.map diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/final.js.map b/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/final.js.map new file mode 100644 index 000000000..80b0c3fc6 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/final.js.map @@ -0,0 +1 @@ +{"version":3,"file":"final.js","sourceRoot":"","sources":["../../../../packages/activity-diagram/src/final/final.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,aAAa,CAAC,GAA6B,EAAE,IAAU;IACrE,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,OAAO,CACT,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EACjC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAClC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EACnB,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EACpB,CAAC,EACD,CAAC,EACD,IAAI,CAAC,EAAE,GAAG,CAAC,CACZ,CAAC;IACF,GAAG,CAAC,MAAM,EAAE,CAAC;IAEb,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,SAAS,GAAG,GAAG,CAAC,WAAW,CAAC;IAChC,GAAG,CAAC,OAAO,CACT,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EACjC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAClC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EACnB,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EACpB,CAAC,EACD,CAAC,EACD,IAAI,CAAC,EAAE,GAAG,CAAC,CACZ,CAAC;IACF,GAAG,CAAC,IAAI,EAAE,CAAC;AACb,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/final.rect.d.ts b/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/final.rect.d.ts new file mode 100644 index 000000000..e3c61f5d5 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/final.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '@topology/core'; +export declare function activityFinalIconRect(node: Node): void; +export declare function activityFinalTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/final.rect.js b/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/final.rect.js new file mode 100644 index 000000000..f8944efb5 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/final.rect.js @@ -0,0 +1,11 @@ +import { Rect } from '@topology/core' +export function activityFinalIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function activityFinalTextRect (node) { + const w = (node.rect.width * 5) / 7 + const h = (node.rect.height * 5) / 7 + node.textRect = new Rect(node.rect.x + (node.rect.width - w) / 2, node.rect.y + (node.rect.height - h) / 2, w, h) + node.fullTextRect = node.textRect +} +// # sourceMappingURL=final.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/final.rect.js.map b/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/final.rect.js.map new file mode 100644 index 000000000..b370cdf47 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/final.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"final.rect.js","sourceRoot":"","sources":["../../../../packages/activity-diagram/src/final/final.rect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,qBAAqB,CAAC,IAAU;IAC9C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAU;IAC9C,IAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACpC,IAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAClH,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/index.d.ts b/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/index.d.ts new file mode 100644 index 000000000..a385d62a6 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/index.d.ts @@ -0,0 +1,2 @@ +export * from './final'; +export * from './final.rect'; diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/index.js b/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/index.js new file mode 100644 index 000000000..4aece1e96 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/index.js @@ -0,0 +1,3 @@ +export * from './final' +export * from './final.rect' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/index.js.map b/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/index.js.map new file mode 100644 index 000000000..b26aaec2e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/final/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/activity-diagram/src/final/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.anchor.d.ts b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.anchor.d.ts new file mode 100644 index 000000000..289ac2786 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.anchor.d.ts @@ -0,0 +1,3 @@ +import { Node } from '@topology/core'; +export declare function forkHAnchors(node: Node): void; +export declare function forkVAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.anchor.js b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.anchor.js new file mode 100644 index 000000000..85f5bfd36 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.anchor.js @@ -0,0 +1,28 @@ +import { Point, Direction } from '@topology/core' +export function forkHAnchors (node) { + node.anchors.push(new Point(node.rect.x, node.rect.y + node.rect.height / 2, Direction.Left)) + node.anchors.push(new Point(node.rect.ex, node.rect.y + node.rect.height / 2, Direction.Right)) + const dis = 5 + for (let i = dis; node.rect.x + i < node.rect.ex; i = i + dis) { + const pt1 = new Point(node.rect.x + i, node.rect.y, Direction.Up) + const pt2 = new Point(node.rect.x + i, node.rect.ey, Direction.Bottom) + pt1.hidden = true + pt2.hidden = true + node.anchors.push(pt1) + node.anchors.push(pt2) + } +} +export function forkVAnchors (node) { + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y, Direction.Up)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.ey, Direction.Bottom)) + const dis = 5 + for (let i = dis; node.rect.y + i < node.rect.ey; i = i + dis) { + const pt1 = new Point(node.rect.x, node.rect.y + i, Direction.Left) + const pt2 = new Point(node.rect.ex, node.rect.y + i, Direction.Right) + pt1.hidden = true + pt2.hidden = true + node.anchors.push(pt1) + node.anchors.push(pt2) + } +} +// # sourceMappingURL=fork.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.anchor.js.map b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.anchor.js.map new file mode 100644 index 000000000..b31138857 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"fork.anchor.js","sourceRoot":"","sources":["../../../../packages/activity-diagram/src/fork/fork.anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAQ,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,UAAU,YAAY,CAAC,IAAU;IACrC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9F,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IAEhG,IAAM,GAAG,GAAG,CAAC,CAAC;IACd,KAAK,IAAI,CAAC,GAAG,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE;QA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KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QACpE,IAAM,GAAG,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;QACtE,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC;QAClB,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACxB;AACH,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.d.ts b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.d.ts new file mode 100644 index 000000000..1aba4a539 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function fork(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.js b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.js new file mode 100644 index 000000000..071c32b5a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.js @@ -0,0 +1,25 @@ +export function fork (ctx, node) { + let wr = node.borderRadius + let hr = node.borderRadius + if (node.borderRadius < 1) { + wr = node.rect.width * node.borderRadius + hr = node.rect.height * node.borderRadius + } + let r = wr < hr ? wr : hr + if (node.rect.width < 2 * r) { + r = node.rect.width / 2 + } + if (node.rect.height < 2 * r) { + r = node.rect.height / 2 + } + ctx.beginPath() + ctx.moveTo(node.rect.x + r, node.rect.y) + ctx.arcTo(node.rect.x + node.rect.width, node.rect.y, node.rect.x + node.rect.width, node.rect.y + node.rect.height, r) + ctx.arcTo(node.rect.x + node.rect.width, node.rect.y + node.rect.height, node.rect.x, node.rect.y + node.rect.height, r) + ctx.arcTo(node.rect.x, node.rect.y + node.rect.height, node.rect.x, node.rect.y, r) + ctx.arcTo(node.rect.x, node.rect.y, node.rect.x + node.rect.width, node.rect.y, r) + ctx.closePath(); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=fork.js.map diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.js.map b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.js.map new file mode 100644 index 000000000..7044f370f --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.js.map @@ -0,0 +1 @@ +{"version":3,"file":"fork.js","sourceRoot":"","sources":["../../../../packages/activity-diagram/src/fork/fork.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,IAAI,CAAC,GAA6B,EAAE,IAAU;IAC5D,IAAI,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC;IAC3B,IAAI,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC;IAC3B,IAAI,IAAI,CAAC,YAAY,GAAG,CAAC,EAAE;QACzB,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC;QACzC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC;KAC3C;IACD,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1B,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,EAAE;QAC3B,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;KACzB;IACD,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM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,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACnF,GAAG,CAAC,SAAS,EAAE,CAAC;IAEhB,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.rect.d.ts b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.rect.d.ts new file mode 100644 index 000000000..131f76476 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '@topology/core'; +export declare function forkIconRect(node: Node): void; +export declare function forkTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.rect.js b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.rect.js new file mode 100644 index 000000000..457f8ec0e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.rect.js @@ -0,0 +1,9 @@ +import { Rect } from '@topology/core' +export function forkIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function forkTextRect (node) { + node.textRect = new Rect(node.rect.x, node.rect.y, node.rect.width, node.rect.height) + node.fullTextRect = node.textRect +} +// # sourceMappingURL=fork.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.rect.js.map b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.rect.js.map new file mode 100644 index 000000000..4264cecca --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/fork.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"fork.rect.js","sourceRoot":"","sources":["../../../../packages/activity-diagram/src/fork/fork.rect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,YAAY,CAAC,IAAU;IACrC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAU;IACrC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACtF,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/index.d.ts b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/index.d.ts new file mode 100644 index 000000000..2bc64997e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/index.d.ts @@ -0,0 +1,3 @@ +export * from './fork'; +export * from './fork.rect'; +export * from './fork.anchor'; diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/index.js b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/index.js new file mode 100644 index 000000000..ac78c9d77 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/index.js @@ -0,0 +1,4 @@ +export * from './fork' +export * from './fork.rect' +export * from './fork.anchor' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/index.js.map b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/index.js.map new file mode 100644 index 000000000..acb6fc2ee --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/fork/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/activity-diagram/src/fork/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/register.d.ts b/nezha-fronted/src/components/common/@topology/activity-diagram/src/register.d.ts new file mode 100644 index 000000000..bf35c08a1 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/register.d.ts @@ -0,0 +1 @@ +export declare function register(): void; diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/register.js b/nezha-fronted/src/components/common/@topology/activity-diagram/src/register.js new file mode 100644 index 000000000..959b1884b --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/register.js @@ -0,0 +1,13 @@ +import { registerNode } from '@topology/core' +import { activityFinal, activityFinalIconRect, activityFinalTextRect } from './final' +import { fork, forkHAnchors, forkVAnchors, forkIconRect, forkTextRect } from './fork' +import { swimlaneH, swimlaneHIconRect, swimlaneHTextRect } from './swimlaneH' +import { swimlaneV, swimlaneVIconRect, swimlaneVTextRect } from './swimlaneV' +export function register () { + registerNode('activityFinal', activityFinal, null, activityFinalIconRect, activityFinalTextRect) + registerNode('swimlaneV', swimlaneV, null, swimlaneVIconRect, swimlaneVTextRect) + registerNode('swimlaneH', swimlaneH, null, swimlaneHIconRect, swimlaneHTextRect) + registerNode('forkH', fork, forkHAnchors, forkIconRect, forkTextRect) + registerNode('forkV', fork, forkVAnchors, forkIconRect, forkTextRect) +} +// # sourceMappingURL=register.js.map diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/register.js.map b/nezha-fronted/src/components/common/@topology/activity-diagram/src/register.js.map new file mode 100644 index 000000000..eeacb7c13 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/register.js.map @@ -0,0 +1 @@ +{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../packages/activity-diagram/src/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACtF,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE9E,MAAM,UAAU,QAAQ;IACtB,YAAY,CAAC,eAAe,EAAE,aAAa,EAAE,IAAI,EAAE,qBAAqB,EAAE,qBAAqB,CAAC,CAAC;IACjG,YAAY,CAAC,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,iBAAiB,EAAE,iBAAiB,CAAC,CAAC;IACjF,YAAY,CAAC,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,iBAAiB,EAAE,iBAAiB,CAAC,CAAC;IACjF,YAAY,CAAC,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;IACtE,YAAY,CAAC,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;AACxE,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/index.d.ts b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/index.d.ts new file mode 100644 index 000000000..c90dd6efb --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/index.d.ts @@ -0,0 +1,2 @@ +export * from './swimlaneH'; +export * from './swimlaneH.rect'; diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/index.js b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/index.js new file mode 100644 index 000000000..d85646311 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/index.js @@ -0,0 +1,3 @@ +export * from './swimlaneH' +export * from './swimlaneH.rect' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/index.js.map b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/index.js.map new file mode 100644 index 000000000..9b6932a1e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/activity-diagram/src/swimlaneH/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/swimlaneH.d.ts b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/swimlaneH.d.ts new file mode 100644 index 000000000..127ebdb61 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/swimlaneH.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function swimlaneH(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/swimlaneH.js b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/swimlaneH.js new file mode 100644 index 000000000..1d107c7bf --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/swimlaneH.js @@ -0,0 +1,27 @@ +export function swimlaneH (ctx, node) { + let wr = node.borderRadius + let hr = node.borderRadius + if (node.borderRadius < 1) { + wr = node.rect.width * node.borderRadius + hr = node.rect.height * node.borderRadius + } + let r = wr < hr ? wr : hr + if (node.rect.width < 2 * r) { + r = node.rect.width / 2 + } + if (node.rect.height < 2 * r) { + r = node.rect.height / 2 + } + ctx.beginPath() + ctx.moveTo(node.rect.x + r, node.rect.y) + ctx.arcTo(node.rect.x + node.rect.width, node.rect.y, node.rect.x + node.rect.width, node.rect.y + node.rect.height, r) + ctx.arcTo(node.rect.x + node.rect.width, node.rect.y + node.rect.height, node.rect.x, node.rect.y + node.rect.height, r) + ctx.arcTo(node.rect.x, node.rect.y + node.rect.height, node.rect.x, node.rect.y, r) + ctx.arcTo(node.rect.x, node.rect.y, node.rect.x + node.rect.width, node.rect.y, r) + ctx.closePath() + ctx.moveTo(node.rect.x + 40, node.rect.y) + ctx.lineTo(node.rect.x + 40, node.rect.ey); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=swimlaneH.js.map diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/swimlaneH.js.map b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/swimlaneH.js.map new file mode 100644 index 000000000..971105bdb --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/swimlaneH.js.map @@ -0,0 +1 @@ +{"version":3,"file":"swimlaneH.js","sourceRoot":"","sources":["../../../../packages/activity-diagram/src/swimlaneH/swimlaneH.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,SAAS,CAAC,GAA6B,EAAE,IAAU;IACjE,IAAI,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC;IAC3B,IAAI,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC;IAC3B,IAAI,IAAI,CAAC,YAAY,GAAG,CAAC,EAAE;QACzB,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC;QACzC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC;KAC3C;IACD,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1B,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,G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ACpF,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACnF,GAAG,CAAC,SAAS,EAAE,CAAC;IAEhB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC1C,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAE3C,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/swimlaneH.rect.d.ts b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/swimlaneH.rect.d.ts new file mode 100644 index 000000000..b30dd06f8 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/swimlaneH.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '@topology/core'; +export declare function swimlaneHIconRect(node: Node): void; +export declare function swimlaneHTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/swimlaneH.rect.js b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/swimlaneH.rect.js new file mode 100644 index 000000000..e369ba05c --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/swimlaneH.rect.js @@ -0,0 +1,9 @@ +import { Rect } from '@topology/core' +export function swimlaneHIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function swimlaneHTextRect (node) { + node.textRect = new Rect(node.rect.x + 10, node.rect.y, 20, node.rect.height) + node.fullTextRect = node.textRect +} +// # sourceMappingURL=swimlaneH.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/swimlaneH.rect.js.map b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/swimlaneH.rect.js.map new file mode 100644 index 000000000..6ddc55781 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneH/swimlaneH.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"swimlaneH.rect.js","sourceRoot":"","sources":["../../../../packages/activity-diagram/src/swimlaneH/swimlaneH.rect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,iBAAiB,CAAC,IAAU;IAC1C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAU;IAC1C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9E,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/index.d.ts b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/index.d.ts new file mode 100644 index 000000000..b118dd862 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/index.d.ts @@ -0,0 +1,2 @@ +export * from './swimlaneV'; +export * from './swimlaneV.rect'; diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/index.js b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/index.js new file mode 100644 index 000000000..9b88f7826 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/index.js @@ -0,0 +1,3 @@ +export * from './swimlaneV' +export * from './swimlaneV.rect' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/index.js.map b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/index.js.map new file mode 100644 index 000000000..7080fe508 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/activity-diagram/src/swimlaneV/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/swimlaneV.d.ts b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/swimlaneV.d.ts new file mode 100644 index 000000000..3e514c95a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/swimlaneV.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function swimlaneV(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/swimlaneV.js b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/swimlaneV.js new file mode 100644 index 000000000..61c476be1 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/swimlaneV.js @@ -0,0 +1,27 @@ +export function swimlaneV (ctx, node) { + let wr = node.borderRadius + let hr = node.borderRadius + if (node.borderRadius < 1) { + wr = node.rect.width * node.borderRadius + hr = node.rect.height * node.borderRadius + } + let r = wr < hr ? wr : hr + if (node.rect.width < 2 * r) { + r = node.rect.width / 2 + } + if (node.rect.height < 2 * r) { + r = node.rect.height / 2 + } + ctx.beginPath() + ctx.moveTo(node.rect.x + r, node.rect.y) + ctx.arcTo(node.rect.x + node.rect.width, node.rect.y, node.rect.x + node.rect.width, node.rect.y + node.rect.height, r) + ctx.arcTo(node.rect.x + node.rect.width, node.rect.y + node.rect.height, node.rect.x, node.rect.y + node.rect.height, r) + ctx.arcTo(node.rect.x, node.rect.y + node.rect.height, node.rect.x, node.rect.y, r) + ctx.arcTo(node.rect.x, node.rect.y, node.rect.x + node.rect.width, node.rect.y, r) + ctx.closePath() + ctx.moveTo(node.rect.x, node.rect.y + 40) + ctx.lineTo(node.rect.ex, node.rect.y + 40); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=swimlaneV.js.map diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/swimlaneV.js.map b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/swimlaneV.js.map new file mode 100644 index 000000000..193a18b6c --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/swimlaneV.js.map @@ -0,0 +1 @@ +{"version":3,"file":"swimlaneV.js","sourceRoot":"","sources":["../../../../packages/activity-diagram/src/swimlaneV/swimlaneV.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,SAAS,CAAC,GAA6B,EAAE,IAAU;IACjE,IAAI,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC;IAC3B,IAAI,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC;IAC3B,IAAI,IAAI,CAAC,YAAY,GAAG,CAAC,EAAE;QACzB,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC;QACzC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC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I,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpF,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACnF,GAAG,CAAC,SAAS,EAAE,CAAC;IAEhB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAC1C,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAE3C,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/swimlaneV.rect.d.ts b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/swimlaneV.rect.d.ts new file mode 100644 index 000000000..9e8bfe1cc --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/swimlaneV.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '@topology/core'; +export declare function swimlaneVIconRect(node: Node): void; +export declare function swimlaneVTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/swimlaneV.rect.js b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/swimlaneV.rect.js new file mode 100644 index 000000000..4fed56e36 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/swimlaneV.rect.js @@ -0,0 +1,9 @@ +import { Rect } from '@topology/core' +export function swimlaneVIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function swimlaneVTextRect (node) { + node.textRect = new Rect(node.rect.x, node.rect.y, node.rect.width, 40) + node.fullTextRect = node.textRect +} +// # sourceMappingURL=swimlaneV.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/swimlaneV.rect.js.map b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/swimlaneV.rect.js.map new file mode 100644 index 000000000..65c6cb17c --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/activity-diagram/src/swimlaneV/swimlaneV.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"swimlaneV.rect.js","sourceRoot":"","sources":["../../../../packages/activity-diagram/src/swimlaneV/swimlaneV.rect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,iBAAiB,CAAC,IAAU;IAC1C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAU;IAC1C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACxE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/chart-diagram/index.d.ts b/nezha-fronted/src/components/common/@topology/chart-diagram/index.d.ts new file mode 100644 index 000000000..119062266 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/chart-diagram/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/echarts'; +export * from './src/register'; diff --git a/nezha-fronted/src/components/common/@topology/chart-diagram/index.js b/nezha-fronted/src/components/common/@topology/chart-diagram/index.js new file mode 100644 index 000000000..ce0c9323f --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/chart-diagram/index.js @@ -0,0 +1,3 @@ +export * from './src/echarts' +export * from './src/register' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/chart-diagram/index.js.map b/nezha-fronted/src/components/common/@topology/chart-diagram/index.js.map new file mode 100644 index 000000000..e96fe0e05 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/chart-diagram/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../packages/chart-diagram/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/chart-diagram/package.json b/nezha-fronted/src/components/common/@topology/chart-diagram/package.json new file mode 100644 index 000000000..3649ca6f5 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/chart-diagram/package.json @@ -0,0 +1,64 @@ +{ + "_args": [ + [ + "@topology/chart-diagram@0.3.0", + "D:\\a\\nezha-fronted\\nezha-fronted" + ] + ], + "_from": "@topology/chart-diagram@0.3.0", + "_id": "@topology/chart-diagram@0.3.0", + "_inBundle": false, + "_integrity": "sha512-WUfb62Op0QxS976cNqrJ1Xaq+pfURwpo67H3TENWb+OhoNfiBl9IDANxTr1UIPLYfsjqgN3Y/8lxkL33jEl/aQ==", + "_location": "/@topology/chart-diagram", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@topology/chart-diagram@0.3.0", + "name": "@topology/chart-diagram", + "escapedName": "@topology%2fchart-diagram", + "scope": "@topology", + "rawSpec": "0.3.0", + "saveSpec": null, + "fetchSpec": "0.3.0" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/@topology/chart-diagram/-/chart-diagram-0.3.0.tgz", + "_spec": "0.3.0", + "_where": "D:\\a\\nezha-fronted\\nezha-fronted", + "author": { + "name": "alsmile123@qq.com" + }, + "bugs": { + "url": "https://github.com/le5le-com/topology/issues" + }, + "description": "A chart tool using le5le-topology.", + "gitHead": "78f2a53ca1839c89b56e2e498d17ba4eb987ad14", + "homepage": "https://github.com/le5le-com/topology#readme", + "keywords": [ + "topology", + "chart", + "canvas" + ], + "license": "ISC", + "main": "index.js", + "name": "@topology/chart-diagram", + "peerDependencies": { + "@topology/core": "^0.3.0" + }, + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/le5le-com/topology.git" + }, + "scripts": { + "build": "tsc && npm run copy", + "copy": "copyfiles package.json ../../dist/chart-diagram/" + }, + "types": "index.d.ts", + "version": "0.3.0" +} diff --git a/nezha-fronted/src/components/common/@topology/chart-diagram/src/echarts/index.d.ts b/nezha-fronted/src/components/common/@topology/chart-diagram/src/echarts/index.d.ts new file mode 100644 index 000000000..2aa54d5d2 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/chart-diagram/src/echarts/index.d.ts @@ -0,0 +1,3 @@ +import { Node } from '@topology/core'; +export declare const echartsObjs: any; +export declare function echarts(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/chart-diagram/src/echarts/index.js b/nezha-fronted/src/components/common/@topology/chart-diagram/src/echarts/index.js new file mode 100644 index 000000000..c52ed5c0c --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/chart-diagram/src/echarts/index.js @@ -0,0 +1,44 @@ +import { s8, createDiv, rectangle } from '@topology/core' +export var echartsObjs = {} +export function echarts (ctx, node) { + // 绘制一个底图,类似于占位符。 + rectangle(ctx, node) + // tslint:disable-next-line:no-shadowed-variable + const echarts = echartsObjs.echarts || window.echarts + if (!node.data || !echarts) { + return + } + if (typeof node.data === 'string') { + node.data = JSON.parse(node.data) + } + if (!node.data.echarts) { + return + } + if (!node.elementId) { + node.elementId = s8() + } + if (!node.elementLoaded) { + echartsObjs[node.id] = { + div: createDiv(node) + } + node.elementLoaded = true + document.body.appendChild(echartsObjs[node.id].div) + // 添加当前节点到div层 + node.addToDiv() + echartsObjs[node.id].chart = echarts.init(echartsObjs[node.id].div, node.data.echarts.theme) + node.elementRendered = false + // 等待父div先渲染完成,避免初始图表控件太大 + setTimeout(function () { + echartsObjs[node.id].chart.resize() + }) + } + if (!node.elementRendered) { + // 初始化时,等待父div先渲染完成,避免初始图表控件太大。 + setTimeout(function () { + echartsObjs[node.id].chart.setOption(node.data.echarts.option) + echartsObjs[node.id].chart.resize() + node.elementRendered = true + }) + } +} +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/chart-diagram/src/echarts/index.js.map b/nezha-fronted/src/components/common/@topology/chart-diagram/src/echarts/index.js.map new file mode 100644 index 000000000..309265c7b --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/chart-diagram/src/echarts/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/chart-diagram/src/echarts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAQ,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhE,MAAM,CAAC,IAAM,WAAW,GAAQ,EAAE,CAAC;AAEnC,MAAM,UAAU,OAAO,CAAC,GAA6B,EAAE,IAAU;IAC/D,iBAAiB;IACjB,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAErB,gDAAgD;IAChD,IAAM,OAAO,GAAG,WAAW,CAAC,OAAO,IAAK,MAAc,CAAC,OAAO,CAAC;IAC/D,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE;QAC1B,OAAO;KACR;IAED,IAAI,O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,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YACpC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC9B,CAAC,CAAC,CAAC;KACJ;AACH,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/chart-diagram/src/register.d.ts b/nezha-fronted/src/components/common/@topology/chart-diagram/src/register.d.ts new file mode 100644 index 000000000..89904d135 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/chart-diagram/src/register.d.ts @@ -0,0 +1 @@ +export declare function register(_echarts?: any): void; diff --git a/nezha-fronted/src/components/common/@topology/chart-diagram/src/register.js b/nezha-fronted/src/components/common/@topology/chart-diagram/src/register.js new file mode 100644 index 000000000..dbda365c6 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/chart-diagram/src/register.js @@ -0,0 +1,10 @@ +import { registerNode, loadJS } from '@topology/core' +import { echarts, echartsObjs } from './echarts' +export function register (_echarts) { + echartsObjs.echarts = _echarts + if (!echartsObjs.echarts && !window.echarts) { + loadJS('https://cdn.bootcdn.net/ajax/libs/echarts/4.8.0/echarts.min.js', null, true) + } + registerNode('echarts', echarts, null, null, null) +} +// # sourceMappingURL=register.js.map diff --git a/nezha-fronted/src/components/common/@topology/chart-diagram/src/register.js.map b/nezha-fronted/src/components/common/@topology/chart-diagram/src/register.js.map new file mode 100644 index 000000000..68e6b3a5c --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/chart-diagram/src/register.js.map @@ -0,0 +1 @@ +{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../packages/chart-diagram/src/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAEjD,MAAM,UAAU,QAAQ,CAAC,QAAc;IACrC,WAAW,CAAC,OAAO,GAAG,QAAQ,CAAC;IAC/B,IAAI,CAAC,WAAW,CAAC,OAAO,IAAI,CAAE,MAAc,CAAC,OAAO,EAAE;QACpD,MAAM,CACJ,gEAAgE,EAChE,IAAI,EACJ,IAAI,CACL,CAAC;KACH;IACD,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACrD,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/class-diagram/index.d.ts b/nezha-fronted/src/components/common/@topology/class-diagram/index.d.ts new file mode 100644 index 000000000..bd76e8222 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/class-diagram/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/class'; +export * from './src/register'; diff --git a/nezha-fronted/src/components/common/@topology/class-diagram/index.js b/nezha-fronted/src/components/common/@topology/class-diagram/index.js new file mode 100644 index 000000000..2d0c5b9d5 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/class-diagram/index.js @@ -0,0 +1,3 @@ +export * from './src/class' +export * from './src/register' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/class-diagram/index.js.map b/nezha-fronted/src/components/common/@topology/class-diagram/index.js.map new file mode 100644 index 000000000..d69407a93 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/class-diagram/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../packages/class-diagram/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/class-diagram/package.json b/nezha-fronted/src/components/common/@topology/class-diagram/package.json new file mode 100644 index 000000000..7023c2e24 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/class-diagram/package.json @@ -0,0 +1,64 @@ +{ + "_args": [ + [ + "@topology/class-diagram@0.3.0", + "D:\\a\\nezha-fronted\\nezha-fronted" + ] + ], + "_from": "@topology/class-diagram@0.3.0", + "_id": "@topology/class-diagram@0.3.0", + "_inBundle": false, + "_integrity": "sha512-J+qKEg/+3EyyZotP2TbZtM+NcOeRh2PIEwzBZGS6KOU5RvBi4NMRO2DQNN++q8Zpb7RG7WYGAaTB2H4+YcXJzA==", + "_location": "/@topology/class-diagram", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@topology/class-diagram@0.3.0", + "name": "@topology/class-diagram", + "escapedName": "@topology%2fclass-diagram", + "scope": "@topology", + "rawSpec": "0.3.0", + "saveSpec": null, + "fetchSpec": "0.3.0" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/@topology/class-diagram/-/class-diagram-0.3.0.tgz", + "_spec": "0.3.0", + "_where": "D:\\a\\nezha-fronted\\nezha-fronted", + "author": { + "name": "alsmile123@qq.com" + }, + "bugs": { + "url": "https://github.com/le5le-com/topology/issues" + }, + "description": "A class diagram tool using le5le-topology.", + "gitHead": "78f2a53ca1839c89b56e2e498d17ba4eb987ad14", + "homepage": "https://github.com/le5le-com/topology#readme", + "keywords": [ + "topology", + "class diagram", + "canvas" + ], + "license": "ISC", + "main": "index.js", + "name": "@topology/class-diagram", + "peerDependencies": { + "@topology/core": "^0.3.0" + }, + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/le5le-com/topology.git" + }, + "scripts": { + "build": "tsc && npm run copy", + "copy": "copyfiles package.json ../../dist/class-diagram/" + }, + "types": "index.d.ts", + "version": "0.3.0" +} diff --git a/nezha-fronted/src/components/common/@topology/class-diagram/src/class/class.d.ts b/nezha-fronted/src/components/common/@topology/class-diagram/src/class/class.d.ts new file mode 100644 index 000000000..2f34e2b63 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/class-diagram/src/class/class.d.ts @@ -0,0 +1,3 @@ +import { Node } from '@topology/core'; +export declare function simpleClass(ctx: CanvasRenderingContext2D, node: Node): void; +export declare function interfaceClass(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/class-diagram/src/class/class.js b/nezha-fronted/src/components/common/@topology/class-diagram/src/class/class.js new file mode 100644 index 000000000..9604c76ff --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/class-diagram/src/class/class.js @@ -0,0 +1,56 @@ +export function simpleClass (ctx, node) { + let wr = node.borderRadius + let hr = node.borderRadius + if (node.borderRadius < 1) { + wr = node.rect.width * node.borderRadius + hr = node.rect.height * node.borderRadius + } + let r = wr < hr ? wr : hr + if (node.rect.width < 2 * r) { + r = node.rect.width / 2 + } + if (node.rect.height < 2 * r) { + r = node.rect.height / 2 + } + ctx.beginPath() + ctx.moveTo(node.rect.x + r, node.rect.y) + ctx.arcTo(node.rect.x + node.rect.width, node.rect.y, node.rect.x + node.rect.width, node.rect.y + node.rect.height, r) + ctx.arcTo(node.rect.x + node.rect.width, node.rect.y + node.rect.height, node.rect.x, node.rect.y + node.rect.height, r) + ctx.arcTo(node.rect.x, node.rect.y + node.rect.height, node.rect.x, node.rect.y, r) + ctx.arcTo(node.rect.x, node.rect.y, node.rect.x + node.rect.width, node.rect.y, r) + ctx.closePath() + ctx.moveTo(node.rect.x, node.rect.y + 40) + ctx.lineTo(node.rect.ex, node.rect.y + 40); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +export function interfaceClass (ctx, node) { + let wr = node.borderRadius + let hr = node.borderRadius + if (node.borderRadius < 1) { + wr = node.rect.width * node.borderRadius + hr = node.rect.height * node.borderRadius + } + let r = wr < hr ? wr : hr + if (node.rect.width < 2 * r) { + r = node.rect.width / 2 + } + if (node.rect.height < 2 * r) { + r = node.rect.height / 2 + } + ctx.beginPath() + ctx.moveTo(node.rect.x + r, node.rect.y) + ctx.arcTo(node.rect.x + node.rect.width, node.rect.y, node.rect.x + node.rect.width, node.rect.y + node.rect.height, r) + ctx.arcTo(node.rect.x + node.rect.width, node.rect.y + node.rect.height, node.rect.x, node.rect.y + node.rect.height, r) + ctx.arcTo(node.rect.x, node.rect.y + node.rect.height, node.rect.x, node.rect.y, r) + ctx.arcTo(node.rect.x, node.rect.y, node.rect.x + node.rect.width, node.rect.y, r) + ctx.closePath() + ctx.moveTo(node.rect.x, node.rect.y + 40) + ctx.lineTo(node.rect.ex, node.rect.y + 40) + const height = node.rect.y + 20 + node.rect.height / 2 + ctx.moveTo(node.rect.x, height) + ctx.lineTo(node.rect.ex, height); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=class.js.map diff --git a/nezha-fronted/src/components/common/@topology/class-diagram/src/class/class.js.map b/nezha-fronted/src/components/common/@topology/class-diagram/src/class/class.js.map new file mode 100644 index 000000000..a7711b3dd --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/class-diagram/src/class/class.js.map @@ -0,0 +1 @@ +{"version":3,"file":"class.js","sourceRoot":"","sources":["../../../../packages/class-diagram/src/class/class.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,WAAW,CAAC,GAA6B,EAAE,IAAU;IACnE,IAAI,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC;IAC3B,IAAI,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC;IAC3B,IAAI,IAAI,CAAC,YAAY,GAAG,CAAC,EAAE;QACzB,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC;QACzC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC;KAC3C;IACD,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1B,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,EAAE;QAC3B,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;KACzB;IACD,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,EAAE;QAC5B,CAAC,GAAG,IAAI,CAA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AAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAC1C,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAE3C,IAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACvD,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAChC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IAEjC,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/class-diagram/src/class/class.rect.d.ts b/nezha-fronted/src/components/common/@topology/class-diagram/src/class/class.rect.d.ts new file mode 100644 index 000000000..8b4a9352e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/class-diagram/src/class/class.rect.d.ts @@ -0,0 +1,5 @@ +import { Node } from '@topology/core'; +export declare function simpleClassIconRect(node: Node): void; +export declare function simpleClassTextRect(node: Node): void; +export declare function interfaceClassIconRect(node: Node): void; +export declare function interfaceClassTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/class-diagram/src/class/class.rect.js b/nezha-fronted/src/components/common/@topology/class-diagram/src/class/class.rect.js new file mode 100644 index 000000000..7390b41f6 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/class-diagram/src/class/class.rect.js @@ -0,0 +1,16 @@ +import { Rect } from '@topology/core' +export function simpleClassIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function simpleClassTextRect (node) { + node.textRect = new Rect(node.rect.x, node.rect.y, node.rect.width, 40) + node.fullTextRect = node.textRect +} +export function interfaceClassIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function interfaceClassTextRect (node) { + node.textRect = new Rect(node.rect.x, node.rect.y, node.rect.width, 40) + node.fullTextRect = node.textRect +} +// # sourceMappingURL=class.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/class-diagram/src/class/class.rect.js.map b/nezha-fronted/src/components/common/@topology/class-diagram/src/class/class.rect.js.map new file mode 100644 index 000000000..0d45d0a3d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/class-diagram/src/class/class.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"class.rect.js","sourceRoot":"","sources":["../../../../packages/class-diagram/src/class/class.rect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,mBAAmB,CAAC,IAAU;IAC5C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,IAAU;IAC5C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACxE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,IAAU;IAC/C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,IAAU;IAC/C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACxE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/class-diagram/src/class/index.d.ts b/nezha-fronted/src/components/common/@topology/class-diagram/src/class/index.d.ts new file mode 100644 index 000000000..50e9c5444 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/class-diagram/src/class/index.d.ts @@ -0,0 +1,2 @@ +export * from './class'; +export * from './class.rect'; diff --git a/nezha-fronted/src/components/common/@topology/class-diagram/src/class/index.js b/nezha-fronted/src/components/common/@topology/class-diagram/src/class/index.js new file mode 100644 index 000000000..6b4f15d6e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/class-diagram/src/class/index.js @@ -0,0 +1,3 @@ +export * from './class' +export * from './class.rect' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/class-diagram/src/class/index.js.map b/nezha-fronted/src/components/common/@topology/class-diagram/src/class/index.js.map new file mode 100644 index 000000000..7f43317ae --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/class-diagram/src/class/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/class-diagram/src/class/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/class-diagram/src/register.d.ts b/nezha-fronted/src/components/common/@topology/class-diagram/src/register.d.ts new file mode 100644 index 000000000..bf35c08a1 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/class-diagram/src/register.d.ts @@ -0,0 +1 @@ +export declare function register(): void; diff --git a/nezha-fronted/src/components/common/@topology/class-diagram/src/register.js b/nezha-fronted/src/components/common/@topology/class-diagram/src/register.js new file mode 100644 index 000000000..1801d39fa --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/class-diagram/src/register.js @@ -0,0 +1,7 @@ +import { registerNode } from '@topology/core' +import { simpleClass, simpleClassIconRect, simpleClassTextRect, interfaceClass, interfaceClassIconRect, interfaceClassTextRect } from './class' +export function register () { + registerNode('simpleClass', simpleClass, null, simpleClassIconRect, simpleClassTextRect) + registerNode('interfaceClass', interfaceClass, null, interfaceClassIconRect, interfaceClassTextRect) +} +// # sourceMappingURL=register.js.map diff --git a/nezha-fronted/src/components/common/@topology/class-diagram/src/register.js.map b/nezha-fronted/src/components/common/@topology/class-diagram/src/register.js.map new file mode 100644 index 000000000..c109b760f --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/class-diagram/src/register.js.map @@ -0,0 +1 @@ +{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../packages/class-diagram/src/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,WAAW,EAAE,mBAAmB,EAAE,mBAAmB,EACrD,cAAc,EAAE,sBAAsB,EAAE,sBAAsB,EAC/D,MAAM,SAAS,CAAC;AAEjB,MAAM,UAAU,QAAQ;IACtB,YAAY,CAAC,aAAa,EAAE,WAAW,EAAE,IAAI,EAAE,mBAAmB,EAAE,mBAAmB,CAAC,CAAC;IACzF,YAAY,CAAC,gBAAgB,EAAE,cAAc,EAAE,IAAI,EAAE,sBAAsB,EAAE,sBAAsB,CAAC,CAAC;AACvG,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/index.d.ts b/nezha-fronted/src/components/common/@topology/core/index.d.ts new file mode 100644 index 000000000..a5d4779fa --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/index.d.ts @@ -0,0 +1,5 @@ +export * from './src/core'; +export * from './src/options'; +export * from './src/utils'; +export * from './src/models'; +export * from './src/middles'; diff --git a/nezha-fronted/src/components/common/@topology/core/index.js b/nezha-fronted/src/components/common/@topology/core/index.js new file mode 100644 index 000000000..91e1ba983 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/index.js @@ -0,0 +1,6 @@ +export * from './src/core' +export * from './src/options' +export * from './src/utils' +export * from './src/models' +export * from './src/middles' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/index.js.map b/nezha-fronted/src/components/common/@topology/core/index.js.map new file mode 100644 index 000000000..47105b087 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../packages/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/package.json b/nezha-fronted/src/components/common/@topology/core/package.json new file mode 100644 index 000000000..da58e5305 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/package.json @@ -0,0 +1,66 @@ +{ + "_args": [ + [ + "@topology/core@0.5.33", + "D:\\a\\nezha-fronted\\nezha-fronted" + ] + ], + "_from": "@topology/core@0.5.33", + "_id": "@topology/core@0.5.33", + "_inBundle": false, + "_integrity": "sha1-aS5eoCUEDbrh/TGxl2rCXmdu8ww=", + "_location": "/@topology/core", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@topology/core@0.5.33", + "name": "@topology/core", + "escapedName": "@topology%2fcore", + "scope": "@topology", + "rawSpec": "0.5.33", + "saveSpec": null, + "fetchSpec": "0.5.33" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmmirror.com/@topology/core/download/@topology/core-0.5.33.tgz", + "_spec": "0.5.33", + "_where": "D:\\a\\nezha-fronted\\nezha-fronted", + "author": { + "name": "alsmile123@qq.com" + }, + "bugs": { + "url": "https://github.com/le5le-com/topology/issues" + }, + "dependencies": { + "le5le-store": "^1.0.7", + "mitt": "^2.1.0", + "mqtt": "^4.2.6" + }, + "description": "A diagram/topology tool by js.", + "gitHead": "78f2a53ca1839c89b56e2e498d17ba4eb987ad14", + "homepage": "https://github.com/le5le-com/topology#readme", + "keywords": [ + "topology", + "diagram", + "canvas" + ], + "license": "ISC", + "main": "index.js", + "name": "@topology/core", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/le5le-com/topology.git" + }, + "scripts": { + "build": "tsc && npm run copy", + "copy": "copyfiles package.json ../../dist/core/" + }, + "types": "index.d.ts", + "version": "0.5.33" +} diff --git a/nezha-fronted/src/components/common/@topology/core/src/activeLayer.d.ts b/nezha-fronted/src/components/common/@topology/core/src/activeLayer.d.ts new file mode 100644 index 000000000..5e57ff8df --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/activeLayer.d.ts @@ -0,0 +1,60 @@ +import { Options } from './options'; +import { Pen } from './models/pen'; +import { Node } from './models/node'; +import { Line } from './models/line'; +import { Rect } from './models/rect'; +import { Point } from './models/point'; +import { Layer } from './layer'; +import { Topology } from './core'; +export declare class ActiveLayer extends Layer { + options: Options; + rotateCPs: Point[]; + sizeCPs: Point[]; + rect: Rect; + activeRect: Rect; + pens: Pen[]; + rotate: number; + lastOffsetX: number; + lastOffsetY: number; + initialSizeCPs: Point[]; + nodeRects: Rect[]; + childrenRects: { + [key: string]: Rect; + }; + childrenRotate: { + [key: string]: number; + }; + dockWatchers: Point[]; + topology: Topology; + rotating: boolean; + constructor(options: Options, TID: string); + calcControlPoints(): void; + locked(): boolean; + getPoints(): Point[]; + clear(): void; + saveNodeRects(): void; + private saveChildrenRects; + resize(type: number, pt1: { + x: number; + y: number; + }, pt2: { + x: number; + y: number; + ctrlKey?: boolean; + altKey?: boolean; + shiftKey?: boolean; + }): void; + move(x: number, y: number): void; + getLinesOfNode(node: Node): Line[]; + updateLines(pens?: Pen[]): void; + offsetRotate(angle: number): void; + rotateChildren(node: Pen): void; + updateRotate(): void; + add(pen: Pen): void; + setPens(pens: Pen[]): void; + has(pen: Pen): boolean; + hasInAll(pen: Pen, pens?: Pen[]): boolean; + render(ctx: CanvasRenderingContext2D): void; + calcActiveRect(): void; + getDockWatchers(): void; +} diff --git a/nezha-fronted/src/components/common/@topology/core/src/activeLayer.js b/nezha-fronted/src/components/common/@topology/core/src/activeLayer.js new file mode 100644 index 000000000..f78094229 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/activeLayer.js @@ -0,0 +1,735 @@ +import { Store } from 'le5le-store' +import { PenType } from './models/pen' +import { Node } from './models/node' +import { Line } from './models/line' +import { Rect } from './models/rect' +import { Point } from './models/point' +import { Lock } from './models/status' +import { drawLineFns } from './middles' +import { getBezierPoint } from './middles/lines/curve' +import { Layer } from './layer' +import { find, flatNodes, getBboxOfPoints, rgba, deepClone, getRect } from './utils' +const __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b }) || + function (d, b) { for (const p in b) if (b.hasOwnProperty(p)) d[p] = b[p] } + return extendStatics(d, b) + } + return function (d, b) { + extendStatics(d, b) + function __ () { this.constructor = d } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()) + } +})() +const ActiveLayer = /** @class */ (function (_super) { + __extends(ActiveLayer, _super) + function ActiveLayer (options, TID) { + if (options === void 0) { options = {} } + const _this = _super.call(this, TID) || this + _this.options = options + _this.rotateCPs = [] + _this.sizeCPs = [] + _this.pens = [] + _this.rotate = 0 + _this.lastOffsetX = 0 + _this.lastOffsetY = 0 + // 备份初始位置,方便移动事件处理 + _this.initialSizeCPs = [] + _this.nodeRects = [] + _this.childrenRects = {} + _this.childrenRotate = {} + // nodes移动时,停靠点的参考位置 + _this.dockWatchers = [] + _this.rotating = false + Store.set(_this.generateStoreKey('LT:ActiveLayer'), _this) + return _this + } + ActiveLayer.prototype.calcControlPoints = function () { + if (this.pens.length === 1 && this.pens[0] instanceof Node) { + this.rect = this.pens[0].rect + this.sizeCPs = this.pens[0].rect.toPoints() + this.rotateCPs = [ + new Point(this.pens[0].rect.x + this.pens[0].rect.width / 2, this.pens[0].rect.y - 35), + new Point(this.pens[0].rect.x + this.pens[0].rect.width / 2, this.pens[0].rect.y) + ] + if (this.rotate || this.pens[0].rotate) { + for (let _i = 0, _a = this.sizeCPs; _i < _a.length; _i++) { + var pt = _a[_i] + if (this.pens[0].rotate) { + pt.rotate(this.pens[0].rotate, this.pens[0].rect.center) + } + if (this.rotate) { + pt.rotate(this.rotate, this.rect.center) + } + } + for (let _b = 0, _c = this.rotateCPs; _b < _c.length; _b++) { + var pt = _c[_b] + if (this.pens[0].rotate) { + pt.rotate(this.pens[0].rotate, this.pens[0].rect.center) + } + if (this.rotate) { + pt.rotate(this.rotate, this.rect.center) + } + } + } + if (this.options.hideRotateCP || this.pens[0].hideRotateCP) { + this.rotateCPs = [new Point(-1000, -1000), new Point(-1000, -1000)] + } + return + } + const _d = getBboxOfPoints(this.getPoints()); const x1 = _d.x1; const y1 = _d.y1; const x2 = _d.x2; const y2 = _d.y2 + this.rect = new Rect(x1, y1, x2 - x1, y2 - y1) + this.sizeCPs = [ + new Point(x1, y1), + new Point(x2, y1), + new Point(x2, y2), + new Point(x1, y2) + ] + this.rotateCPs = [ + new Point(x1 + (x2 - x1) / 2, y1 - 35), + new Point(x1 + (x2 - x1) / 2, y1) + ] + if (this.options.hideRotateCP) { + this.rotateCPs = [new Point(-1000, -1000), new Point(-1000, -1000)] + } + } + ActiveLayer.prototype.locked = function () { + for (let _i = 0, _a = this.pens; _i < _a.length; _i++) { + const item = _a[_i] + if (!item.locked) { + return false + } + } + return true + } + ActiveLayer.prototype.getPoints = function () { + const points = [] + for (let _i = 0, _a = this.pens; _i < _a.length; _i++) { + const item = _a[_i] + if (item.type === PenType.Node) { + const pts = item.rect.toPoints() + if (item.rotate) { + for (let _b = 0, pts_1 = pts; _b < pts_1.length; _b++) { + const pt = pts_1[_b] + pt.rotate(item.rotate, item.rect.center) + } + } + points.push.apply(points, pts) + } else if (item instanceof Line) { + if (item.children) { + item.children.forEach(function (child) { + points.push(child.from) + points.push(child.to) + if (child.name === 'curve') { + for (let i = 0.01; i < 1; i += 0.02) { + points.push(getBezierPoint(i, child.from, child.controlPoints[0], child.controlPoints[1], child.to)) + } + } + }) + } else if (item.from) { + points.push(item.from) + points.push(item.to) + if (item.name === 'curve') { + for (let i = 0.01; i < 1; i += 0.02) { + points.push(getBezierPoint(i, item.from, item.controlPoints[0], item.controlPoints[1], item.to)) + } + } + } + } + } + return points + } + ActiveLayer.prototype.clear = function () { + this.pens = [] + this.sizeCPs = [] + this.rotateCPs = [] + Store.set(this.generateStoreKey('LT:activeNode'), undefined) + } + // 即将缩放选中的nodes,备份nodes最初大小,方便缩放比例计算 + ActiveLayer.prototype.saveNodeRects = function () { + this.nodeRects = [] + this.childrenRects = {} + for (let _i = 0, _a = this.pens; _i < _a.length; _i++) { + var item = _a[_i] + if (item.type && item.from) { + this.nodeRects.push(new Rect(item.from.x, item.from.y, item.rect.width, item.rect.height)) + } else { + this.nodeRects.push(new Rect(item.rect.x, item.rect.y, item.rect.width, item.rect.height)) + } + this.saveChildrenRects(item) + } + this.initialSizeCPs = [] + for (let _b = 0, _c = this.sizeCPs; _b < _c.length; _b++) { + var item = _c[_b] + this.initialSizeCPs.push(item.clone()) + } + this.getDockWatchers() + } + ActiveLayer.prototype.saveChildrenRects = function (node) { + if (node.type || !node.children) { + return + } + for (let _i = 0, _a = node.children; _i < _a.length; _i++) { + const item = _a[_i] + this.childrenRects[item.id] = new Rect(item.rect.x, item.rect.y, item.rect.width, item.rect.height) + this.childrenRotate[item.id] = item.rotate + this.saveChildrenRects(item) + } + } + // pt1 - the point of mouse down. + // pt2 - the point of mouse move. + ActiveLayer.prototype.resize = function (type, pt1, pt2) { + const p1 = new Point(pt1.x, pt1.y) + const p2 = new Point(pt2.x, pt2.y) + if (this.pens.length === 1 && this.pens[0].rotate % 360) { + p1.rotate(-this.pens[0].rotate, this.nodeRects[0].center) + p2.rotate(-this.pens[0].rotate, this.nodeRects[0].center) + } + const x = p2.x - p1.x + const y = p2.y - p1.y + let offsetX = x - this.lastOffsetX + let offsetY = y - this.lastOffsetY + this.lastOffsetX = x + this.lastOffsetY = y + const w = this.activeRect.width + const h = this.activeRect.height + if (pt2.shiftKey) { + offsetY = (offsetX * h) / w + } + // const lines: Line[] = []; + switch (type) { + case 0: + if (this.activeRect.width - offsetX < 5 || this.activeRect.height - offsetY < 5) { + return + } + if (!pt2.shiftKey) { + // offsetX = -offsetX; + // offsetY = -offsetY; + this.activeRect.x += offsetX + this.activeRect.y += offsetY + this.activeRect.width -= offsetX + this.activeRect.height -= offsetY + } else { + offsetX = -offsetX + offsetY = -offsetY + this.activeRect.ex += offsetX + this.activeRect.ey += offsetY + this.activeRect.width += offsetX + this.activeRect.height += offsetY + } + break + case 1: + // offsetY = -offsetY; + if (this.activeRect.width + offsetX < 5 || this.activeRect.height - offsetY < 5) { + return + } + if (!pt2.shiftKey) { + this.activeRect.ex += offsetX + this.activeRect.y += offsetY + this.activeRect.width += offsetX + this.activeRect.height -= offsetY + } else { + // offsetX = -offsetX; + // offsetY = -offsetY; + this.activeRect.ex += offsetX + this.activeRect.ey += offsetY + this.activeRect.width += offsetX + this.activeRect.height += offsetY + } + break + case 2: + if (this.activeRect.width + offsetX < 5 || this.activeRect.height + offsetY < 5) { + return + } + this.activeRect.ex += offsetX + this.activeRect.ey += offsetY + this.activeRect.width += offsetX + this.activeRect.height += offsetY + break + case 3: + // offsetX = -offsetX; + if (this.activeRect.width - offsetX < 5 || this.activeRect.height + offsetY < 5) { + return + } + if (!pt2.shiftKey) { + this.activeRect.x += offsetX + this.activeRect.ey += offsetY + this.activeRect.width -= offsetX + this.activeRect.height += offsetY + } else { + offsetX = -offsetX + offsetY = -offsetY + this.activeRect.ex += offsetX + this.activeRect.ey += offsetY + this.activeRect.width += offsetX + this.activeRect.height += offsetY + } + break + } + const scaleX = this.activeRect.width / w + const scaleY = this.activeRect.height / h + // let i = 0; + for (let _i = 0, _a = this.pens; _i < _a.length; _i++) { + const item = _a[_i] + if (item.locked) { + continue + } + switch (item.type) { + case PenType.Line: + break + default: + item.oldRect = item.rect.clone() + if (!this.options.disableSizeX && + !pt2.ctrlKey && + !item.disableSizeX) { + // item.rect.width = this.nodeRects[i].width + offsetX; + item.rect.width *= scaleX + if (item.imageWidth) { + item.imageWidth *= scaleX + } + } + if (!this.options.disableSizeY && + !pt2.altKey && + !item.disableSizeY) { + // item.rect.height = this.nodeRects[i].height + offsetY; + item.rect.height *= scaleY + if (item.imageHeight) { + item.imageHeight *= scaleY + } + } + if ((!this.options.disableSizeX && + pt2.shiftKey && + !item.disableSizeX) || + (!this.options.disableSizeY && + pt2.shiftKey && + !item.disableSizeY)) { + // item.rect.width = this.nodeRects[i].width + offsetX; + // item.rect.height = this.nodeRects[i].height + offsetY; + item.rect.width *= scaleX + item.rect.height *= scaleY + if (item.imageWidth) { + item.imageWidth *= scaleX + } + if (item.imageHeight) { + item.imageHeight *= scaleY + } + } + switch (type) { + case 0: + item.rect.x = item.rect.ex - item.rect.width + item.rect.y = item.rect.ey - item.rect.height + break + case 1: + item.rect.ex = item.rect.x + item.rect.width + item.rect.y = item.rect.ey - item.rect.height + break + case 2: + item.rect.ex = item.rect.x + item.rect.width + item.rect.ey = item.rect.y + item.rect.height + break + case 3: + item.rect.x = item.rect.ex - item.rect.width + item.rect.ey = item.rect.y + item.rect.height + break + } + item.scalePoints() + item.rect.calcCenter() + item.init() + item.calcChildrenRect() + break + } + if (item.parentId) { + let parent_1 = void 0 + for (let _b = 0, _c = this.data.pens; _b < _c.length; _b++) { + const n = _c[_b] + if (n.id === item.parentId) { + parent_1 = n + item.calcRectInParent(parent_1) + break + } + } + } + // ++i; + } + this.updateLines() + } + ActiveLayer.prototype.move = function (x, y) { + if (this.nodeRects.length !== this.pens.length) { + return + } + let i = 0 + const _loop_1 = function (item) { + if (item.locked) { + return 'continue' + } + if (item instanceof Node) { + const offsetX = this_1.nodeRects[i].x + x - item.rect.x + const offsetY = this_1.nodeRects[i].y + y - item.rect.y + item.translate(offsetX, offsetY) + const lines = this_1.getLinesOfNode(item) + for (let _i = 0, lines_1 = lines; _i < lines_1.length; _i++) { + const line = lines_1[_i] + line.translate(offsetX, offsetY) + } + item.calcChildrenRect() + if (item.parentId && !item.locked) { + let parent_2 = void 0 + for (let _a = 0, _b = this_1.data.pens; _a < _b.length; _a++) { + const n = _b[_a] + if (n.id === item.parentId) { + parent_2 = n + item.calcRectInParent(parent_2) + break + } + } + } + } + if (item instanceof Line && item.from) { + const offsetX_1 = this_1.nodeRects[i].x + x - item.from.x + const offsetY_1 = this_1.nodeRects[i].y + y - item.from.y + if (item.parentId) { + const items = find(item.parentId, this_1.data.pens) + items.forEach(function (l) { + l.translate(offsetX_1, offsetY_1) + }) + } else { + item.translate(offsetX_1, offsetY_1) + } + } + ++i + } + var this_1 = this + for (let _i = 0, _a = this.pens; _i < _a.length; _i++) { + const item = _a[_i] + _loop_1(item) + } + this.updateLines() + this.topology.dispatch('move', this.pens) + } + ActiveLayer.prototype.getLinesOfNode = function (node) { + const result = [] + const nodesLines = flatNodes([node]) + for (let _i = 0, _a = this.data.pens; _i < _a.length; _i++) { + const pen = _a[_i] + if (!(pen instanceof Line)) { + continue + } + const line = pen + let fromIn = false + let toIn = false + for (let _b = 0, _c = nodesLines.nodes; _b < _c.length; _b++) { + const item = _c[_b] + if (line.from && line.from.id === item.id) { + fromIn = true + } + if (line.to && line.to.id === item.id) { + toIn = true + } + } + if (fromIn && toIn) { + result.push(line) + } + } + return result + } + ActiveLayer.prototype.updateLines = function (pens) { + if (!pens) { + pens = this.pens + } + const allPens = flatNodes(this.data.pens) + const allLines = allPens.lines + let nodes = allPens.nodes + if (!this.options.autoAnchor) { // 非自动瞄点,只要活动层的 nodes + nodes = flatNodes(pens).nodes + } + const lines = [] + for (let _i = 0, allLines_1 = allLines; _i < allLines_1.length; _i++) { + const line = allLines_1[_i] + for (let _a = 0, nodes_1 = nodes; _a < nodes_1.length; _a++) { + const item = nodes_1[_a] + let cnt = 0 + if (line.from && line.from.id === item.id) { + if (line.from.autoAnchor) { + var autoAnchor = item.nearestAnchor(line.to) + if (autoAnchor.index > -1) { + line.from.anchorIndex = autoAnchor.index + line.from.direction = autoAnchor.direction + } + } + if (line.from.anchorIndex >= 0) { + line.from.x = item.rotatedAnchors[line.from.anchorIndex].x + line.from.y = item.rotatedAnchors[line.from.anchorIndex].y + ++cnt + } + } + if (line.to && line.to.id === item.id) { + if (line.to.autoAnchor) { + var autoAnchor = item.nearestAnchor(line.from) + if (autoAnchor.index > -1) { + line.to.anchorIndex = autoAnchor.index + line.to.direction = autoAnchor.direction + } + } + if (line.to.anchorIndex >= 0) { + line.to.x = item.rotatedAnchors[line.to.anchorIndex].x + line.to.y = item.rotatedAnchors[line.to.anchorIndex].y + ++cnt + } + } + if (cnt && !this.data.manualCps) { + line.calcControlPoints() + } + line.textRect = undefined + Store.set(this.generateStoreKey('pts-') + line.id, undefined) + lines.push(line) + } + } + Store.set(this.generateStoreKey('LT:updateLines'), lines) + } + ActiveLayer.prototype.offsetRotate = function (angle) { + this.rotating = true + let i = 0 + for (let _i = 0, _a = this.pens; _i < _a.length; _i++) { + const item = _a[_i] + if (!(item instanceof Node)) { + continue + } + const center = this.nodeRects[i].center.clone() + if (this.pens.length > 1) { + center.rotate(angle, this.rect.center) + } + item.rect.x = center.x - item.rect.width / 2 + item.rect.y = center.y - item.rect.height / 2 + item.rect.ex = item.rect.x + item.rect.width + item.rect.ey = item.rect.y + item.rect.height + item.rect.calcCenter() + item.init() + item.offsetRotate = angle + item.calcRotateAnchors(item.rotate + item.offsetRotate) + this.rotateChildren(item) + ++i + } + this.rotate = angle + this.topology.dispatch('rotated', this.pens) + } + ActiveLayer.prototype.rotateChildren = function (node) { + if (node.type !== PenType.Node || !node.children) { + return + } + for (let _i = 0, _a = node.children; _i < _a.length; _i++) { + const item = _a[_i] + if (item.type !== PenType.Node) { + continue + } + const oldCenter = this.childrenRects[item.id].center.clone() + const newCenter = this.childrenRects[item.id].center + .clone() + .rotate(this.rotate, this.rect.center) + const rect = this.childrenRects[item.id].clone() + rect.translate(newCenter.x - oldCenter.x, newCenter.y - oldCenter.y) + item.rect = rect + item.rotate = this.childrenRotate[item.id] + this.rotate + item.init() + this.rotateChildren(item) + } + } + ActiveLayer.prototype.updateRotate = function () { + for (let _i = 0, _a = this.pens; _i < _a.length; _i++) { + const item = _a[_i] + item.rotate += item.offsetRotate + if (item.type === PenType.Node && item.rectInParent) { + item.rectInParent.rotate += item.offsetRotate + } + item.offsetRotate = 0 + } + this.rotate = 0 + this.rotating = false + } + ActiveLayer.prototype.add = function (pen) { + if (this.has(pen)) { + return + } + this.pens.push(pen) + if (pen instanceof Node) { + Store.set(this.generateStoreKey('LT:activeNode'), pen) + } + } + ActiveLayer.prototype.setPens = function (pens) { + this.pens = pens + if (this.pens.length === 1 && this.pens[0] instanceof Node) { + Store.set(this.generateStoreKey('LT:activeNode'), this.pens[0]) + } + } + ActiveLayer.prototype.has = function (pen) { + for (let _i = 0, _a = this.pens; _i < _a.length; _i++) { + const item = _a[_i] + if (item.id === pen.id) { + return true + } + } + return false + } + ActiveLayer.prototype.hasInAll = function (pen, pens) { + if (!pens) { + pens = this.pens + } + for (let _i = 0, pens_1 = pens; _i < pens_1.length; _i++) { + const item = pens_1[_i] + if (item.id === pen.id) { + return true + } + if (item.children) { + const has = this.hasInAll(pen, item.children) + if (has) { + return true + } + } + } + return false + } + ActiveLayer.prototype.render = function (ctx) { + const _this = this + if (this.data.locked > Lock.Readonly || + this.options.activeColor === 'transparent') { + return + } + if (!this.pens.length) { + return + } + this.pens.forEach(function (pen) { + if (!pen.getTID()) { + pen.setTID(_this.TID) + } + }) + if (this.pens.length === 1 || !this.rotating) { + this.calcControlPoints() + } + ctx.save() + ctx.strokeStyle = this.options.activeColor + ctx.fillStyle = '#fff' + ctx.lineWidth = 1 + const TID = this.TID + const scale = Store.get(this.generateStoreKey('LT:scale')) || 1 + for (let _i = 0, _a = this.pens; _i < _a.length; _i++) { + var item = _a[_i] + if (this.data.locked && item instanceof Node) { + var tmp = new Node(item) + tmp.setTID(TID) + tmp.data = undefined + tmp.fillStyle = undefined + tmp.bkType = 0 + tmp.icon = '' + tmp.image = '' + tmp.text = '' + if (tmp.strokeStyle !== 'transparent') { + tmp.strokeStyle = '#ffffff' + tmp.lineWidth += 2 + tmp.render(ctx) + tmp.strokeStyle = this.options.activeColor + tmp.lineWidth -= 2 + } + tmp.render(ctx) + } + if (item instanceof Line) { + var tmp = new Line(item) + tmp.lineWidth *= 2 + tmp.toArrowSize = + (tmp.toArrowSize * scale - 1.5 * tmp.lineWidth) / scale + tmp.fromArrowSize = + (tmp.fromArrowSize * scale - 1.5 * tmp.lineWidth) / scale + tmp.setTID(TID) + tmp.strokeStyle = rgba(0.2, this.options.activeColor) + tmp.borderWidth = 4 + tmp.borderColor = rgba(0.1, this.options.activeColor) + tmp.fromArrowColor = this.options.activeColor + tmp.toArrowColor = this.options.activeColor + tmp.render(ctx) + if (!this.data.locked && !item.locked) { + drawLineFns[item.name] && + drawLineFns[item.name].drawControlPointsFn(ctx, item) + } + } + } + if (this.pens.length === 1 && this.pens[0].type === PenType.Line) { + ctx.restore() // 对应前面的 save() , 保持状态一致 + return + } + // This is diffence between single node and more. + if (this.rotate && this.pens.length > 1) { + ctx.translate(this.rect.center.x, this.rect.center.y) + ctx.rotate((this.rotate * Math.PI) / 180) + ctx.translate(-this.rect.center.x, -this.rect.center.y) + } + if (this.data.locked || this.locked()) { + ctx.restore() + return + } + // Occupied territory. + ctx.save() + ctx.globalAlpha = 0.3 + ctx.translate(0.5, 0.5) + ctx.beginPath() + ctx.moveTo(this.sizeCPs[0].x, this.sizeCPs[0].y) + ctx.lineTo(this.sizeCPs[1].x, this.sizeCPs[1].y) + ctx.lineTo(this.sizeCPs[2].x, this.sizeCPs[2].y) + ctx.lineTo(this.sizeCPs[3].x, this.sizeCPs[3].y) + ctx.closePath() + ctx.stroke() + ctx.restore() + // Draw rotate control point. + ctx.beginPath() + ctx.moveTo(this.rotateCPs[0].x, this.rotateCPs[0].y) + ctx.lineTo(this.rotateCPs[1].x, this.rotateCPs[1].y) + ctx.stroke() + ctx.beginPath() + ctx.arc(this.rotateCPs[0].x, this.rotateCPs[0].y, 5, 0, Math.PI * 2) + ctx.fill() + ctx.stroke() + // Draw size control points. + if (!this.options.hideSizeCP && + (this.pens.length > 1 || !this.pens[0].hideSizeCP)) { + ctx.lineWidth = 1 + for (let _b = 0, _c = this.sizeCPs; _b < _c.length; _b++) { + var item = _c[_b] + ctx.save() + ctx.beginPath() + if (this.pens.length === 1 && (this.pens[0].rotate || this.rotate)) { + ctx.translate(item.x, item.y) + ctx.rotate(((this.pens[0].rotate + this.rotate) * Math.PI) / 180) + ctx.translate(-item.x, -item.y) + } + ctx.fillRect(item.x - 4.5, item.y - 4.5, 8, 8) + ctx.strokeRect(item.x - 5.5, item.y - 5.5, 10, 10) + ctx.restore() + } + } + ctx.restore() + } + ActiveLayer.prototype.calcActiveRect = function () { + if (this.pens.length === 1) { + if (this.pens[0].rect.height === 0) { + // 处理直线这种高度为0的情况 + this.pens[0].rect.height = 1 + } + this.activeRect = deepClone(this.pens[0].rect) + } else { + this.activeRect = getRect(this.pens) + } + } + ActiveLayer.prototype.getDockWatchers = function () { + if (this.pens.length === 1) { + this.dockWatchers = this.nodeRects[0].toPoints() + this.dockWatchers.unshift(this.nodeRects[0].center) + return + } + if (!this.rect) { + return + } + this.dockWatchers = this.rect.toPoints() + this.dockWatchers.unshift(this.rect.center) + } + return ActiveLayer +}(Layer)) +export { ActiveLayer } +// # sourceMappingURL=activeLayer.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/activeLayer.js.map b/nezha-fronted/src/components/common/@topology/core/src/activeLayer.js.map new file mode 100644 index 000000000..b74d57ad3 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/activeLayer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"activeLayer.js","sourceRoot":"","sources":["../../../packages/core/src/activeLayer.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC,OAAO,EAAO,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAC,SAAS,EAAC,OAAO,EAAE,MAAM,SAAS,CAAC;AAGnF;IAAiC,+BAAK;IAuBpC,qBAAmB,OAAqB,EAAE,GAAW;QAAlC,wBAAA,EAAA,YAAqB;QAAxC,YACE,kBAAM,GAAG,CAAC,SAEX;QAHkB,aAAO,GAAP,OAAO,CAAc;QAtBxC,eAAS,GAAY,EAAE,CAAC;QACxB,aAAO,GAAY,EAAE,CAAC;QAItB,UAAI,GAAU,EAAE,CAAC;QAEjB,YAAM,GAAG,CAAC,CAAC;QACX,iBAAW,GAAG,CAAC,CAAC;QAChB,iBAAW,GAAG,CAAC,CAAC;QAChB,kBAAkB;QAClB,oBAAc,GAAY,EAAE,CAAC;QAC7B,eAAS,GAAW,EAAE,CAAC;QACvB,mBA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AAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;YACjD,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;YACpD,OAAO;SACR;QAED,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACd,OAAO;SACR;QACD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACzC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;IACH,kBAAC;AAAD,CAAC,AA/yBD,CAAiC,KAAK,GA+yBrC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/animateLayer.d.ts b/nezha-fronted/src/components/common/@topology/core/src/animateLayer.d.ts new file mode 100644 index 000000000..715d91e2a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/animateLayer.d.ts @@ -0,0 +1,21 @@ +import { Pen } from './models/pen'; +import { Line } from './models/line'; +import { Options } from './options'; +import { Layer } from './layer'; +export declare class AnimateLayer extends Layer { + options: Options; + pens: Map; + private timer; + private lastNow; + private subscribeUpdate; + private subscribePlay; + constructor(options: Options, TID: string); + getAnimateLine(item: Pen): Line; + findLine(pen: Pen): Pen; + readyPlay(tag?: string, auto?: boolean, pens?: Pen[]): void; + animate(): void; + updateLines(lines: Line[]): void; + render(ctx: CanvasRenderingContext2D): void; + stop(): void; + destroy(): void; +} diff --git a/nezha-fronted/src/components/common/@topology/core/src/animateLayer.js b/nezha-fronted/src/components/common/@topology/core/src/animateLayer.js new file mode 100644 index 000000000..9b7d43520 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/animateLayer.js @@ -0,0 +1,256 @@ +import { Store } from 'le5le-store' +import { PenType } from './models/pen' +import { Node } from './models/node' +import { Line } from './models/line' +import { Layer } from './layer' +import { s8 } from './utils/uuid' +import { find } from './utils/canvas' +const __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b }) || + function (d, b) { for (const p in b) if (b.hasOwnProperty(p)) d[p] = b[p] } + return extendStatics(d, b) + } + return function (d, b) { + extendStatics(d, b) + function __ () { this.constructor = d } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()) + } +})() +const AnimateLayer = /** @class */ (function (_super) { + __extends(AnimateLayer, _super) + function AnimateLayer (options, TID) { + if (options === void 0) { options = {} } + const _this = _super.call(this, TID) || this + _this.options = options + _this.pens = new Map() + _this.lastNow = 0 + Store.set(_this.generateStoreKey('LT:AnimateLayer'), _this) + if (!_this.options.animateColor) { + _this.options.animateColor = '#ff6600' + } + _this.subscribeUpdate = Store.subscribe(_this.generateStoreKey('LT:updateLines'), function (lines) { + _this.updateLines(lines) + }) + _this.subscribePlay = Store.subscribe(_this.generateStoreKey('LT:AnimatePlay'), function (params) { + if (params.stop) { + if (params.tag) { + const pens = find(params.tag, _this.data.pens) + pens.forEach(function (item) { + if (_this.pens.has(item.id)) { + _this.pens.get(item.id).animateStart = 0 + } + }) + } + if (params.pen && _this.pens.has(params.pen.id)) { + _this.pens.get(params.pen.id).animateStart = 0 + } + } else { + if (params.pen) { + if (_this.pens.has(params.pen.id)) { + _this.pens.get(params.pen.id).animateStart = Date.now() + } else { + if (params.pen.type) { + _this.pens.set(params.pen.id, _this.getAnimateLine(params.pen)) + } else { + _this.pens.set(params.pen.id, params.pen) + } + } + } + if (params.tag) { + _this.readyPlay(params.tag, false) + } + } + _this.animate() + }) + return _this + } + AnimateLayer.prototype.getAnimateLine = function (item) { + const l = new Line(item) + l.data = l.id + l.id = s8() + l.setTID(this.TID) + l.isAnimate = true + l.toArrow = '' + if (l.fromArrow && l.fromArrow.indexOf('line') < 0) { + l.animateFromSize = l.fromArrowSize + l.lineWidth * 5 + } + if (l.toArrow && l.toArrow.indexOf('line') < 0) { + l.animateToSize = l.toArrowSize + l.lineWidth * 5 + } + l.animateStart = item.animateStart + l.lineCap = 'round' + l.fillStyle = '#fff' + l.strokeStyle = l.animateColor || this.options.animateColor + l.length = l.getLen() + if (!l.fromArrowColor) { + l.fromArrowColor = l.strokeStyle || Store.get(this.generateStoreKey('LT:color')) + } + if (!l.toArrowColor) { + l.toArrowColor = l.strokeStyle || Store.get(this.generateStoreKey('LT:color')) + } + return l + } + AnimateLayer.prototype.findLine = function (pen) { + for (let _i = 0, _a = this.data.pens; _i < _a.length; _i++) { + const item = _a[_i] + if (item.id === pen.data) { + return item + } + } + } + AnimateLayer.prototype.readyPlay = function (tag, auto, pens) { + const _this = this + const readyPens = new Map() + if (!pens) { + pens = this.data.pens + } + pens.forEach(function (pen) { + pen.setTID(_this.TID) + if (!pen.visible || readyPens.get(pen.id)) { + return + } + if ((auto && pen.animatePlay) || (tag && pen.tags.indexOf(tag) > -1)) { + if (!pen.animateStart || pen.animateStart < 1) { + pen.animateStart = Date.now() + } + } + if (pen instanceof Node) { + if (pen.animateStart > 0) { + if (!pen.animateReady) { + pen.initAnimate() + } + readyPens.set(pen.id, pen) + } + if (pen.children && pen.children.length) { + _this.readyPlay(tag, auto, pen.children) + } + } else { + if (pen.animateStart > 0) { + readyPens.set(pen.id, _this.getAnimateLine(pen)) + } else if (_this.pens.has(pen.id)) { + _this.pens.get(pen.id).animateStart = 0 + } + } + }) + readyPens.forEach(function (pen) { + if (pen.type) { + _this.pens.set(pen.data, pen) + } else { + _this.pens.set(pen.id, pen) + } + }) + } + AnimateLayer.prototype.animate = function () { + const _this = this + if (this.timer) { + cancelAnimationFrame(this.timer) + } + this.timer = requestAnimationFrame(function () { + const now = Date.now() + if (now - _this.lastNow < _this.options.refresh) { + _this.animate() + return + } + _this.lastNow = now + let animated = false + _this.pens.forEach(function (pen) { + if (!pen.animateStart || pen.animateStart < 1) { + if (pen.type) { + _this.pens.delete(pen.data) + var line = _this.findLine(pen) + if (line) { + line.animateStart = 0 + line.animatePos = pen.animatePos + } + } else { + _this.pens.delete(pen.id) + } + return + } + if (pen.animateStart > now) { + return + } + if (pen.animateFn) { + if (typeof pen.animateFn === 'function') { + pen.animateFn() + } else if (window && window[pen.animateFn]) { + window[pen.animateFn]() + } else { + // pen.render(); + } + } else { + pen.animate(now) + } + if (pen.animateStart < 1) { + if (pen.type) { + _this.pens.delete(pen.data) + } else { + _this.pens.delete(pen.id) + } + if (pen.type === PenType.Line) { + var line = _this.findLine(pen) + if (line) { + line.animateStart = 0 + line.animatePos = pen.animatePos + } + } + if (pen.nextAnimate) { + _this.readyPlay(pen.nextAnimate, false) + } + } + animated = true + }) + if (animated) { + Store.set(_this.generateStoreKey('LT:render'), true) + _this.animate() + } + }) + } + AnimateLayer.prototype.updateLines = function (lines) { + this.pens.forEach(function (line, key) { + if (!(line instanceof Line)) { + return + } + for (let _i = 0, lines_1 = lines; _i < lines_1.length; _i++) { + const item = lines_1[_i] + if (line.data === item.id) { + line.from = item.from + line.to = item.to + line.controlPoints = item.controlPoints + line.length = line.getLen() + } + } + }) + } + AnimateLayer.prototype.render = function (ctx) { + const _this = this + this.pens.forEach(function (line, key) { + if (line.visible && line instanceof Line) { + if (!line.getTID()) { + line.setTID(_this.TID) + } + line.render(ctx) + } + }) + } + AnimateLayer.prototype.stop = function () { + this.pens.clear() + if (this.timer) { + cancelAnimationFrame(this.timer) + this.timer = null + } + } + AnimateLayer.prototype.destroy = function () { + this.stop() + this.subscribeUpdate.unsubscribe() + this.subscribePlay.unsubscribe() + this.subscribeUpdate = null + this.subscribePlay = null + this.pens = null + } + return AnimateLayer +}(Layer)) +export { AnimateLayer } +// # sourceMappingURL=animateLayer.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/animateLayer.js.map b/nezha-fronted/src/components/common/@topology/core/src/animateLayer.js.map new file mode 100644 index 000000000..e7861d628 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/animateLayer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"animateLayer.js","sourceRoot":"","sources":["../../../packages/core/src/animateLayer.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAO,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAItC;IAAkC,gCAAK;IAOrC,sBAAmB,OAAqB,EAAE,GAAW;QAAlC,wBAAA,EAAA,YAAqB;QAAxC,YACE,kBAAM,GAAG,CAAC,SA8CX;QA/CkB,aAAO,GAAP,OAAO,CAAc;QANxC,UAAI,GAAG,IAAI,GAAG,EAAE,CAAC;QAGT,aAAO,GAAG,CAAC,CAAC;QAKlB,KAAK,CAAC,GAAG,CAAC,KAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,EAAE,KAAI,CAAC,CAAC;QAE1D,IAAI,CAAC,KAAI,CAAC,OAAO,CAAC,YAAY,EAAE;YAC9B,KAAI,CAAC,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;SACvC;QAED,KAAI,CAAC,eAAe,GAAG,KAAK,CAAC,SAAS,CAAC,KAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,EAAE,UAAC,KAAa;YAC5F,KAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;QACH,KAAI,CAAC,aAAa,GAAG,KAAK,CAAC,SAAS,CAClC,KAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,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CAAC,WAAW,EAAE,CAAC;IACnC,CAAC;IACH,mBAAC;AAAD,CAAC,AA1PD,CAAkC,KAAK,GA0PtC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/canvas.d.ts b/nezha-fronted/src/components/common/@topology/core/src/canvas.d.ts new file mode 100644 index 000000000..627064bf0 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/canvas.d.ts @@ -0,0 +1,22 @@ +import { Observer } from 'le5le-store'; +import { TopologyData } from './models/data'; +import { Options } from './options'; +import { Layer } from './layer'; +export declare class Canvas extends Layer { + parentElem: HTMLElement; + options: Options; + static dpiRatio: number; + protected data: TopologyData; + canvas: HTMLCanvasElement; + width: number; + height: number; + subcribe: Observer; + constructor(parentElem: HTMLElement, options: Options, TID: string); + resize(size?: { + width: number; + height: number; + }): void; + render(): void; + getDpiRatio(): number; + destroy(): void; +} diff --git a/nezha-fronted/src/components/common/@topology/core/src/canvas.js b/nezha-fronted/src/components/common/@topology/core/src/canvas.js new file mode 100644 index 000000000..d8d9f3fd0 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/canvas.js @@ -0,0 +1,96 @@ +import { Store } from 'le5le-store' +import { Layer } from './layer' +const __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b }) || + function (d, b) { for (const p in b) if (b.hasOwnProperty(p)) d[p] = b[p] } + return extendStatics(d, b) + } + return function (d, b) { + extendStatics(d, b) + function __ () { this.constructor = d } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()) + } +})() +const Canvas = /** @class */ (function (_super) { + __extends(Canvas, _super) + function Canvas (parentElem, options, TID) { + if (options === void 0) { options = {} } + const _this = _super.call(this, TID) || this + _this.parentElem = parentElem + _this.options = options + _this.canvas = document.createElement('canvas') + _this.width = 0 + _this.height = 0 + _this.subcribe = Store.subscribe(_this.generateStoreKey('topology-data'), function (val) { + _this.data = val + }) + _this.canvas.style.position = 'absolute' + _this.canvas.style.left = '0' + _this.canvas.style.top = '0' + _this.canvas.style.outline = 'none' + if (!Canvas.dpiRatio) { + if (!options.extDpiRatio && options.extDpiRatio !== 0) { + if (window && window.devicePixelRatio > 1) { + options.extDpiRatio = 0.25 + } else { + options.extDpiRatio = 0 + } + } + Canvas.dpiRatio = (window ? window.devicePixelRatio : 0) + options.extDpiRatio + if (Canvas.dpiRatio < 1) { + Canvas.dpiRatio = 1 + } + } + return _this + } + Canvas.prototype.resize = function (size) { + if (size) { + this.width = size.width | 0 + this.height = size.height | 0 + } else { + if (this.options.width && this.options.width !== 'auto') { + this.width = +this.options.width + } else { + this.width = this.parentElem.clientWidth + } + if (this.options.height && this.options.height !== 'auto') { + this.height = +this.options.height + } else { + this.height = this.parentElem.clientHeight + } + } + this.canvas.style.width = this.width + 'px' + this.canvas.style.height = this.height + 'px' + this.canvas.width = (this.width * Canvas.dpiRatio) | 0 + this.canvas.height = (this.height * Canvas.dpiRatio) | 0 + this.canvas.getContext('2d').scale(Canvas.dpiRatio, Canvas.dpiRatio) + Store.set(this.generateStoreKey('LT:size'), { width: this.canvas.width, height: this.canvas.height }) + } + Canvas.prototype.render = function () { + const ctx = this.canvas.getContext('2d') + ctx.clearRect(0, 0, this.canvas.width, this.canvas.height) + } + Canvas.prototype.getDpiRatio = function () { + return Canvas.dpiRatio + } + Canvas.prototype.destroy = function () { + this.subcribe.unsubscribe() + this.activeLayer = null + this.hoverLayer = null + this.animateLayer = null + this.subcribe = null + this.options = null + this.parentElem = null + this.data = null + this.offscreen = null + this.canvas = null + this.bkImg = null + this.render = null + } + Canvas.dpiRatio = 0 + return Canvas +}(Layer)) +export { Canvas } +// # sourceMappingURL=canvas.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/canvas.js.map b/nezha-fronted/src/components/common/@topology/core/src/canvas.js.map new file mode 100644 index 000000000..f028a9001 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src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AC,KAAK,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACvD,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACzD,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;QAErE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IACxG,CAAC;IAED,uBAAM,GAAN;QACE,IAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACzC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC7D,CAAC;IAED,4BAAW,GAAX;QACE,OAAO,MAAM,CAAC,QAAQ,CAAC;IACzB,CAAC;IAED,wBAAO,GAAP;QACE,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;IAC9B,CAAC;IAvEM,eAAQ,GAAG,CAAC,CAAC;IAwEtB,aAAC;CAAA,AAzED,CAA4B,KAAK,GAyEhC;SAzEY,MAAM"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/core.d.ts b/nezha-fronted/src/components/common/@topology/core/src/core.d.ts new file mode 100644 index 000000000..f06660008 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/core.d.ts @@ -0,0 +1,274 @@ +import { Emitter, EventType, Handler } from 'mitt'; +import { Options, Padding } from './options'; +import { Pen } from './models/pen'; +import { Node } from './models/node'; +import { Point } from './models/point'; +import { Line } from './models/line'; +import { TopologyData } from './models/data'; +import { Lock } from './models/status'; +import { Offscreen } from './offscreen'; +import { RenderLayer } from './renderLayer'; +import { HoverLayer } from './hoverLayer'; +import { ActiveLayer } from './activeLayer'; +import { AnimateLayer } from './animateLayer'; +import { DivLayer } from './divLayer'; +import { Rect } from './models/rect'; +import { Socket } from './socket'; +import { MQTT } from './mqtt'; +import { EventType as SocketEventType } from './models'; +declare enum MoveInType { + None = 0, + Line = 1, + LineFrom = 2, + LineTo = 3, + LineControlPoint = 4, + Nodes = 5, + ResizeCP = 6, + HoverAnchors = 7, + AutoAnchor = 8, + Rotate = 9, + GraffitiReady = 10, + Graffiti = 11, + LinesReady = 12, + Lines = 13 +} +interface ICaches { + index: number; + dbIndex: number; + list: TopologyData[]; +} +export declare class Topology { + VERSION: string; + id: string; + data: TopologyData; + clipboard: TopologyData; + caches: ICaches; + options: Options; + cacheTimer: any; + parentElem: HTMLElement; + canvas: RenderLayer; + offscreen: Offscreen; + hoverLayer: HoverLayer; + activeLayer: ActiveLayer; + animateLayer: AnimateLayer; + divLayer: DivLayer; + private subcribe; + private subcribeRender; + private subcribeImage; + private imageTimer; + private subcribeAnimateEnd; + private subcribeAnimateMoved; + private subcribeMediaEnd; + private subcribeEmit; + touchedNode: any; + lastHoverNode: Node; + lastHoverLine: Line; + touches?: TouchList; + touchScale?: number; + touchStart: number; + touchCenter?: { + x: number; + y: number; + }; + input: HTMLTextAreaElement; + inputObj: Pen; + mouseDown: { + x: number; + y: number; + restore?: boolean; + }; + spaceDown: boolean; + lastTranlated: { + x: number; + y: number; + }; + moveIn: { + type: MoveInType; + activeAnchorIndex: number; + hoverAnchorIndex: number; + hoverNode: Node; + hoverLine: Line; + activeNode: Node; + lineControlPoint: Point; + }; + canvasPos?: DOMRect; + needCache: boolean; + private tip; + private raf; + tipMarkdown: HTMLElement; + tipMarkdownContent: HTMLElement; + tipMarkdownArrowUp: HTMLElement; + tipMarkdownArrowDown: HTMLElement; + tipElem: HTMLElement; + socket: Socket; + mqtt: MQTT; + get ramCaches(): number; + get clearElementIdPensName(): string[]; + private socketFn; + _emitter: Emitter; + private scheduledAnimationFrame; + private scrolling; + private rendering; + private actionTimer; + constructor(parent: string | HTMLElement, options?: Options); + private setupDom; + private setupSubscribe; + private setupMouseEvent; + private onScroll; + private preventDefault; + private ontouchend; + winResize: () => void; + resize(size?: { + width: number; + height: number; + }): void; + dropNodes(jsonList: any[], offsetX: number, offsetY: number): void; + addNode(node: Node | any, focus?: boolean): any; + addLine(line: any, focus?: boolean): any; + render(noFocus?: boolean): this; + calibrateMouse: (pt: { + x: number; + y: number; + }) => { + x: number; + y: number; + }; + open(data?: TopologyData | string): void; + /** + * 执行初始化函数 initJS + * */ + private doInitJS; + subscribeSocket: () => boolean; + openSocket(url?: string): void; + closeSocket(): void; + openMqtt(url?: string, options?: any): void; + closeMqtt(): void; + doSocket(message: any, type?: SocketEventType): void; + overflow(padding?: number): { + width: number; + height: number; + }; + private setNodeText; + onMouseMove: (e: { + x: number; + y: number; + buttons?: number; + ctrlKey?: boolean; + shiftKey?: boolean; + altKey?: boolean; + pageX?: number; + pageY?: number; + }) => boolean; + onmousedown: (e: { + x: number; + y: number; + button?: number; + ctrlKey?: boolean; + shiftKey?: boolean; + altKey?: boolean; + pageX?: number; + pageY?: number; + }) => void; + onmouseup: (e: { + x: number; + y: number; + button?: number; + ctrlKey?: boolean; + shiftKey?: boolean; + altKey?: boolean; + }) => void; + private ondblclick; + private onkeydown; + private getMoveIn; + inChildNode(pt: { + x: number; + y: number; + }, children: Pen[]): any; + inNode(pt: { + x: number; + y: number; + }, node: Node, inChild?: boolean): any; + inLine(point: { + x: number; + y: number; + }, line: Line): any; + private getLineDock; + private getPensInRect; + private getAngle; + showInput(item: Pen): void; + getRect(pens?: Pen[]): Rect; + getDockPos(offsetX: number, offsetY: number, noDock?: boolean): { + x: number; + y: number; + }; + cache(): void; + cacheReplace(pens: Pen[]): void; + undo(noRedo?: boolean, force?: boolean): void; + redo(force?: boolean): void; + toImage(padding?: Padding, callback?: any): string; + saveAsImage(name?: string, padding?: Padding): void; + delete(param?: string | Pen[], force?: boolean): void; + deleteAnchors(param?: Pen[], force?: boolean): void; + delEmptyLines(deleteedId?: string): void; + cut(): void; + copy(): void; + paste(): void; + /** + * 粘贴当前画笔,位置偏移 offset + * */ + pastePen(pen: Pen, idMaps?: any, offset?: number, parentId?: string): void; + animate(autoplay?: boolean): void; + updateProps(cache?: boolean, pens?: Pen[]): void; + lock(lock: Lock): void; + lockPens(pens: Pen[], lock: Lock): void; + up(pen: Pen, pens?: Pen[]): void; + top(pen: Pen, pens?: Pen[]): void; + down(pen: Pen, pens?: Pen[]): void; + bottom(pen: Pen, pens?: Pen[]): void; + getParent(pen: Pen): Node; + combine(pens?: Pen[], stand?: boolean): void; + uncombine(node?: Pen): void; + find(idOrTag: string, pens?: Pen[] | boolean, array?: boolean): Pen | Pen[]; + findIndex(pen: Pen, pens?: Pen[]): number; + play(idOrTag: string, pause?: boolean): void; + translate(x: number, y: number, process?: boolean, noNotice?: boolean): void; + scale(scale: number, center?: { + x: number; + y: number; + }): void; + scaleTo(scale: number, center?: { + x: number; + y: number; + }): void; + round(): void; + centerView(padding?: Padding): boolean; + fitView(viewPadding?: Padding): void; + hasView(): boolean; + getViewCenter(viewPadding?: Padding): { + x: number; + y: number; + }; + generateStoreKey(key: string): string; + private createMarkdownTip; + private showTip; + private hideTip; + scroll(x: number, y: number): void; + toComponent(pens?: Pen[]): Node; + clearBkImg(): void; + dispatch(event: string, data?: any): this; + on(eventType: EventType, handler: Handler): this; + off(eventType: EventType, handler: Handler): this; + emit(eventType: EventType, params: any): this; + getValue(idOrTag: string, attr?: string): any; + setValue(idOrTag: any, val: any, attr?: string): void; + willRender(): void; + setLineName(name: 'curve' | 'line' | 'polyline' | 'mind', render?: boolean): void; + setColor(color: string): void; + setFontColor(color: string): void; + setIconColor(color: string): void; + setBkColor(color: string): void; + pureData(): any; + pureDataChildren(data: any): void; + destroy(): void; +} +export {}; diff --git a/nezha-fronted/src/components/common/@topology/core/src/core.js b/nezha-fronted/src/components/common/@topology/core/src/core.js new file mode 100644 index 000000000..51f20fc39 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/core.js @@ -0,0 +1,3018 @@ +import { Store } from 'le5le-store' +// https://github.com/developit/mitt +import { default as mitt } from 'mitt' +import { KeyType, KeydownType, DefalutOptions, fontKeys } from './options' +import { PenType } from './models/pen' +import { Node } from './models/node' +import { Point } from './models/point' +import { Line } from './models/line' +import { createData } from './models/data' +import { Lock, AnchorMode } from './models/status' +import { drawNodeFns, drawLineFns, calcTextRect } from './middles' +import { Offscreen } from './offscreen' +import { RenderLayer } from './renderLayer' +import { HoverLayer } from './hoverLayer' +import { ActiveLayer } from './activeLayer' +import { AnimateLayer } from './animateLayer' +import { DivLayer } from './divLayer' +import { Rect } from './models/rect' +import { s8 } from './utils/uuid' +import { del, find, getParent, pointInRect } from './utils/canvas' +import { getBboxOfPoints, getMoreRect, getRect } from './utils/rect' +import { formatPadding } from './utils/padding' +import { Socket } from './socket' +import { MQTT } from './mqtt' +import { Direction, EventType as SocketEventType } from './models' +import { createCacheTable, getCache, isMobile, pushCache, spliceCache } from './utils' +import pkg from './../package.json' +const resizeCursors = ['nw-resize', 'ne-resize', 'se-resize', 'sw-resize'] +let MoveInType; +(function (MoveInType) { + MoveInType[MoveInType.None = 0] = 'None' + MoveInType[MoveInType.Line = 1] = 'Line' + MoveInType[MoveInType.LineFrom = 2] = 'LineFrom' + MoveInType[MoveInType.LineTo = 3] = 'LineTo' + MoveInType[MoveInType.LineControlPoint = 4] = 'LineControlPoint' + MoveInType[MoveInType.Nodes = 5] = 'Nodes' + MoveInType[MoveInType.ResizeCP = 6] = 'ResizeCP' + MoveInType[MoveInType.HoverAnchors = 7] = 'HoverAnchors' + MoveInType[MoveInType.AutoAnchor = 8] = 'AutoAnchor' + MoveInType[MoveInType.Rotate = 9] = 'Rotate' + MoveInType[MoveInType.GraffitiReady = 10] = 'GraffitiReady' + MoveInType[MoveInType.Graffiti = 11] = 'Graffiti' + MoveInType[MoveInType.LinesReady = 12] = 'LinesReady' + MoveInType[MoveInType.Lines = 13] = 'Lines' +})(MoveInType || (MoveInType = {})) +const dockOffset = 10 +const Topology = /** @class */ (function () { + function Topology (parent, options) { + const _this = this + if (options === void 0) { options = {} } + this.VERSION = pkg.version + this.id = s8() + this.data = createData(undefined, this.id) + this.caches = { + index: 0, + dbIndex: 0, + list: [] + } + this.touchStart = 0 + this.input = document.createElement('textarea') + this.lastTranlated = { x: 0, y: 0 } + this.moveIn = { + type: MoveInType.None, + activeAnchorIndex: 0, + hoverAnchorIndex: 0, + hoverNode: undefined, + hoverLine: undefined, + activeNode: undefined, + lineControlPoint: undefined + } + this.needCache = false + this.tip = '' + this.scheduledAnimationFrame = false + this.scrolling = false + this.rendering = false + this.onScroll = function () { + _this.canvasPos = _this.divLayer.canvas.getBoundingClientRect() + } + this.preventDefault = function (event) { + event.preventDefault() + } + this.winResize = function () { + let timer + if (timer) { + clearTimeout(timer) + } + timer = setTimeout(function () { + _this.resize() + timer = null + }, 100) + } + this.calibrateMouse = function (pt) { + pt.x -= _this.data.x + pt.y -= _this.data.y + return pt + } + this.subscribeSocket = function () { + if (!_this.data.socketFn) { + return false + } + if (!_this.data.socketEvent) { + _this.data.socketEvent = true + } + try { + const socketFn = new Function('e', _this.data.socketFn) + if (_this.socketFn) { + _this.off('websocket', _this.socketFn) + _this.off('mqtt', _this.socketFn) + } + _this.on('websocket', socketFn) + _this.on('mqtt', socketFn) + _this.socketFn = socketFn + } catch (e) { + console.error('Create the function for socket:', e) + return false + } + return true + } + this.onMouseMove = function (e) { + let _a + if (_this.scheduledAnimationFrame || ((_a = _this.data) === null || _a === void 0 ? void 0 : _a.locked) === Lock.NoEvent) { + return + } + // https://caniuse.com/#feat=mdn-api_mouseevent_buttons + if (_this.mouseDown && !_this.mouseDown.restore && e.buttons !== 1 && e.buttons !== 2) { + // 防止异常情况导致mouseup事件没有触发 + _this.onmouseup(e) + return + } + if (_this.mouseDown && (_this.data.locked || _this.spaceDown || !_this.moveIn.type)) { + let b = !!_this.data.locked + switch (_this.options.translateKey) { + case KeyType.Right: + if (e.buttons == 2) { + b = true + } + break + case KeyType.Any: + b = true + break + case KeyType.Ctrl: + if (e.ctrlKey) { + b = true + } + break + case KeyType.Shift: + if (e.shiftKey) { + b = true + } + break + case KeyType.Alt: + if (e.altKey) { + b = true + } + break + default: + if (e.ctrlKey || e.altKey || e.buttons == 2) { + b = true + } + } + if (_this.spaceDown || (!_this.options.disableTranslate && b && _this.data.locked < Lock.NoMove)) { + _this.translate(e.x, e.y, true) + return false + } + } + if (_this.data.locked && _this.mouseDown) { + return + } + _this.scheduledAnimationFrame = true + if (_this.raf) { cancelAnimationFrame(_this.raf) } + _this.raf = requestAnimationFrame(function () { + _this.raf = undefined + const pt = _this.calibrateMouse({ x: e.x, y: e.y }) + if (_this.moveIn.type === MoveInType.Lines) { // 钢笔工具 + if (_this.hoverLayer.line) { + _this.hoverLayer.lineTo(new Point(pt.x, pt.y), '') + if (e.shiftKey || e.ctrlKey || e.altKey || e.buttons == 2) { + _this.hoverLayer.line.name = 'curve' + _this.hoverLayer.line.calcControlPoints() + } else { + _this.hoverLayer.line.name = 'line' + } + _this.render() + } + _this.scheduledAnimationFrame = false + return + } + if (!_this.mouseDown) { + _this.getMoveIn(pt) + // Render hover anchors. + if (_this.moveIn.hoverNode !== _this.lastHoverNode) { + if (_this.lastHoverNode) { + _this.lastHoverNode.moveOut() + // Send a move event. + _this.dispatch('moveOutNode', _this.lastHoverNode) + _this.hideTip() + // Clear hover anchors. + _this.hoverLayer.node = undefined + } + if (_this.moveIn.hoverNode) { + _this.hoverLayer.node = _this.moveIn.hoverNode + _this.moveIn.hoverNode.moveIn() + // Send a move event. + _this.dispatch('moveInNode', Object.assign(_this.moveIn.hoverNode, { + evs: { + x: e.pageX, + y: e.pageY + } + })) + _this.showTip(_this.moveIn.hoverNode, pt) + } + } + if (_this.moveIn.hoverLine !== _this.lastHoverLine && !_this.moveIn.hoverNode) { + if (_this.lastHoverLine) { + _this.lastHoverLine.moveOut() + _this.dispatch('moveOutLine', _this.lastHoverLine) + _this.hideTip() + } + if (_this.moveIn.hoverLine) { + _this.hoverLayer.line = _this.moveIn.hoverLine + _this.moveIn.hoverLine.moveIn() + _this.dispatch('moveInLine', Object.assign(_this.moveIn.hoverLine, { + evs: { + x: e.pageX, + y: e.pageY + } + })) + _this.showTip(_this.moveIn.hoverLine, pt) + } + } + if (_this.moveIn.type === MoveInType.LineControlPoint) { + _this.hoverLayer.hoverLineCP = _this.moveIn.lineControlPoint + } else if (_this.hoverLayer.hoverLineCP) { + _this.hoverLayer.hoverLineCP = undefined + } + if (_this.moveIn.hoverNode !== _this.lastHoverNode || + _this.moveIn.type === MoveInType.HoverAnchors || + _this.hoverLayer.lasthoverLineCP !== _this.hoverLayer.hoverLineCP) { + _this.hoverLayer.lasthoverLineCP = _this.hoverLayer.hoverLineCP + _this.render() + } + _this.scheduledAnimationFrame = false + return + } + // Move out parent element. + const moveOutX = e.x + 50 > _this.parentElem.clientWidth + _this.parentElem.scrollLeft + const moveOutY = e.y + 50 > _this.parentElem.clientHeight + _this.parentElem.scrollTop + if (!_this.options.disableMoveOutParent && (moveOutX || moveOutY)) { + _this.dispatch('moveOutParent', e) + var x = 0 + var y = 0 + if (e.x + 50 > _this.divLayer.canvas.clientWidth) { + x = -5 + } + if (e.y + 50 > _this.divLayer.canvas.clientHeight) { + y = -5 + } + _this.translate(x, y, false) + } + _this.hideTip() + switch (_this.moveIn.type) { + case MoveInType.None: + _this.hoverLayer.dragRect = new Rect(_this.mouseDown.x - _this.data.x, _this.mouseDown.y - _this.data.y, e.x - _this.mouseDown.x, e.y - _this.mouseDown.y) + break + case MoveInType.Nodes: + if (_this.activeLayer.locked() || _this.data.locked) { + break + } + var x = e.x - _this.mouseDown.x + var y = e.y - _this.mouseDown.y + if (x || y) { + var offset = _this.getDockPos(x, y, e.ctrlKey || e.shiftKey || e.altKey) + _this.activeLayer.move(offset.x ? offset.x : x, offset.y ? offset.y : y) + _this.needCache = true + } + break + case MoveInType.ResizeCP: { + const x_1 = e.x - _this.mouseDown.x + const y_1 = e.y - _this.mouseDown.y + if (x_1 || y_1) { + var offset = _this.getDockPos(x_1, y_1, e.ctrlKey || e.shiftKey || e.altKey) + const offsetE = Object.assign({}, e) + offset.x && (offsetE.x = offset.x + _this.mouseDown.x) + offset.y && (offsetE.y = offset.y + _this.mouseDown.y) + _this.activeLayer.resize(_this.moveIn.activeAnchorIndex, _this.mouseDown, offsetE) + _this.dispatch('resizePens', _this.activeLayer.pens) + _this.needCache = true + } + break + } + case MoveInType.LineTo: + case MoveInType.HoverAnchors: + case MoveInType.AutoAnchor: + if (_this.hoverLayer.dockAnchor && _this.hoverLayer.dockAnchor.hit(e, 10)) { + break + } + var arrow = _this.data.toArrow + if (_this.moveIn.hoverLine) { + arrow = _this.moveIn.hoverLine.toArrow + } + if (_this.hoverLayer.line) { + _this.activeLayer.pens = [_this.hoverLayer.line] + } + var toId = _this.hoverLayer.line.to.id + if (e.ctrlKey || e.shiftKey || e.altKey) { + _this.hoverLayer.lineTo(new Point(pt.x, pt.y), arrow) + } else { + const to = _this.getLineDock(new Point(pt.x, pt.y), AnchorMode.In) + toId = to.id + // 即使是自己连接自己,也为 to 配置 anchorIndex + _this.hoverLayer.lineTo(to, arrow) + } + _this.hoverLayer.line.to.id = toId + if (_this.hoverLayer.line.parentId) { + var line = _this.find(toId) + if (line && line.from) { + line.from.x = _this.hoverLayer.line.to.x + line.from.y = _this.hoverLayer.line.to.y + } + } + _this.needCache = true + break + case MoveInType.LineFrom: + var fromId = _this.hoverLayer.line.from.id + if (e.ctrlKey || e.shiftKey || e.altKey) { + _this.hoverLayer.lineFrom(new Point(pt.x, pt.y)) + } else { + const from = _this.getLineDock(new Point(pt.x, pt.y), AnchorMode.Out) + fromId = from.id + _this.hoverLayer.lineFrom(from) + } + _this.hoverLayer.line.from.id = fromId + if (_this.hoverLayer.line.parentId) { + var line = _this.find(fromId) + if (line && line.to) { + line.to.x = _this.hoverLayer.line.from.x + line.to.y = _this.hoverLayer.line.from.y + } + } + _this.needCache = true + break + case MoveInType.Line: + { + const x_2 = e.x - _this.mouseDown.x + const y_2 = e.y - _this.mouseDown.y + if (x_2 || y_2) { + _this.activeLayer.move(x_2, y_2) + if (_this.hoverLayer.line.children) { + _this.animateLayer.updateLines(_this.hoverLayer.line.children) + } else { + _this.animateLayer.updateLines([_this.hoverLayer.line]) + } + _this.needCache = true + } + } + break + case MoveInType.LineControlPoint: + _this.moveIn.hoverLine.controlPoints[_this.moveIn.lineControlPoint.id].x = pt.x + _this.moveIn.hoverLine.controlPoints[_this.moveIn.lineControlPoint.id].y = pt.y + _this.moveIn.hoverLine.textRect = undefined + if (drawLineFns[_this.moveIn.hoverLine.name] && drawLineFns[_this.moveIn.hoverLine.name].dockControlPointFn) { + drawLineFns[_this.moveIn.hoverLine.name].dockControlPointFn(_this.moveIn.hoverLine.controlPoints[_this.moveIn.lineControlPoint.id], _this.moveIn.hoverLine) + } + _this.needCache = true + Store.set(_this.generateStoreKey('LT:updateLines'), [_this.moveIn.hoverLine]) + break + case MoveInType.Rotate: + if (_this.activeLayer.pens.length) { + _this.activeLayer.offsetRotate(_this.getAngle(pt)) + _this.activeLayer.updateLines() + } + _this.needCache = true + break + case MoveInType.Graffiti: + _this.moveIn.hoverNode.pushPoint(new Point(pt.x, pt.y)) + break + } + _this.render() + _this.scheduledAnimationFrame = false + }) + } + this.onmousedown = function (e) { + if (e.button !== 0 && e.button !== 2) { return } + _this.mouseDown = e + if (e.altKey) { + _this.divLayer.canvas.style.cursor = 'move' + } + if (_this.inputObj) { + _this.setNodeText() + } + switch (_this.moveIn.type) { + // Click the space. + case MoveInType.None: + _this.activeLayer.clear() + _this.hoverLayer.clear() + _this.dispatch('space', _this.mouseDown) + break + // Click a line. + case MoveInType.Line: + case MoveInType.LineControlPoint: + if (e.ctrlKey || e.shiftKey) { + _this.activeLayer.add(_this.moveIn.hoverLine) + _this.dispatch('multi', _this.activeLayer.pens) + } else { + _this.activeLayer.pens = [_this.moveIn.hoverLine] + _this.dispatch('line' + (e.button === 2 ? 'RightClick' : ''), Object.assign(_this.moveIn.hoverLine, { + evs: { + x: e.pageX, + y: e.pageY + } + })) + } + _this.hoverLayer.line = _this.moveIn.hoverLine + _this.hoverLayer.initLine = new Line(_this.moveIn.hoverLine) + if (_this.data.locked || _this.moveIn.hoverLine.locked) { + _this.moveIn.hoverLine.click() + } + break + // tslint:disable-next-line:no-switch-case-fall-through + case MoveInType.LineFrom: + case MoveInType.LineTo: + _this.activeLayer.pens = [_this.moveIn.hoverLine] + _this.dispatch('line', _this.moveIn.hoverLine) + _this.hoverLayer.line = _this.moveIn.hoverLine + break + case MoveInType.HoverAnchors: + _this.hoverLayer.line = _this.addLine({ + name: _this.data.lineName, + from: new Point(_this.moveIn.hoverNode.rotatedAnchors[_this.moveIn.hoverAnchorIndex].x, _this.moveIn.hoverNode.rotatedAnchors[_this.moveIn.hoverAnchorIndex].y, _this.moveIn.hoverNode.rotatedAnchors[_this.moveIn.hoverAnchorIndex].direction, _this.moveIn.hoverAnchorIndex, _this.moveIn.hoverNode.id), + fromArrow: _this.data.fromArrow, + to: new Point(_this.moveIn.hoverNode.rotatedAnchors[_this.moveIn.hoverAnchorIndex].x, _this.moveIn.hoverNode.rotatedAnchors[_this.moveIn.hoverAnchorIndex].y), + toArrow: _this.data.toArrow, + strokeStyle: _this.options.color, + lineWidth: _this.data.lineWidth + }) + _this.dispatch('anchor', { + anchor: _this.moveIn.hoverNode.rotatedAnchors[_this.moveIn.hoverAnchorIndex], + anchorIndex: _this.moveIn.hoverAnchorIndex, + node: _this.moveIn.hoverNode, + line: _this.hoverLayer.line + }) + break + case MoveInType.AutoAnchor: + _this.hoverLayer.line = _this.addLine({ + name: _this.data.lineName, + from: new Point(_this.moveIn.hoverNode.rect.center.x, _this.moveIn.hoverNode.rect.center.y, Direction.None, 0, _this.moveIn.hoverNode.id), + fromArrow: _this.data.fromArrow, + to: new Point(_this.moveIn.hoverNode.rect.center.x, _this.moveIn.hoverNode.rect.center.y), + toArrow: _this.data.toArrow, + strokeStyle: _this.options.color, + lineWidth: _this.data.lineWidth + }) + _this.hoverLayer.line.from.autoAnchor = true + _this.dispatch('nodeCenter', _this.moveIn.hoverNode) + break + // tslint:disable-next-line:no-switch-case-fall-through + case MoveInType.Nodes: + if (!_this.moveIn.activeNode) { + break + } + if (e.ctrlKey || e.shiftKey) { + if (_this.moveIn.hoverNode && _this.activeLayer.hasInAll(_this.moveIn.hoverNode)) { + _this.activeLayer.setPens([_this.moveIn.hoverNode]) + _this.dispatch('node' + (e.button === 2 ? 'RightClick' : ''), _this.moveIn.hoverNode) + } else if (!_this.activeLayer.has(_this.moveIn.activeNode)) { + _this.activeLayer.add(_this.moveIn.activeNode) + if (_this.activeLayer.pens.length > 1) { + _this.dispatch('multi', _this.activeLayer.pens) + } else { + _this.dispatch('node' + (e.button === 2 ? 'RightClick' : ''), _this.moveIn.activeNode) + } + } + } else if (e.altKey) { + if (_this.moveIn.hoverNode) { + _this.activeLayer.setPens([_this.moveIn.hoverNode]) + _this.dispatch('node' + (e.button === 2 ? 'RightClick' : ''), _this.moveIn.hoverNode) + } else if (_this.moveIn.hoverLine) { + _this.activeLayer.setPens([_this.moveIn.hoverLine]) + _this.dispatch('line', _this.moveIn.hoverLine) + } + } else if (_this.activeLayer.pens.length < 2) { + _this.activeLayer.setPens([_this.moveIn.activeNode]) + _this.dispatch('node' + (e.button === 2 ? 'RightClick' : ''), Object.assign(_this.moveIn.activeNode, { + evs: { + x: e.pageX, + y: e.pageY + } + })) + } + if (_this.data.locked || _this.moveIn.activeNode.locked) { + _this.moveIn.activeNode.click() + } + _this.activeLayer.calcActiveRect() + break + case MoveInType.Graffiti: // 涂鸦起点 + var pt = _this.calibrateMouse({ x: e.x, y: e.y }) + _this.moveIn.hoverNode.pushPoint(new Point(pt.x, pt.y)) + break + } + // Save node rects to move. + if (_this.activeLayer.pens.length) { + _this.activeLayer.saveNodeRects() + } + _this.render() + } + this.onmouseup = function (e) { + if (!_this.mouseDown) { return } + _this.mouseDown = undefined + _this.lastTranlated.x = 0 + _this.lastTranlated.y = 0 + _this.hoverLayer.dockAnchor = undefined + _this.hoverLayer.dockLineX = 0 + _this.hoverLayer.dockLineY = 0 + _this.divLayer.canvas.style.cursor = 'default' + if (_this.hoverLayer.dragRect) { + _this.getPensInRect(_this.hoverLayer.dragRect) + if (_this.activeLayer.pens && _this.activeLayer.pens.length > 1) { + _this.dispatch('multi', _this.activeLayer.pens) + } else if (_this.activeLayer.pens && _this.activeLayer.pens[0] && _this.activeLayer.pens[0].type === PenType.Line) { + _this.dispatch('line' + (e.button === 2 ? 'RightClick' : ''), _this.activeLayer.pens[0]) + } else if (_this.activeLayer.pens && _this.activeLayer.pens[0] && _this.activeLayer.pens[0].type === PenType.Node) { + _this.dispatch('node' + (e.button === 2 ? 'RightClick' : ''), _this.activeLayer.pens[0]) + } + _this.activeLayer.calcActiveRect() + } else { + const pt = _this.calibrateMouse({ x: e.x, y: e.y }) + switch (_this.moveIn.type) { + case MoveInType.Nodes: + if (e.ctrlKey && e.shiftKey && e.altKey) { + if (!_this.moveIn.hoverNode.manualAnchors) { + _this.moveIn.hoverNode.manualAnchors = [] + } + const point = new Point(pt.x, pt.y) + point.id = _this.moveIn.hoverNode.id + _this.moveIn.hoverNode.manualAnchors.push(point) + _this.moveIn.hoverNode.calcAnchors() + _this.needCache = true + } + break + // Add the line. + case MoveInType.HoverAnchors: + // New active. + if (_this.hoverLayer.line) { + let willAddLine = void 0 + const _a = _this.hoverLayer.line; const from = _a.from; const to = _a.to + if (_this.hoverLayer.line.to.id) { + if (!_this.options.disableRepeatLine) { + willAddLine = true + } else { + const lines = _this.data.pens.filter(function (pen) { + return pen.type === PenType.Line && + pen.from.isSameAs(_this.hoverLayer.line.from) && + pen.to.isSameAs(_this.hoverLayer.line.to) + }) + willAddLine = lines.length <= 1 + } + // 判断是否是当前锚点连接当前锚点 + if (from.id === to.id && from.anchorIndex === to.anchorIndex) { + willAddLine = false + } + } else { + willAddLine = !_this.options.disableEmptyLine && !_this.hoverLayer.line.disableEmptyLine + // from 与 to 的距离若小于等于 5 认为是误操作,不会添加连线 + willAddLine = willAddLine && Math.pow((from.x - to.x), 2) + Math.pow((from.y - to.y), 2) > 25 + } + if (willAddLine) { + _this.activeLayer.pens = [_this.hoverLayer.line] + _this.dispatch('addLine', _this.hoverLayer.line) + } else { + _this.data.pens.pop() + _this.activeLayer.clear() + } + } + _this.offscreen.render() + _this.hoverLayer.line = undefined + break + case MoveInType.AutoAnchor: + if ((_this.hoverLayer.line.disableEmptyLine || _this.options.disableEmptyLine) && + (!_this.hoverLayer.line.from.id || !_this.hoverLayer.line.to.id)) { + _this.needCache = true + _this.activeLayer.clear() + _this.data.pens.splice(_this.findIndex(_this.hoverLayer.line), 1) + } else { + _this.activeLayer.updateLines() + _this.dispatch('addLine', _this.hoverLayer.line) + } + break + case MoveInType.Rotate: + _this.activeLayer.updateRotate() + break + case MoveInType.LineControlPoint: + Store.set(_this.generateStoreKey('pts-') + _this.moveIn.hoverLine.id, undefined) + break + case MoveInType.LineFrom: + case MoveInType.LineTo: + if ((_this.hoverLayer.line.disableEmptyLine || _this.options.disableEmptyLine) && + (!_this.hoverLayer.line.from.id || !_this.hoverLayer.line.to.id)) { + _this.needCache = true + _this.activeLayer.clear() + _this.data.pens.splice(_this.findIndex(_this.hoverLayer.line), 1) + } + if (_this.hoverLayer.line.from.id && _this.hoverLayer.line.to.id) { + _this.dispatch('lineOn', Object.assign(_this.hoverLayer.line, { + lineOnDirection: _this.moveIn.type + })) + } + break + case MoveInType.Graffiti: + if (!_this.moveIn.hoverNode.points || _this.moveIn.hoverNode.points.length < 2) { + _this.moveIn.type = MoveInType.None + _this.data.pens.pop() + } else { + _this.moveIn.type = MoveInType.Nodes + _this.moveIn.hoverNode.doing = undefined + _this.moveIn.hoverNode.calcAnchors() + _this.activeLayer.setPens([_this.moveIn.hoverNode]) + _this.hoverLayer.node = _this.moveIn.hoverNode + _this.needCache = true + } + break + case MoveInType.Lines: + var previous = void 0 + if (_this.moveIn.hoverLine.children && _this.moveIn.hoverLine.children.length) { + previous = _this.moveIn.hoverLine.children[_this.moveIn.hoverLine.children.length - 1] + } + if (!previous) { + _this.moveIn.hoverLine.children = [] + } + var line = new Line({ + parentId: _this.moveIn.hoverLine.id, + name: 'line', + from: new Point(pt.x, pt.y), + fromArrow: previous ? '' : _this.data.fromArrow, + to: new Point(pt.x, pt.y), + toArrow: '', + strokeStyle: _this.options.color, + lineWidth: _this.data.lineWidth + }) + if (previous) { + line.from.id = previous.id + line.from.x = previous.to.x + line.from.y = previous.to.y + previous.to.id = line.id + } + _this.moveIn.hoverLine.children.push(line) + _this.hoverLayer.line = line + _this.dispatch('addLineInLines', { previous: previous, line: line }) + } + } + _this.hoverLayer.dragRect = undefined + _this.activeLayer.lastOffsetX = 0 + _this.activeLayer.lastOffsetY = 0 + _this.render() + if (_this.needCache) { + _this.cache() + } + _this.needCache = false + } + this.ondblclick = function () { + if (_this.moveIn.hoverNode) { + _this.dispatch('dblclick', _this.moveIn.hoverNode) + if (!(_this.data.locked || _this.moveIn.hoverNode.locked || _this.moveIn.hoverNode.hideInput || _this.options.hideInput)) { + _this.showInput(_this.moveIn.hoverNode) + } + _this.moveIn.hoverNode.dblclick() + } else if (_this.moveIn.hoverLine) { + _this.dispatch('dblclick', _this.moveIn.hoverLine) + if (!(_this.data.locked || _this.moveIn.hoverLine.locked || _this.moveIn.hoverLine.hideInput || _this.options.hideInput)) { + _this.showInput(_this.moveIn.hoverLine) + } + _this.moveIn.hoverLine.dblclick() + } + } + this.onkeydown = function (key) { + if (_this.data.locked || + key.target.tagName === 'INPUT' || + key.target.tagName === 'TEXTAREA') { + return + } + let done = false + let moveX = 0 + let moveY = 0 + switch (key.key) { + case ' ': + _this.spaceDown = true + break + case 'a': + case 'A': + _this.activeLayer.setPens(_this.data.pens) + done = true + break + case 'Delete': + case 'Backspace': + if (key.ctrlKey || key.metaKey) { + _this.deleteAnchors() + } else { + _this.delete() + } + break + case 'ArrowLeft': + moveX = -5 + if (key.ctrlKey || key.metaKey) { + moveX = -1 + } + done = true + break + case 'ArrowUp': + moveY = -5 + if (key.ctrlKey || key.metaKey) { + moveY = -1 + } + done = true + break + case 'ArrowRight': + moveX = 5 + if (key.ctrlKey || key.metaKey) { + moveX = 1 + } + done = true + break + case 'ArrowDown': + moveY = 5 + if (key.ctrlKey || key.metaKey) { + moveY = 1 + } + done = true + break + case 'x': + case 'X': + _this.cut() + break + case 'c': + case 'C': + _this.copy() + break + case 'v': + case 'V': + _this.paste() + break + case 'y': + case 'Y': + if (key.ctrlKey || key.metaKey) { + _this.redo() + } + break + case 'z': + case 'Z': + if (key.shiftKey) { + _this.redo() + } else if (key.ctrlKey || key.metaKey) { + _this.undo() + } + break + case 'Enter': + if (_this.moveIn.type === MoveInType.Lines) { + _this.moveIn.type = MoveInType.None + _this.moveIn.hoverLine.doing = '' + if (_this.hoverLayer.line.getLen() < 10) { + _this.moveIn.hoverLine.children.pop() + _this.hoverLayer.line = _this.moveIn.hoverLine.children[_this.moveIn.hoverLine.children.length - 1] + } + if (_this.moveIn.hoverLine.isNode) { + const pts_1 = [] + _this.moveIn.hoverLine.children.forEach(function (l) { + pts_1.push(l.from) + if (l.controlPoints) { + l.controlPoints.forEach(function (pt) { + pt.data = true + pts_1.push(pt) + }) + } + pts_1.push(l.to) + }) + const _a = getBboxOfPoints(pts_1); const x1 = _a.x1; const y1 = _a.y1; const x2 = _a.x2; const y2 = _a.y2 + const n = new Node({ + name: 'lines', + rect: new Rect(x1, y1, x2 - x1, y2 - y1), + points: pts_1, + closePath: _this.moveIn.hoverLine.closePath + }) + _this.activeLayer.add(n) + _this.data.pens.pop() + _this.data.pens.push(n) + } else { + _this.hoverLayer.line.toArrow = _this.data.toArrow + _this.activeLayer.add(_this.moveIn.hoverLine) + } + _this.moveIn.hoverLine = undefined + } + done = true + break + case 'Escape': + if (_this.moveIn.type === MoveInType.Lines) { + _this.moveIn.type = MoveInType.None + _this.moveIn.hoverLine.children.pop() + _this.hoverLayer.line = _this.moveIn.hoverLine.children[_this.moveIn.hoverLine.children.length - 1] + _this.hoverLayer.line.toArrow = _this.data.toArrow + _this.moveIn.hoverLine.doing = '' + _this.moveIn.hoverLine = undefined + } + done = true + break + } + if (!done) { + return + } + key.preventDefault() + key.stopPropagation() + if (moveX || moveY) { + _this.activeLayer.saveNodeRects() + _this.activeLayer.move(moveX, moveY) + _this.animateLayer.animate() + } + _this.render() + _this.cache() + } + this._emitter = mitt() + this.options = Object.assign({}, DefalutOptions, options) + Store.set(this.generateStoreKey('LT:color'), this.options.color || '#222222') + Store.set(this.generateStoreKey('LT:fontColor'), this.options.fontColor || '#222222') + this.setupDom(parent) + this.setupSubscribe() + this.setupMouseEvent() + // Wait for parent dom load + setTimeout(function () { + _this.canvasPos = _this.divLayer.canvas.getBoundingClientRect() + }, 500) + setTimeout(function () { + _this.canvasPos = _this.divLayer.canvas.getBoundingClientRect() + }, 1000) + this.cache() + window.topology = this + this.dispatch('loaded') + } + Object.defineProperty(Topology.prototype, 'ramCaches', { + // 内存中的 caches 数量 + get: function () { + return 5 + }, + enumerable: true, + configurable: true + }) + Object.defineProperty(Topology.prototype, 'clearElementIdPensName', { + // 需要清除 elementId 的图形,复制时用 + get: function () { + return ['echarts', 'textbox'] + }, + enumerable: true, + configurable: true + }) + Topology.prototype.setupDom = function (parent) { + if (typeof parent === 'string') { + this.parentElem = document.getElementById(parent) + } else { + this.parentElem = parent + } + this.parentElem.style.position = 'relative' + this.parentElem.style.overflow = 'auto' + this.parentElem.onresize = this.winResize + window.addEventListener('resize', this.winResize) + const id = this.id + this.activeLayer = new ActiveLayer(this.options, id) + this.activeLayer.topology = this + this.hoverLayer = new HoverLayer(this.options, id) + this.animateLayer = new AnimateLayer(this.options, id) + this.offscreen = new Offscreen(this.parentElem, this.options, id) + this.canvas = new RenderLayer(this.parentElem, this.options, id) + this.divLayer = new DivLayer(this.parentElem, this.options, id) + this.input.style.position = 'absolute' + this.input.style.zIndex = '-1' + this.input.style.left = '-1000px' + this.input.style.width = '0' + this.input.style.height = '0' + this.input.style.outline = 'none' + this.input.style.border = '1px solid #cdcdcd' + this.input.style.resize = 'none' + this.parentElem.appendChild(this.input) + this.createMarkdownTip() + this.resize() + } + Topology.prototype.setupSubscribe = function () { + const _this = this + this.subcribe = Store.subscribe(this.generateStoreKey('LT:render'), function () { + _this.render() + }) + this.subcribeRender = Store.subscribe('LT:render', function () { + _this.render() + }) + this.subcribeImage = Store.subscribe(this.generateStoreKey('LT:imageLoaded'), function () { + if (_this.imageTimer) { + clearTimeout(_this.imageTimer) + } + _this.imageTimer = setTimeout(function () { + _this.render() + }, 100) + }) + this.subcribeAnimateMoved = Store.subscribe(this.generateStoreKey('LT:rectChanged'), function (e) { + _this.activeLayer.updateLines([e]) + }) + this.subcribeMediaEnd = Store.subscribe(this.generateStoreKey('mediaEnd'), function (node) { + if (node.nextPlay) { + _this.animateLayer.readyPlay(node.nextPlay) + _this.animateLayer.animate() + } + _this.dispatch('mediaEnd', node) + }) + this.subcribeAnimateEnd = Store.subscribe(this.generateStoreKey('animateEnd'), function (pen) { + if (!pen) { + return + } + switch (pen.type) { + case PenType.Node: + _this.offscreen.render() + break + } + _this.dispatch('animateEnd', pen) + }) + this.subcribeEmit = Store.subscribe(this.generateStoreKey('LT:emit'), function (e) { + // TODO: 此处为何不使用 dispatch + _this.emit(e.event, e) + }) + } + Topology.prototype.setupMouseEvent = function () { + const _this = this + this.canvasPos = this.divLayer.canvas.getBoundingClientRect() + this.parentElem.addEventListener('scroll', this.onScroll) + window.addEventListener('scroll', this.onScroll) + this.divLayer.canvas.ondragover = function (event) { return event.preventDefault() } + this.divLayer.canvas.ondrop = function (event) { + if (_this.data.locked) { + return + } + try { + const json = event.dataTransfer.getData('Topology') || event.dataTransfer.getData('Text') + if (!json) { return } + const obj = JSON.parse(json) + event.preventDefault() + const pt = _this.calibrateMouse({ x: event.offsetX, y: event.offsetY }) + _this.dropNodes(Array.isArray(obj) ? obj : [obj], pt.x, pt.y) + _this.activeLayer.calcActiveRect() + } catch (_a) { } + } + if (isMobile()) { + this.options.refresh = 50 + // ipad + document.addEventListener('gesturestart', this.preventDefault) + // end + this.divLayer.canvas.ontouchstart = function (event) { + _this.touchStart = Date.now() + const pos = new Point(event.changedTouches[0].pageX - window.scrollX - (_this.canvasPos.left || _this.canvasPos.x), event.changedTouches[0].pageY - window.scrollY - (_this.canvasPos.top || _this.canvasPos.y)) + if (event.touches.length > 1) { + _this.touches = event.touches + _this.touchScale = _this.data.scale + _this.lastTranlated.x = pos.x + _this.lastTranlated.y = pos.y + return + } + const pt = _this.calibrateMouse({ x: pos.x, y: pos.y }) + _this.getMoveIn(pt) + _this.hoverLayer.node = _this.moveIn.hoverNode + _this.hoverLayer.line = _this.moveIn.hoverLine + _this.lastTranlated.x = pos.x + _this.lastTranlated.y = pos.y + _this.onmousedown({ + x: pos.x, + y: pos.y, + ctrlKey: event.ctrlKey || event.metaKey, + shiftKey: event.shiftKey, + altKey: event.altKey, + button: 0 + }) + } + this.divLayer.canvas.ontouchmove = function (event) { + event.stopPropagation() + const touches = event.changedTouches + const len = touches.length + if (!_this.touchCenter && len > 1) { + _this.touchCenter = { + x: touches[0].pageX + (touches[1].pageX - touches[0].pageX) / 2, + y: touches[0].pageY + (touches[1].pageY - touches[0].pageY) / 2 + } + // 计算鼠标位置根据画布偏移 + _this.calibrateMouse(_this.touchCenter) + } + const timeNow = Date.now() + if (timeNow - _this.touchStart < 50) { + return + } + if (len > 1) { + if (len === 2) { + const scale = event.scale || + Math.hypot(touches[0].pageX - touches[1].pageX, touches[0].pageY - touches[1].pageY) / + Math.hypot(_this.touches[0].pageX - _this.touches[1].pageX, _this.touches[0].pageY - _this.touches[1].pageY) + event.preventDefault() + _this.scaleTo(scale * _this.touchScale, _this.touchCenter) + } else if (len === 3) { + const pos_1 = new Point(touches[0].pageX - window.scrollX - (_this.canvasPos.left || _this.canvasPos.x), touches[0].pageY - window.scrollY - (_this.canvasPos.top || _this.canvasPos.y)) + _this.translate(pos_1.x, pos_1.y, true) + } + return + } + event.preventDefault() + const pos = new Point(event.changedTouches[0].pageX - window.scrollX - (_this.canvasPos.left || _this.canvasPos.x), event.changedTouches[0].pageY - window.scrollY - (_this.canvasPos.top || _this.canvasPos.y)) + _this.onMouseMove({ + x: pos.x, + y: pos.y, + ctrlKey: event.ctrlKey || event.metaKey, + shiftKey: event.shiftKey, + altKey: event.altKey, + buttons: 1 + }) + } + this.divLayer.canvas.ontouchend = function (event) { + _this.touches = undefined + _this.ontouchend(event) + } + } else { + this.divLayer.canvas.onmousedown = function (event) { + if (event.target.nodeName === 'INPUT' && event.target.type === 'range' && _this.data.locked) { + return + } + if (_this.touchedNode) { + if (_this.touchedNode.name === 'graffiti') { + _this.touchedNode.rect = new Rect(0, 0, 0, 0) + _this.addNode(_this.touchedNode) + _this.touchedNode = undefined + } else if (_this.touchedNode.name === 'lines') { + _this.addLine(_this.touchedNode) + _this.touchedNode = undefined + } + } + const e = { + x: event.pageX - window.scrollX - (_this.canvasPos.left || _this.canvasPos.x), + y: event.pageY - window.scrollY - (_this.canvasPos.top || _this.canvasPos.y), + ctrlKey: event.ctrlKey || event.metaKey, + shiftKey: event.shiftKey, + altKey: event.altKey, + button: event.button, + pageX: event.pageX, + pageY: event.pageY + } + _this.lastTranlated.x = e.x + _this.lastTranlated.y = e.y + _this.onmousedown(e) + } + this.divLayer.canvas.onmousemove = function (event) { + _this.onMouseMove({ + x: event.pageX - window.scrollX - (_this.canvasPos.left || _this.canvasPos.x), + y: event.pageY - window.scrollY - (_this.canvasPos.top || _this.canvasPos.y), + ctrlKey: event.ctrlKey || event.metaKey, + shiftKey: event.shiftKey, + altKey: event.altKey, + buttons: event.buttons, + pageX: event.pageX, + pageY: event.pageY + }) + } + this.divLayer.canvas.onmouseup = function (event) { + const e = { + x: event.pageX - window.scrollX - (_this.canvasPos.left || _this.canvasPos.x), + y: event.pageY - window.scrollY - (_this.canvasPos.top || _this.canvasPos.y), + ctrlKey: event.ctrlKey || event.metaKey, + shiftKey: event.shiftKey, + altKey: event.altKey, + button: event.button + } + _this.onmouseup(e) + if (!_this.touchedNode) { + return + } + _this.touchedNode.rect.x = event.pageX - window.scrollX - _this.canvasPos.x - _this.touchedNode.rect.width / 2 + _this.touchedNode.rect.y = event.pageY - window.scrollY - _this.canvasPos.y - _this.touchedNode.rect.height / 2 + const node = new Node(_this.touchedNode) + _this.addNode(node, true) + _this.touchedNode = undefined + } + } + this.divLayer.canvas.ondblclick = this.ondblclick + this.divLayer.canvas.tabIndex = 0 + this.divLayer.canvas.onblur = function () { + _this.mouseDown = undefined + } + this.divLayer.canvas.onwheel = function (event) { + if (_this.data.locked === Lock.NoEvent) { return } + const timeNow = new Date().getTime() + if (timeNow - _this.touchStart < 20) { + event.preventDefault() + event.stopPropagation() + return + } + _this.touchStart = new Date().getTime() + if (_this.options.disableScale) { + return + } + switch (_this.options.scaleKey) { + case KeyType.Ctrl: + if (!event.ctrlKey && !event.metaKey) { + return + } + break + case KeyType.Shift: + if (!event.shiftKey) { + return + } + break + case KeyType.Alt: + if (!event.altKey) { + return + } + break + } + event.preventDefault() + event.stopPropagation() + const pos = new Point(event.x - window.scrollX - (_this.canvasPos.left || _this.canvasPos.x), event.y - window.scrollY - (_this.canvasPos.top || _this.canvasPos.y)) + // 计算鼠标位置根据画布偏移 + _this.calibrateMouse(pos) + let scale = _this.data.scale + if (event.deltaY < 0) { + scale += 0.1 + } else { + scale -= 0.1 + } + _this.scaleTo(scale, pos) + _this.divLayer.canvas.focus() + return false + } + switch (this.options.keydown) { + case KeydownType.Document: + document.addEventListener('keydown', this.onkeydown) + document.addEventListener('keyup', function () { + _this.spaceDown = false + }) + break + case KeydownType.Canvas: + this.divLayer.canvas.addEventListener('keydown', this.onkeydown) + break + } + } + Topology.prototype.ontouchend = function (event) { + const pos = new Point(event.changedTouches[0].pageX - window.scrollX - (this.canvasPos.left || this.canvasPos.x), event.changedTouches[0].pageY - window.scrollY - (this.canvasPos.top || this.canvasPos.y)) + this.onmouseup({ + x: pos.x, + y: pos.y, + ctrlKey: event.ctrlKey || event.metaKey, + shiftKey: event.shiftKey, + altKey: event.altKey, + button: 0 + }) + if (!this.touchedNode) { + return + } + this.touchedNode.rect.x = + event.changedTouches[0].pageX - window.scrollX - this.canvasPos.x - this.touchedNode.rect.width / 2 + this.touchedNode.rect.y = + event.changedTouches[0].pageY - window.scrollY - this.canvasPos.y - this.touchedNode.rect.height / 2 + const node = new Node(this.touchedNode) + this.addNode(node, true) + this.touchedNode = undefined + } + Topology.prototype.resize = function (size) { + this.canvas.resize(size) + this.offscreen.resize(size) + this.divLayer.resize(size) + this.render() + this.dispatch('resize', size) + } + Topology.prototype.dropNodes = function (jsonList, offsetX, offsetY) { + const _this = this + let x = 0; let y = 0 + if (jsonList.length && jsonList[0].rect) { + const rect = jsonList[0].rect + x = rect.x + y = rect.y + } + let firstNode + jsonList.forEach(function (json) { + json.id = s8() + if (json.name === 'graffiti') { + json.rect = new Rect(0, 0, 0, 0) + _this.addNode(json) + return + } else if (json.name === 'lines') { + _this.addLine(json) + _this.mouseDown = { + x: offsetX, + y: offsetY + } + _this.onmouseup(_this.mouseDown) + return + } + if (!firstNode) { + json.rect.x = (offsetX - json.rect.width / 2) << 0 + json.rect.y = (offsetY - json.rect.height / 2) << 0 + firstNode = json + } else { + // Layout relative to the first node + const rect = json.rect + const dx = rect.x - x; const dy = rect.y - y + json.rect.x = firstNode.rect.x + dx + json.rect.y = firstNode.rect.y + dy + } + if (json.type === PenType.Line) { + _this.addLine(Object.assign({ + name: 'line', + from: new Point(json.rect.x, json.rect.y), + fromArrow: _this.data.fromArrow, + to: new Point(json.rect.x + json.rect.width, json.rect.y + json.rect.height), + toArrow: _this.data.toArrow, + strokeStyle: _this.options.color + }, json), true) + } else { + _this.addNode(json, true) + } + }) + this.divLayer.canvas.focus() + } + Topology.prototype.addNode = function (node, focus) { + const _this = this + if (focus === void 0) { focus = false } + if (!drawNodeFns[node.name]) { + return null + } + node.TID = this.id + // if it's not a Node + if (!node.init) { + node = new Node(node) + } + if (!node.strokeStyle && this.options.color) { + node.strokeStyle = this.options.color + } + fontKeys.forEach(function (key) { + if (!node[key]) { + node[key] = _this.options[key] + } + }) + if (this.data.scale !== 1) { + node.scale(this.data.scale) + } + this.data.pens.push(node) + if (focus) { + // fix bug: add echart + if (node.name === 'echarts') { + setTimeout(function () { + _this.activeLayer.pens = [node] + _this.render() + }, 50) + } else { + this.activeLayer.pens = [node] + } + } + if (node.name !== 'graffiti' || !node.doing) { + this.render() + this.animate(true) + this.cache() + } else { + this.moveIn.type = MoveInType.Graffiti + this.moveIn.hoverNode = node + } + this.dispatch('addNode', node) + return node + } + Topology.prototype.addLine = function (line, focus) { + if (focus === void 0) { focus = false } + if (line.type === PenType.Node) { + line.isNode = true + } + line.TID = this.id + if (!line.clone) { + line = new Line(line) + line.calcControlPoints(true) + } + if (this.data.scale !== 1) { + line.fontSize *= this.data.scale + } + this.data.pens.push(line) + if (line.name !== 'lines' || !line.doing) { + if (focus) { + this.activeLayer.setPens([line]) + this.render() + this.animate(true) + this.cache() + this.dispatch('addLine', line) + } + } else { + this.activeLayer.clear() + this.hoverLayer.line = undefined + this.moveIn.type = MoveInType.Lines + this.moveIn.hoverLine = line + } + return line + } + // Render or redraw + Topology.prototype.render = function (noFocus) { + if (noFocus) { + this.activeLayer.pens = [] + this.hoverLayer.node = undefined + this.hoverLayer.line = undefined + } + if (this.rendering) { + return this + } + this.rendering = true + // 获取 ctx 对象 + const ctx = this.offscreen.canvas.getContext('2d') + ctx.clearRect(0, 0, this.offscreen.canvas.width, this.offscreen.canvas.height) + ctx.save() + ctx.translate(this.data.x, this.data.y) + this.offscreen.render() + ctx.restore() + this.canvas.render() + this.rendering = false + } + // open - redraw by the data + Topology.prototype.open = function (data) { + if (typeof data !== 'string' && data && data.mqttOptions && !data.mqttOptions.customClientId) { + data.mqttOptions.clientId = s8() + } + this.canvas.clearBkImg() + this.data = createData(data, this.id) + this.subscribeSocket() + Store.set(this.generateStoreKey('LT:scale'), this.data.scale) + this.dispatch('scale', this.data.scale) + Store.set('LT:bkColor', this.data.bkColor) + this.lock(this.data.locked) + this.caches.list = [] + createCacheTable() // 清空数据 + this.caches.dbIndex = -1 + this.cache() + this.divLayer.clear() + this.animateLayer.stop() + this.render(true) + this.parentElem.scrollLeft = 0 + this.parentElem.scrollTop = 0 + this.animate(true) + this.openSocket() + this.openMqtt() + this.doInitJS() + this.dispatch('opened') + } + /** + * 执行初始化函数 initJS + * */ + Topology.prototype.doInitJS = function () { + if (this.data.initJS && this.data.initJS.trim()) { + // 字符串类型存在 + const fn = new Function(this.data.initJS) + fn() + } + } + Topology.prototype.openSocket = function (url) { + const _this = this + this.closeSocket() + if (url || this.data.websocket) { + this.socket = new Socket(url || this.data.websocket, function (e) { + if (_this.data.socketEvent !== 1) { + _this.doSocket(e.data) + } + _this.data.socketEvent && _this.dispatch('websocket', e.data) + }) + } + } + Topology.prototype.closeSocket = function () { + if (this.socket) { + this.socket.close() + } + } + Topology.prototype.openMqtt = function (url, options) { + const _this = this + this.closeMqtt() + if (url || this.data.mqttUrl) { + this.mqtt = new MQTT(url || this.data.mqttUrl, options || this.data.mqttOptions, this.data.mqttTopics, function (topic, message) { + if (_this.data.socketEvent !== 1) { + _this.doSocket(message.toString(), SocketEventType.Mqtt) + } + _this.data.socketEvent && _this.dispatch('mqtt', { topic: topic, message: message }) + }) + } + } + Topology.prototype.closeMqtt = function () { + if (this.mqtt) { + this.mqtt.close() + } + } + Topology.prototype.doSocket = function (message, type) { + const _this = this + if (type === void 0) { type = SocketEventType.WebSocket } + try { + message = JSON.parse(message) + if (!Array.isArray(message)) { + message = [message] + } + message.forEach(function (item) { + let actions = [] + if (item.actions) { + actions = item.actions + delete item.actions + } + const pens = find(item.id || item.tag, _this.data.pens) + pens.forEach(function (pen) { + if (pen.id === item.id || (pen.tags && pen.tags.indexOf(item.tag) > -1)) { + pen.fromData(pen, item) + pen.doWheres() + if (pen.events) { + pen.events.forEach(function (event) { + if (event.type === type) { + event.params = item + actions.push(event) + } + }) + } + actions && + actions.forEach(function (action) { + pen.doAction(action) + }) + } + }) + _this.willRender() + }) + } catch (error) { + console.warn(error) + } + } + Topology.prototype.overflow = function (padding) { + if (padding === void 0) { padding = 50 } + const rect = this.getRect() + let width = rect.width; let height = rect.height + if (width < rect.ex) { + width = rect.ex + padding + } + if (width < this.canvas.width) { + width = this.canvas.width + } + if (height < rect.ey) { + height = rect.ey + padding + } + if (height < this.canvas.height) { + height = this.canvas.height + } + const size = { width: width, height: height } + this.resize(size) + return size + } + Topology.prototype.setNodeText = function () { + this.inputObj.text = this.input.value + if (this.inputObj.name === 'image') { + this.inputObj.init() + } + this.input.style.zIndex = '-1' + this.input.style.left = '-1000px' + this.input.style.width = '0' + this.cache() + this.offscreen.render() + this.dispatch('setText', this.inputObj) + this.inputObj = undefined + } + Topology.prototype.getMoveIn = function (pt) { + if (this.moveIn.type >= MoveInType.Graffiti) { + return + } + this.lastHoverNode = this.moveIn.hoverNode + this.lastHoverLine = this.moveIn.hoverLine + this.moveIn.type = MoveInType.None + this.moveIn.hoverNode = undefined + this.moveIn.lineControlPoint = undefined + this.moveIn.hoverLine = undefined + this.hoverLayer.hoverAnchorIndex = -1 + if (!this.data.locked && + !(this.activeLayer.pens.length === 1 && this.activeLayer.pens[0].type) && + !this.activeLayer.locked() && + this.activeLayer.rotateCPs[0] && + this.activeLayer.rotateCPs[0].hit(pt, 15)) { + this.moveIn.type = MoveInType.Rotate + const cursor = this.options.rotateCursor + this.divLayer.canvas.style.cursor = cursor.includes('/') ? 'url("' + cursor + '"), auto' : cursor + return + } + if (this.activeLayer.pens.length > 1 && pointInRect(pt, this.activeLayer.sizeCPs)) { + this.moveIn.type = MoveInType.Nodes + } + if (!this.data.locked && !this.activeLayer.locked() && !this.options.hideSizeCP) { + if (this.activeLayer.pens.length > 1 || + (!this.activeLayer.pens[0].type && !this.activeLayer.pens[0].hideSizeCP)) { + for (var i = 0; i < this.activeLayer.sizeCPs.length; ++i) { + if (this.activeLayer.sizeCPs[i].hit(pt, 10)) { + this.moveIn.type = MoveInType.ResizeCP + this.moveIn.activeAnchorIndex = i + this.divLayer.canvas.style.cursor = resizeCursors[i] + return + } + } + } + } + // In active pen. + if (!this.data.locked) { + for (let _i = 0, _a = this.activeLayer.pens; _i < _a.length; _i++) { + const item = _a[_i] + if (item instanceof Line && !item.locked) { + for (var i = 0; i < item.controlPoints.length; ++i) { + if (!item.locked && item.controlPoints[i].hit(pt, 10)) { + item.controlPoints[i].id = i + this.moveIn.type = MoveInType.LineControlPoint + this.moveIn.lineControlPoint = item.controlPoints[i] + this.moveIn.hoverLine = item + this.divLayer.canvas.style.cursor = 'pointer' + return + } + } + if (this.inLine(pt, item)) { + return + } + } + } + } + this.divLayer.canvas.style.cursor = 'default' + const len = this.data.pens.length + let inLine + for (var i = len - 1; i > -1; --i) { + if (this.data.pens[i].type === PenType.Node && this.inNode(pt, this.data.pens[i])) { + if (inLine && this.moveIn.type !== MoveInType.HoverAnchors) { + this.inLine(pt, inLine) + } + return + } else if (this.data.pens[i].type === PenType.Line && this.inLine(pt, this.data.pens[i])) { + // 优先判断是否在节点锚点上 + inLine = this.data.pens[i] + } + } + } + Topology.prototype.inChildNode = function (pt, children) { + if (!children) { + return null + } + const len = children.length + for (let i = len - 1; i > -1; --i) { + const item = children[i] + if (!item.visible || item.locked === Lock.NoEvent) { + continue + } + if (item.type === PenType.Line) { + if (this.inLine(pt, item)) { + return item + } + continue + } + let node = this.inChildNode(pt, item.children) + if (node) { + return node + } + node = this.inNode(pt, item, true) + if (node) { + return node + } + } + return null + } + Topology.prototype.inNode = function (pt, node, inChild) { + if (inChild === void 0) { inChild = false } + if (this.data.locked === Lock.NoEvent || !node.visible || node.locked === Lock.NoEvent) { + return null + } + const child = this.inChildNode(pt, node.children) + if (child) { + if (this.moveIn.type < MoveInType.HoverAnchors) { + this.moveIn.type = MoveInType.Nodes + if (child.stand) { + this.moveIn.activeNode = child + } else { + this.moveIn.activeNode = node + } + } + return child + } + if (node.hitInSelf(pt)) { + this.moveIn.hoverNode = node + this.moveIn.type = MoveInType.Nodes + if (!this.data.locked && !node.locked) { + this.divLayer.canvas.style.cursor = 'move' + } else { + this.divLayer.canvas.style.cursor = this.options.hoverCursor + } + // Too small + if (!this.data.locked && + !node.locked && + !(this.options.hideAnchor || node.hideAnchor || node.rect.width < 20 || node.rect.height < 20)) { + for (var j = 0; j < node.rotatedAnchors.length; ++j) { + if (node.rotatedAnchors[j].hit(pt, this.options.anchorSize)) { + if (!this.mouseDown && node.rotatedAnchors[j].mode === AnchorMode.In) { + continue + } + this.moveIn.type = MoveInType.HoverAnchors + this.moveIn.hoverAnchorIndex = j + this.hoverLayer.hoverAnchorIndex = j + this.divLayer.canvas.style.cursor = 'crosshair' + break + } + } + if (this.options.autoAnchor && node.rect.center.hit(pt, this.options.anchorSize)) { + this.moveIn.hoverNode = node + this.moveIn.type = MoveInType.AutoAnchor + this.divLayer.canvas.style.cursor = 'crosshair' + } + } + if (!inChild) { + this.moveIn.activeNode = this.moveIn.hoverNode + } + return node + } + if (this.options.hideAnchor || node.hideAnchor || this.data.locked || node.locked) { + return null + } + if (node.hitInSelf(pt, this.options.anchorSize)) { + for (var j = 0; j < node.rotatedAnchors.length; ++j) { + if (node.rotatedAnchors[j].hit(pt, this.options.anchorSize)) { + if (!this.mouseDown && node.rotatedAnchors[j].mode === AnchorMode.In) { + continue + } + this.moveIn.hoverNode = node + this.moveIn.type = MoveInType.HoverAnchors + this.moveIn.hoverAnchorIndex = j + this.hoverLayer.hoverAnchorIndex = j + this.divLayer.canvas.style.cursor = 'crosshair' + if (!inChild) { + this.moveIn.activeNode = node + } + return node + } + } + } + return null + } + Topology.prototype.inLine = function (point, line) { + if (this.data.locked === Lock.NoEvent || !line.visible || line.locked === Lock.NoEvent) { + return null + } + if (line.children) { + for (let _i = 0, _a = line.children; _i < _a.length; _i++) { + const child = _a[_i] + const l = this.inLine(point, child) + if (l) { + return l + } + } + } + if (line.from) { + if (line.from.hit(point, this.options.anchorSize)) { + this.moveIn.type = MoveInType.LineFrom + this.moveIn.hoverLine = line + if (this.data.locked || line.locked) { + this.divLayer.canvas.style.cursor = this.options.hoverCursor + } else { + this.divLayer.canvas.style.cursor = 'move' + } + return line + } + if (line.to.hit(point, this.options.anchorSize)) { + this.moveIn.type = MoveInType.LineTo + this.moveIn.hoverLine = line + if (this.data.locked || line.locked) { + this.divLayer.canvas.style.cursor = this.options.hoverCursor + } else { + this.divLayer.canvas.style.cursor = 'move' + } + return line + } + if (line.pointIn(point)) { + this.moveIn.type = MoveInType.Line + this.moveIn.hoverLine = line + this.divLayer.canvas.style.cursor = this.options.hoverCursor + return line + } + } + return null + } + Topology.prototype.getLineDock = function (point, mode) { + if (mode === void 0) { mode = AnchorMode.Default } + this.hoverLayer.dockAnchor = undefined + for (let _i = 0, _a = this.data.pens; _i < _a.length; _i++) { + const item = _a[_i] + if (item instanceof Node) { + const pen = item.hit(point, 10) + if (!pen) { + continue + } + if (pen.type === PenType.Line) { + if (pen.from.hit(point, 10)) { + point.x = pen.from.x + point.y = pen.from.y + this.hoverLayer.dockAnchor = pen.from + break + } + if (pen.to.hit(point, 10)) { + point.x = pen.to.x + point.y = pen.to.y + this.hoverLayer.dockAnchor = pen.to + break + } + break + } + this.hoverLayer.node = pen + if (this.options.autoAnchor && pen.rect.center.hit(point, 10)) { + point.id = pen.id + point.autoAnchor = true + point.x = pen.rect.center.x + point.y = pen.rect.center.y + this.hoverLayer.dockAnchor = pen.rect.center + } + for (let i = 0; i < pen.rotatedAnchors.length; ++i) { + if (pen.rotatedAnchors[i].mode && pen.rotatedAnchors[i].mode !== mode) { + continue + } + if (pen.rotatedAnchors[i].hit(point, 10)) { + point.id = pen.id + point.anchorIndex = i + point.autoAnchor = false + point.direction = pen.rotatedAnchors[i].direction + point.x = pen.rotatedAnchors[i].x + point.y = pen.rotatedAnchors[i].y + this.hoverLayer.dockAnchor = pen.rotatedAnchors[i] + break + } + } + if (this.hoverLayer.dockAnchor) { + break + } + } else if (item instanceof Line) { + if (item.id === this.hoverLayer.line.id) { + continue + } + if (item.children) { + let found = false + for (let _b = 0, _c = item.children; _b < _c.length; _b++) { + const child = _c[_b] + if (child.from.hit(point, 10)) { + point.x = child.from.x + point.y = child.from.y + this.hoverLayer.dockAnchor = child.from + found = true + break + } + if (child.to.hit(point, 10)) { + point.x = child.to.x + point.y = child.to.y + this.hoverLayer.dockAnchor = child.to + found = true + break + } + if (child.controlPoints) { + for (let _d = 0, _e = child.controlPoints; _d < _e.length; _d++) { + var cp = _e[_d] + if (cp.hit(point, 10)) { + point.x = cp.x + point.y = cp.y + this.hoverLayer.dockAnchor = cp + found = true + break + } + } + } + } + if (found) { + continue + } + } else { + if (item.from.hit(point, 10)) { + point.x = item.from.x + point.y = item.from.y + this.hoverLayer.dockAnchor = item.from + continue + } + if (item.to.hit(point, 10)) { + point.x = item.to.x + point.y = item.to.y + this.hoverLayer.dockAnchor = item.to + continue + } + if (item.controlPoints) { + for (let _f = 0, _g = item.controlPoints; _f < _g.length; _f++) { + var cp = _g[_f] + if (cp.hit(point, 10)) { + point.x = cp.x + point.y = cp.y + this.hoverLayer.dockAnchor = cp + break + } + } + } + } + } + } + return point + } + Topology.prototype.getPensInRect = function (rect) { + const _this = this + if (rect.width < 0) { + rect.width = -rect.width + rect.x = rect.ex + rect.ex = rect.x + rect.width + } + if (rect.height < 0) { + rect.height = -rect.height + rect.y = rect.ey + rect.ey = rect.y + rect.height + } + this.activeLayer.pens = [] + for (let _i = 0, _a = this.data.pens; _i < _a.length; _i++) { + const item = _a[_i] + if (item.locked === Lock.NoEvent) { + continue + } + if (item instanceof Node) { + if (rect.hitByRect(item.rect)) { + this.activeLayer.add(item) + } + } + if (item instanceof Line) { + if (item.children) { + item.children.forEach(function (child) { + if (rect.hit(child.from) && rect.hit(child.to)) { + _this.activeLayer.add(child) + } + }) + } else if (rect.hit(item.from) && rect.hit(item.to)) { + this.activeLayer.add(item) + } + } + } + } + Topology.prototype.getAngle = function (pt) { + if (pt.x === this.activeLayer.rect.center.x) { + return pt.y <= this.activeLayer.rect.center.y ? 0 : 180 + } + if (pt.y === this.activeLayer.rect.center.y) { + return pt.x < this.activeLayer.rect.center.x ? 270 : 90 + } + const x = pt.x - this.activeLayer.rect.center.x + const y = pt.y - this.activeLayer.rect.center.y + let angle = (Math.atan(Math.abs(x / y)) / (2 * Math.PI)) * 360 + if (x > 0 && y > 0) { + angle = 180 - angle + } else if (x < 0 && y > 0) { + angle += 180 + } else if (x < 0 && y < 0) { + angle = 360 - angle + } + if (this.activeLayer.pens.length === 1) { + return angle - this.activeLayer.pens[0].rotate + } + return angle + } + Topology.prototype.showInput = function (item) { + this.inputObj = item + const textRect = item.getTextRect() + this.input.value = item.text || '' + this.input.style.left = textRect.x + this.data.x + 'px' + this.input.style.top = textRect.y + this.data.y + 'px' + this.input.style.width = textRect.width + 'px' + this.input.style.height = textRect.height + 'px' + this.input.style.zIndex = '1000' + if (item.rotate / 360) { + this.input.style.transform = 'rotate(' + item.rotate + 'deg)' + } else { + this.input.style.transform = undefined + } + // 为 textarea 添加 class + this.input.classList.add('set-text-input') + this.input.focus() + } + // 包含画布偏移量的 Rect,相对与可视区域的内容 + Topology.prototype.getRect = function (pens) { + if (!pens) { + pens = this.data.pens + } + const rect = getRect(pens) + return new Rect(rect.x + this.data.x, rect.y + this.data.y, rect.width, rect.height) + } + // Get a dock rect for moving nodes. + Topology.prototype.getDockPos = function (offsetX, offsetY, noDock) { + this.hoverLayer.dockLineX = 0 + this.hoverLayer.dockLineY = 0 + const offset = { + x: 0, + y: 0 + } + if (noDock || this.options.disableDockLine) { + return offset + } + let x = 0 + let y = 0 + let disX = dockOffset + let disY = dockOffset + for (let _i = 0, _a = this.activeLayer.dockWatchers; _i < _a.length; _i++) { + const activePt = _a[_i] + for (let _b = 0, _c = this.data.pens; _b < _c.length; _b++) { + const item = _c[_b] + if (!(item instanceof Node) || this.activeLayer.has(item) || item.name === 'text') { + continue + } + // if (!item.dockWatchers) { + // item.getDockWatchers(); + // } + for (let _d = 0, _e = item.dockWatchers; _d < _e.length; _d++) { + const p = _e[_d] + x = Math.abs(p.x - activePt.x - offsetX) + if (x < disX) { + disX = -99999 + offset.x = p.x - activePt.x + this.hoverLayer.dockLineX = p.x | 0 + } + y = Math.abs(p.y - activePt.y - offsetY) + if (y < disY) { + disY = -99999 + offset.y = p.y - activePt.y + this.hoverLayer.dockLineY = p.y | 0 + } + } + } + } + return offset + } + Topology.prototype.cache = function () { + if (this.options.cacheLen == 0 || this.data && this.data.locked) { return } + if (this.caches.index < this.caches.list.length - 1) { + this.caches.list.splice(this.caches.index + 1, this.caches.list.length - this.caches.index - 1) + // 删除 indexDB 的值 + spliceCache(this.caches.dbIndex + 1) + } + const data = this.pureData() + this.caches.list.push(data) + pushCache(data, this.caches.dbIndex + 1, this.options.cacheLen) + if (this.caches.list.length > this.ramCaches) { + this.caches.list.shift() + } + this.caches.index = this.caches.list.length - 1 + this.caches.dbIndex++ // 向后移动 + } + Topology.prototype.cacheReplace = function (pens) { + if (this.options.cacheLen == 0) { return } + if (pens && pens.length) { + const needPenMap = {} + for (var i = 0, len = pens.length; i < len; i++) { + const pen = pens[i] + var id = pen.id + if (pen instanceof Node) { + needPenMap[id] = new Node(pen) + } else if (pen instanceof Line) { + needPenMap[id] = new Line(pen) + } + } + const cacheListData = this.caches.list[0] + if (!cacheListData) { + return + } + for (var i = 0, len = cacheListData.pens.length; i < len; i++) { + var id = cacheListData.pens[i].id + if (needPenMap[id]) { + cacheListData.pens[i] = needPenMap[id] + } + } + } + } + Topology.prototype.undo = function (noRedo, force) { + const _this = this + if (noRedo === void 0) { noRedo = false } + if (this.options.cacheLen == 0) { return } + if ((!force && this.data.locked) || this.caches.index < 1) { + return + } + this.divLayer.clear(true) + this.animateLayer.stop() + this.caches.dbIndex-- // 数据库中的位置前移 + this.data = createData(this.caches.list[--this.caches.index], this.id) + this.render(true) + this.divLayer.render() + if (noRedo) { + this.caches.list.splice(this.caches.index + 1, this.caches.list.length - this.caches.index - 1) + // 不允许恢复,同时删除数据库中的值 + spliceCache(this.caches.dbIndex) + } + // 当 index 到 list 中间时,开始向左侧添加 indexDB 中的内容 + if (this.caches.index <= this.caches.list.length / 2 - 1) { + const sub = this.caches.index - 0 + 1 // 距离左侧前一个的差距 + getCache(this.caches.dbIndex - sub).then(function (data) { + if (data) { + _this.caches.list.pop() + _this.caches.list.unshift(data) + _this.caches.index++ + } + }) + } + this.dispatch('undo', this.data) + } + Topology.prototype.redo = function (force) { + const _this = this + if (this.options.cacheLen == 0) { + return + } + if ((!force && this.data.locked) || this.caches.index > this.caches.list.length - 2) { + return + } + this.divLayer.clear(true) + this.caches.dbIndex++ // 向后移动 + this.data = createData(this.caches.list[++this.caches.index], this.id) + this.render(true) + this.divLayer.render() + // 当 index 到 list 中间时,开始向右侧加 + if (this.caches.index >= this.caches.list.length / 2) { + const add = this.caches.list.length - this.caches.index // 距离右侧的差距 + getCache(this.caches.dbIndex + add).then(function (data) { + if (data) { + _this.caches.list.shift() + _this.caches.list.push(data) + _this.caches.index-- + } + }) + } + this.dispatch('redo', this.data) + } + Topology.prototype.toImage = function (padding, callback) { + if (padding === void 0) { padding = 0 } + if (callback === void 0) { callback = undefined } + let backRect + if (this.data.bkImageRect) { + // 背景图片相对于画布的 rect + backRect = new Rect(this.data.bkImageRect.x - this.data.x, this.data.bkImageRect.y - this.data.y, this.data.bkImageRect.width, this.data.bkImageRect.height) + } + const rect = getMoreRect(getRect(this.data.pens), backRect) + const p = formatPadding(padding || 0) + rect.x -= p[3] + rect.y -= p[0] + rect.width += p[3] + p[1] + rect.height += p[0] + p[2] + rect.init() + const dpi = this.offscreen.getDpiRatio() + rect.scale(dpi) + backRect && backRect.scale(dpi, rect.center) + const canvas = document.createElement('canvas') + canvas.width = rect.width + canvas.height = rect.height + const ctx = canvas.getContext('2d') + if (this.data.bkColor || this.options.bkColor) { + ctx.fillStyle = this.data.bkColor || this.options.bkColor + ctx.fillRect(0, 0, canvas.width, canvas.height) + } + if (this.data.bkImage && backRect) { + ctx.drawImage(this.canvas.bkImg, backRect.x - rect.x, backRect.y - rect.y, backRect.width, backRect.height) + } + for (let _i = 0, _a = this.data.pens; _i < _a.length; _i++) { + const item = _a[_i] + let pen = void 0 + if (item.type) { + pen = new Line(item) + } else { + pen = new Node(item, true) + pen.animateFrames = [] + pen.img = item.img + pen.elementId = '' + pen.elementLoaded = true + pen.elementRendered = true + } + pen.scale(dpi, rect.center) + pen.translate(-rect.x, -rect.y, true) + pen.render(ctx) + } + ctx.scale(1 / dpi, 1 / dpi) + if (callback) { + canvas.toBlob(callback) + } + return canvas.toDataURL('image/png', 1) + } + Topology.prototype.saveAsImage = function (name, padding) { + if (padding === void 0) { padding = 0 } + const a = document.createElement('a') + a.setAttribute('download', name || 'le5le.topology.png') + a.setAttribute('href', this.toImage(padding)) + const evt = document.createEvent('MouseEvents') + evt.initEvent('click', true, true) + a.dispatchEvent(evt) + } + // param: + // - string ->idOrTag + // - Pen[] -> will deletes + Topology.prototype.delete = function (param, force) { + if (this.data.locked && !force) { + return + } + let deleted = [] + if (typeof param === 'string') { + deleted = del(param, this.data.pens) + } else { + const pens = param || this.activeLayer.pens + for (let i = 0; i < pens.length; i++) { + let item = pens[i] + if (item.type === PenType.Line && item.parentId) { + const parent_1 = find(item.parentId, this.data.pens)[0] + if (parent_1 && parent_1.name === 'lines') { + item = parent_1 + } + } + if (del(item.id, this.data.pens).length) { + deleted.push(item) + --i + if (item.type === PenType.Node) { + this.divLayer.removeDiv(item) + } + if (this.options.disableEmptyLine) { + this.delEmptyLines(item.id) + } + this.animateLayer.pens.delete(item.id) + } + } + } + if (deleted.length) { + this.render(true) + this.cache() + this.dispatch('delete', deleted) + } + } + Topology.prototype.deleteAnchors = function (param, force) { + if (this.data.locked && !force) { + return + } + const pens = param || this.activeLayer.pens + pens.forEach(function (pen) { + if (pen.type === PenType.Node) { + pen.manualAnchors = undefined + pen.calcAnchors() + } + }) + } + Topology.prototype.delEmptyLines = function (deleteedId) { + for (let i = 0; i < this.data.pens.length; i++) { + if (this.data.pens[i].type !== PenType.Line) { + continue + } + const line = this.data.pens[i] + if (!line.from.id || !line.to.id || line.from.id === deleteedId || line.to.id === deleteedId) { + this.data.pens.splice(i, 1) + this.animateLayer.pens.delete(line.id) + --i + } + } + } + Topology.prototype.cut = function () { + if (this.data.locked) { + return + } + this.clipboard = createData({ + pens: [] + }) + for (let i = 0; i < this.activeLayer.pens.length; i++) { + const pen = this.activeLayer.pens[i] + this.clipboard.pens.push(pen.clone()) + const found = this.findIndex(pen) + if (found > -1) { + if (pen.type === PenType.Node) { + this.divLayer.removeDiv(this.data.pens[found]) + } + this.data.pens.splice(found, 1) + } + } + this.cache() + this.activeLayer.clear() + this.hoverLayer.node = undefined + this.moveIn.hoverLine = undefined + this.moveIn.hoverNode = undefined + this.render() + this.dispatch('delete', this.clipboard.pens) + } + Topology.prototype.copy = function () { + this.clipboard = createData({ + pens: [] + }) + for (let _i = 0, _a = this.activeLayer.pens; _i < _a.length; _i++) { + const pen = _a[_i] + this.clipboard.pens.push(pen.clone()) + pen.parentId = null + } + this.dispatch('copy', this.clipboard) + } + Topology.prototype.paste = function () { + if (!this.clipboard || this.data.locked) { + return + } + this.hoverLayer.node = undefined + this.hoverLayer.line = undefined + this.activeLayer.pens = [] + const idMaps = {} + for (let _i = 0, _a = this.clipboard.pens; _i < _a.length; _i++) { + const pen = _a[_i] + this.pastePen(pen, idMaps, 20) + this.data.pens.push(pen) + this.activeLayer.add(pen) + } + this.render() + this.animate(true) + this.cache() + this.copy() + this.dispatch('paste', this.clipboard.pens) + } + /** + * 粘贴当前画笔,位置偏移 offset + * */ + Topology.prototype.pastePen = function (pen, idMaps, offset, parentId) { + if (idMaps === void 0) { idMaps = {} } + if (offset === void 0) { offset = 0 } + if (!pen.type) { + const old = pen.id + pen.id = s8() + idMaps[old] = pen.id + parentId && (pen.parentId = parentId) + pen.rect.x += offset + pen.rect.ex += offset + pen.rect.y += offset + pen.rect.ey += offset + // 存在自定义瞄点 + if (pen.manualAnchors) { + // 将 位置偏移 offset + pen.manualAnchors.forEach(function (pt) { + pt.x += offset + pt.y += offset + }) + } + // 存在 points + if (pen.points) { + // 将 位置偏移 offset + pen.points.forEach(function (pt) { + pt.x += offset + pt.y += offset + }) + } + // 若是 echarts 等 dom 元素 则清一下 elementId + if (this.clearElementIdPensName.includes(pen.name)) { + pen.elementId = undefined + } + pen.init() + } else if (pen instanceof Line) { + pen.id = s8() + parentId && (pen.parentId = parentId) + pen.from = new Point(pen.from.x + offset, pen.from.y + offset, pen.from.direction, pen.from.anchorIndex, idMaps[pen.from.id]) + pen.to = new Point(pen.to.x + offset, pen.to.y + offset, pen.to.direction, pen.to.anchorIndex, idMaps[pen.to.id]) + const controlPoints = [] + for (let _i = 0, _a = pen.controlPoints; _i < _a.length; _i++) { + const pt = _a[_i] + controlPoints.push(new Point(pt.x + offset, pt.y + offset)) + } + pen.controlPoints = controlPoints + } + if (pen.children) { + for (let _b = 0, _c = pen.children; _b < _c.length; _b++) { + const item = _c[_b] + this.pastePen(item, idMaps, offset, pen.id) + } + } + } + // newId(node: any, idMaps: any) { + // const old = node.id; + // node.id = s8(); + // idMaps[old] = node.id; + // if (node.children) { + // for (const item of node.children) { + // this.newId(item, idMaps); + // } + // } + // } + Topology.prototype.animate = function (autoplay) { + if (autoplay === void 0) { autoplay = false } + this.animateLayer.readyPlay(undefined, autoplay) + this.animateLayer.animate() + } + Topology.prototype.updateProps = function (cache, pens) { + if (cache === void 0) { cache = true } + if (!pens) { + pens = this.activeLayer.pens + } + for (let _i = 0, pens_1 = pens; _i < pens_1.length; _i++) { + const pen = pens_1[_i] + if (pen instanceof Node) { + if (pen.autoRect) { + const ctx = this.canvas.canvas.getContext('2d') + const rect = calcTextRect(ctx, pen) + pen.rect.width = rect.width + pen.lineWidth * 2 + pen.rect.height = rect.height + } + pen.init() + pen.initRect() + } + } + this.activeLayer.updateLines(pens) + this.activeLayer.calcControlPoints() + this.activeLayer.saveNodeRects() + this.render() + // tslint:disable-next-line: no-unused-expression + cache && this.cache() + } + Topology.prototype.lock = function (lock) { + this.data.locked = lock + for (let _i = 0, _a = this.data.pens; _i < _a.length; _i++) { + const item = _a[_i] + item.addToDiv && item.addToDiv() + } + this.dispatch('locked', this.data.locked) + } + Topology.prototype.lockPens = function (pens, lock) { + for (let _i = 0, _a = this.data.pens; _i < _a.length; _i++) { + const item = _a[_i] + for (let _b = 0, pens_2 = pens; _b < pens_2.length; _b++) { + const pen = pens_2[_b] + if (item.id === pen.id) { + item.locked = lock + item.addToDiv && item.addToDiv() + break + } + } + } + this.dispatch('lockPens', { + pens: pens, + lock: lock + }) + } + Topology.prototype.up = function (pen, pens) { + if (!pens) { + pens = this.data.pens + } + const i = this.findIndex(pen, pens) + if (i > -1 && i !== pens.length - 1) { + pens.splice(i + 2, 0, pens[i]) + pens.splice(i, 1) + } else { + const parent_2 = getParent(pens, pen) + if (!parent_2) { + return + } + this.up(pen, parent_2.children) + } + } + Topology.prototype.top = function (pen, pens) { + if (!pens) { + pens = this.data.pens + } + const i = this.findIndex(pen, pens) + if (i > -1) { + pens.push(pens[i]) + pens.splice(i, 1) + } else { + const parent_3 = getParent(pens, pen) + if (!parent_3) { + return + } + this.top(pen, parent_3.children) + } + } + Topology.prototype.down = function (pen, pens) { + if (!pens) { + pens = this.data.pens + } + const i = this.findIndex(pen, pens) + if (i > -1 && i !== 0) { + pens.splice(i - 1, 0, pens[i]) + pens.splice(i + 1, 1) + } else { + const parent_4 = getParent(pens, pen) + if (!parent_4) { + return + } + this.down(pen, parent_4.children) + } + } + Topology.prototype.bottom = function (pen, pens) { + if (!pens) { + pens = this.data.pens + } + const i = this.findIndex(pen, pens) + if (i > -1) { + pens.unshift(pens[i]) + pens.splice(i + 1, 1) + } else { + const parent_5 = getParent(pens, pen) + if (!parent_5) { + return + } + this.bottom(pen, parent_5.children) + } + } + Topology.prototype.getParent = function (pen) { + return getParent(this.data.pens, pen) + } + Topology.prototype.combine = function (pens, stand) { + if (stand === void 0) { stand = false } + if (!pens) { + pens = this.activeLayer.pens + } + const rect = getRect(pens) + for (let _i = 0, pens_3 = pens; _i < pens_3.length; _i++) { + var item = pens_3[_i] + var i = this.findIndex(item) + if (i > -1) { + this.data.pens.splice(i, 1) + } + } + let node = new Node({ + name: 'combine', + rect: new Rect(rect.x, rect.y, rect.width, rect.height), + text: '', + paddingLeft: 0, + paddingRight: 0, + paddingTop: 0, + paddingBottom: 0, + strokeStyle: 'transparent', + children: [] + }) + for (var i = 0; i < pens.length; ++i) { + if (pens[i].type === PenType.Node && rect.width === pens[i].rect.width && rect.height === pens[i].rect.height) { + node = pens[i] + if (!node.children) { + node.children = [] + } + pens.splice(i, 1) + break + } + } + for (let _a = 0, pens_4 = pens; _a < pens_4.length; _a++) { + var item = pens_4[_a] + item.stand = stand + item.parentId = node.id + item.calcRectInParent(node) + node.children.push(item) + } + this.data.pens.push(node) + this.activeLayer.setPens([node]) + this.dispatch('combine', node) + this.cache() + } + Topology.prototype.uncombine = function (node) { + if (!node) { + node = this.activeLayer.pens[0] + } + if (!(node instanceof Node)) { + return + } + for (let _i = 0, _a = node.children; _i < _a.length; _i++) { + const item = _a[_i] + item.parentId = undefined + item.rectInParent = undefined + item.locked = Lock.None + this.data.pens.push(item) + } + const i = this.findIndex(node) + if (i > -1 && node.name === 'combine') { + this.data.pens.splice(i, 1) + } else { + node.children = undefined + } + this.cache() + this.activeLayer.clear() + this.hoverLayer.clear() + this.dispatch('uncombine', node) + } + Topology.prototype.find = function (idOrTag, pens, array) { + let list + if (Array.isArray(pens)) { + list = pens + } else { + list = this.data.pens + array = pens + } + const result = find(idOrTag, list) + if (array) { + return result + } + if (result.length === 0) { + return null + } else if (result.length === 1) { + return result[0] + } + return result + } + Topology.prototype.findIndex = function (pen, pens) { + if (!pens) { + pens = this.data.pens + } + return pens.findIndex(function (item) { return item.id === pen.id }) + } + Topology.prototype.play = function (idOrTag, pause) { + this.divLayer.play(idOrTag, pause) + } + Topology.prototype.translate = function (x, y, process, noNotice) { + const _this = this + if (!process) { + this.lastTranlated.x = 0 + this.lastTranlated.y = 0 + } + const offsetX = x - this.lastTranlated.x + const offsetY = y - this.lastTranlated.y + this.data.x += offsetX + this.data.y += offsetY + // for (const item of this.data.pens) { + // item.translate(offsetX, offsetY); + // } + if (this.data.bkImageRect && !this.data.bkImageStatic) { + this.data.bkImageRect.translate(offsetX, offsetY) + } + Store.set(this.generateStoreKey('LT:updateLines'), this.data.pens) + this.lastTranlated.x = x + this.lastTranlated.y = y + this.render() + this.divLayer.render() + this.animateLayer.stop() + if (this.cacheTimer) { + clearTimeout(this.cacheTimer) + } + this.cacheTimer = setTimeout(function () { + let _a + _this.animateLayer.readyPlay(undefined, true) + _this.animateLayer.animate(); + (_a = _this.cache) === null || _a === void 0 ? void 0 : _a.call(_this) + }, 300) + if (!noNotice) { + this.dispatch('translate', { x: x, y: y }) + } + } + // scale for scaled canvas: + // > 1, expand + // < 1, reduce + Topology.prototype.scale = function (scale, center) { + if (this.data.scale * scale < this.options.minScale) { + scale = this.options.minScale / this.data.scale + this.data.scale = this.options.minScale + } else if (this.data.scale * scale > this.options.maxScale) { + scale = this.options.maxScale / this.data.scale + this.data.scale = this.options.maxScale + } else { + this.data.scale = Math.round(this.data.scale * scale * 100) / 100 + } + !center && (center = getRect(this.data.pens).center) + for (let _i = 0, _a = this.data.pens; _i < _a.length; _i++) { + const item = _a[_i] + item.scale(scale, center) + } + if (this.data.bkImageRect && !this.data.bkImageStatic) { + const backCenter = new Point(center.x + this.data.x, center.y + this.data.y) + this.data.bkImageRect.scale(scale, backCenter) + } + Store.set(this.generateStoreKey('LT:updateLines'), this.data.pens) + Store.set(this.generateStoreKey('LT:scale'), this.data.scale) + this.render() + this.cache() + this.dispatch('scale', this.data.scale) + } + // scale for origin canvas: + Topology.prototype.scaleTo = function (scale, center) { + this.scale(scale / this.data.scale, center) + } + Topology.prototype.round = function () { + for (let _i = 0, _a = this.data.pens; _i < _a.length; _i++) { + const item = _a[_i] + if (item instanceof Node) { + item.round() + } + } + } + Topology.prototype.centerView = function (padding) { + if (!this.hasView()) { return } + const rect = this.getRect() + const viewCenter = this.getViewCenter(padding) + const center = rect.center + this.translate(viewCenter.x - center.x, viewCenter.y - center.y) + const parentElem = this.canvas.parentElem + const x = (parentElem.scrollWidth - parentElem.offsetWidth) / 2 + const y = (parentElem.scrollHeight - parentElem.offsetHeight) / 2 + parentElem.scrollTo(x, y) + return true + } + Topology.prototype.fitView = function (viewPadding) { + if (!this.hasView()) { return } + // 1. 重置画布尺寸为容器尺寸 + const parentElem = this.canvas.parentElem + const width = parentElem.offsetWidth; const height = parentElem.offsetHeight + this.resize({ + width: width, + height: height + }) + // 2. 获取设置的留白值 + const padding = formatPadding(viewPadding || this.options.viewPadding) + // 3. 获取图形尺寸 + const rect = this.getRect() + // 4. 计算缩放比 + const w = (width - padding[1] - padding[3]) / rect.width + const h = (height - padding[0] - padding[2]) / rect.height + let ratio = w + if (w > h) { + ratio = h + } + this.scale(ratio) + // 5. 图形居中 + this.centerView(viewPadding) + } + Topology.prototype.hasView = function () { + return !!this.data.pens.length + } + Topology.prototype.getViewCenter = function (viewPadding) { + const padding = formatPadding(viewPadding || this.options.viewPadding) + const _a = this.canvas; const width = _a.width; const height = _a.height + return { + x: (width - padding[1] - padding[3]) / 2 + padding[3], + y: (height - padding[0] - padding[2]) / 2 + padding[0] + } + } + Topology.prototype.generateStoreKey = function (key) { + return this.id + '-' + key + } + Topology.prototype.createMarkdownTip = function () { + this.tipMarkdown = document.createElement('div') + this.tipMarkdown.className = 'topology-markdown' + this.tipMarkdown.style.position = 'fixed' + this.tipMarkdown.style.zIndex = '-1' + this.tipMarkdown.style.left = '-9999px' + this.tipMarkdown.style.padding = '8px 0' + this.tipMarkdownContent = document.createElement('div') + this.tipMarkdownContent.style.maxWidth = '320px' + this.tipMarkdownContent.style.outline = 'none' + this.tipMarkdownContent.style.borderRadius = '4px' + this.tipMarkdownContent.style.backgroundColor = 'rgba(0,0,0,.6)' + this.tipMarkdownContent.style.color = '#fff' + this.tipMarkdownContent.style.padding = '8px 16px' + this.tipMarkdownContent.style.lineHeight = '1.8' + this.tipMarkdownContent.style.overflowY = 'auto' + this.tipMarkdownContent.style.minHeight = '30px' + this.tipMarkdownContent.style.maxHeight = '400px' + this.tipMarkdown.appendChild(this.tipMarkdownContent) + this.tipMarkdownArrowUp = document.createElement('div') + this.tipMarkdownArrowUp.className = 'arrow' + this.tipMarkdownArrowUp.style.position = 'absolute' + this.tipMarkdownArrowUp.style.border = '6px solid transparent' + this.tipMarkdownArrowUp.style.backgroundColor = 'transparent' + this.tipMarkdownArrowUp.style.left = '50%' + this.tipMarkdownArrowUp.style.transform = 'translateX(-50%)' + this.tipMarkdownArrowUp.style.top = '-4px' + // this.tipMarkdownArrowUp.style.borderBottomColor = 'rgba(0,0,0,.6)'; + this.tipMarkdown.appendChild(this.tipMarkdownArrowUp) + this.tipMarkdownArrowDown = document.createElement('div') + this.tipMarkdownArrowDown.className = 'arrow' + this.tipMarkdownArrowDown.style.position = 'absolute' + this.tipMarkdownArrowDown.style.border = '6px solid transparent' + this.tipMarkdownArrowDown.style.left = '50%' + this.tipMarkdownArrowDown.style.transform = 'translateX(-50%)' + this.tipMarkdownArrowDown.style.backgroundColor = 'transparent' + this.tipMarkdownArrowDown.style.bottom = '-4px' + // this.tipMarkdownArrowDown.style.borderTopColor = 'rgba(0,0,0,.6)'; + this.tipMarkdown.appendChild(this.tipMarkdownArrowDown) + document.body.appendChild(this.tipMarkdown) + } + Topology.prototype.showTip = function (data, pos) { + if (!data || data.id === this.tip || this.data.tooltip === false || this.data.tooltip === 0) { + return + } + if (data.title) { + this.divLayer.canvas.title = data.title + this.tip = data.id + return + } + if (data.tipId) { + this.tipElem = document.getElementById(data.tipId) + } + let elem = this.tipElem + if (data.markdown) { + elem = this.tipMarkdown + const marked = window.marked + if (marked) { + this.tipMarkdownContent.innerHTML = marked(data.markdown) + } else { + this.tipMarkdownContent.innerHTML = data.markdown + } + const a = this.tipMarkdownContent.getElementsByTagName('A') + for (let i = 0; i < a.length; ++i) { + a[i].setAttribute('target', '_blank') + } + } + if (!elem) { + return + } + const parentRect = this.parentElem.getBoundingClientRect() + const elemRect = elem.getBoundingClientRect() + let x = (parentRect.left || parentRect.x) - (elemRect.width - data.rect.width) / 2 + this.data.x + let y = (parentRect.top || parentRect.y) - elemRect.height - data.rect.height + this.data.y + x += !data.type ? data.rect.x : pos.x + y += !data.type ? data.rect.ey : pos.y + if (y > 0) { + this.tipMarkdownArrowUp.style.borderBottomColor = 'transparent' + this.tipMarkdownArrowDown.style.borderTopColor = 'rgba(0,0,0,.6)' + } else { + y += elemRect.height + data.rect.height + this.tipMarkdownArrowUp.style.borderBottomColor = 'rgba(0,0,0,.6)' + this.tipMarkdownArrowDown.style.borderTopColor = 'transparent' + } + elem.style.display = 'block' + elem.style.position = 'fixed' + elem.style.left = x + 'px' + elem.style.top = y + 'px' + elem.style.zIndex = '100' + this.tip = data.id + this.dispatch('tip', elem) + } + Topology.prototype.hideTip = function () { + if (!this.tip) { + return + } + this.tipMarkdown.style.left = '-9999px' + this.tipMarkdown.style.zIndex = '-1' + if (this.tipElem) { + this.tipElem.style.left = '-9999px' + this.tipElem.style.zIndex = '-1' + this.tipElem = undefined + } + this.divLayer.canvas.title = '' + this.tip = '' + } + Topology.prototype.scroll = function (x, y) { + const _this = this + if (this.scrolling) { + return + } + this.scrolling = true + this.parentElem.scrollLeft += x + this.parentElem.scrollTop += y + setTimeout(function () { + _this.scrolling = false + }, 700) + } + Topology.prototype.toComponent = function (pens) { + if (!pens) { + pens = this.data.pens + } + const rect = getRect(pens) + let node = new Node({ + name: 'combine', + rect: new Rect(rect.x, rect.y, rect.width, rect.height), + text: '', + paddingLeft: 0, + paddingRight: 0, + paddingTop: 0, + paddingBottom: 0, + strokeStyle: 'transparent', + children: [] + }) + for (let _i = 0, pens_5 = pens; _i < pens_5.length; _i++) { + var item = pens_5[_i] + if (item.type === PenType.Node && rect.width === item.rect.width && rect.height === item.rect.height) { + node = item + if (!node.children) { + node.children = [] + } + break + } + } + for (let _a = 0, pens_6 = pens; _a < pens_6.length; _a++) { + var item = pens_6[_a] + if (item !== node) { + item.parentId = node.id + item.calcRectInParent(node) + node.children.push(item) + } + } + return node + } + Topology.prototype.clearBkImg = function () { + this.canvas.clearBkImg() + } + Topology.prototype.dispatch = function (event, data) { + if (this.options.on) { + this.options.on(event, data) + } + this.emit(event, data) + return this + } + Topology.prototype.on = function (eventType, handler) { + this._emitter.on(eventType, handler) + return this + } + Topology.prototype.off = function (eventType, handler) { + this._emitter.off(eventType, handler) + return this + } + Topology.prototype.emit = function (eventType, params) { + this._emitter.emit(eventType, params) + return this + } + Topology.prototype.getValue = function (idOrTag, attr) { + if (attr === void 0) { attr = 'text' } + let pen = this.find(idOrTag) + if (!pen) { + return + } + if (Array.isArray(pen)) { + pen = pen[0] + } + if (!pen) { + return + } + return pen[attr] + } + Topology.prototype.setValue = function (idOrTag, val, attr) { + if (attr === void 0) { attr = 'text' } + if (typeof idOrTag === 'object') { + val = idOrTag + idOrTag = idOrTag.id || idOrTag.tag + } + const pens = find(idOrTag, this.data.pens) + pens.forEach(function (item) { + if (item.id === idOrTag || (item.tags && item.tags.indexOf(idOrTag) > -1)) { + if (typeof val === 'object') { + item.fromData(item, val) + } else { + item[attr] = val + } + item.doWheres() + if (item.type === PenType.Node) { + item.animateReady = Node.cloneState(item) + } + } + }) + this.willRender() + } + Topology.prototype.willRender = function () { + const _this = this + if (this.actionTimer) { + clearTimeout(this.actionTimer) + } + this.actionTimer = setTimeout(function () { + _this.render() + _this.actionTimer = undefined + }, 500) + } + Topology.prototype.setLineName = function (name, render) { + if (render === void 0) { render = true } + this.data.pens.forEach(function (pen) { + if (pen.type) { + pen.name = name + pen.calcControlPoints() + } + }) + render && this.render() + } + Topology.prototype.setColor = function (color) { + this.options.color = color + Store.set(this.generateStoreKey('LT:color'), color) + this.options.fontColor = color + Store.set(this.generateStoreKey('LT:fontColor'), color) + } + Topology.prototype.setFontColor = function (color) { + this.options.fontColor = color + Store.set(this.generateStoreKey('LT:fontColor'), color) + } + Topology.prototype.setIconColor = function (color) { + Store.set(this.generateStoreKey('LT:iconColor'), color) + } + Topology.prototype.setBkColor = function (color) { + this.data.bkColor = color + Store.set('LT:bkColor', color) + } + Topology.prototype.pureData = function () { + const _this = this + const data = JSON.parse(JSON.stringify(this.data)) + data.pens.forEach(function (pen) { + for (const key in pen) { + if (pen[key] === undefined || pen[key] === undefined) { + delete pen[key] + } + } + delete pen.TID + delete pen.animateCycleIndex + delete pen.img + delete pen.lastImage + delete pen.fillImg + delete pen.strokeImg + delete pen.lastFillImage + delete pen.lastStrokeImage + delete pen.imgNaturalWidth + delete pen.imgNaturalHeight + delete pen.anchors + delete pen.rotatedAnchors + delete pen.dockWatchers + delete pen.elementLoaded + delete pen.elementRendered + delete pen.animateReady + if (pen.animateFrames && pen.animateFrames.length) { + for (let _i = 0, _a = pen.animateFrames; _i < _a.length; _i++) { + const item = _a[_i] + if (item.initState) { + delete item.initState.TID + delete item.initState.animateCycleIndex + delete item.initState.img + delete item.initState.lastImage + delete item.initState.imgNaturalWidth + delete item.initState.imgNaturalHeight + delete item.initState.anchors + delete item.initState.rotatedAnchors + delete item.initState.dockWatchers + delete item.initState.elementLoaded + delete item.initState.elementRendered + delete item.initState.fillImg + delete item.initState.strokeImg + delete item.initState.lastFillImage + delete item.initState.lastStrokeImage + } + if (item.state) { + delete item.state.TID + delete item.state.animateCycleIndex + delete item.state.img + delete item.state.lastImage + delete item.state.imgNaturalWidth + delete item.state.imgNaturalHeight + delete item.state.anchors + delete item.state.rotatedAnchors + delete item.state.dockWatchers + delete item.state.elementLoaded + delete item.state.elementRendered + delete item.state.fillImg + delete item.state.strokeImg + delete item.state.lastFillImage + delete item.state.lastStrokeImage + } + } + } + _this.pureDataChildren(pen) + }) + return data + } + Topology.prototype.pureDataChildren = function (data) { + const _this = this + if (!data.children) { + return + } + data.children.forEach(function (pen) { + for (const key in pen) { + if (pen[key] === undefined || pen[key] === undefined || pen[key] === '') { + delete pen[key] + } + } + delete pen.TID + delete pen.animateCycleIndex + delete pen.img + delete pen.lastImage + delete pen.imgNaturalWidth + delete pen.imgNaturalHeight + delete pen.anchors + delete pen.rotatedAnchors + delete pen.dockWatchers + delete pen.elementLoaded + delete pen.elementRendered + delete pen.animateReady + _this.pureDataChildren(pen) + }) + } + Topology.prototype.destroy = function () { + this.subcribe.unsubscribe() + this.subcribeRender.unsubscribe() + this.subcribeImage.unsubscribe() + this.subcribeAnimateEnd.unsubscribe() + this.subcribeAnimateMoved.unsubscribe() + this.subcribeMediaEnd.unsubscribe() + this.subcribeEmit.unsubscribe() + this.animateLayer.destroy() + this.divLayer.destroy() + this.canvas.destroy() + this.activeLayer.destroy() + this.hoverLayer.destroy() + this.offscreen.destroy() + // document.body.removeChild(this.tipMarkdown) + window.removeEventListener('resize', this.winResize) + this.parentElem.removeEventListener('scroll', this.onScroll) + window.removeEventListener('scroll', this.onScroll) + document.removeEventListener('gesturestart', this.preventDefault) + switch (this.options.keydown) { + case KeydownType.Document: + document.removeEventListener('keydown', this.onkeydown) + break + case KeydownType.Canvas: + this.divLayer.canvas.removeEventListener('keydown', this.onkeydown) + break + } + this.closeSocket() + this.closeMqtt() + if (this.socketFn) { + this.off('websocket', this.socketFn) + this.off('mqtt', this.socketFn) + } + this.cache = null + this.data = null + console.log(this.options) + window.topology = null + this.activeLayer = null + this.hoverLayer = null + this.animateLayer = null + this.mouseDown = null + this.subcribe = null + this.subcribeRender = null + this.subcribeImage = null + this.subcribeAnimateEnd = null + this.subcribeAnimateMoved = null + this.subcribeEmit = null + this.offscreen = null + this.parentElem.onresize = null + this.parentElem = null + this.input = null + this.data = null + this.caches = null + this.clipboard = null + this.gifs = null + this.tipMarkdown = null + this.tipMarkdownContent = null + this.tipMarkdownArrowUp = null + this.tipMarkdownArrowDown = null + delete this + } + return Topology +}()) +export { Topology } +// # sourceMappingURL=core.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/core.js.map b/nezha-fronted/src/components/common/@topology/core/src/core.js.map new file mode 100644 index 000000000..f65f93b09 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/core.js.map @@ -0,0 +1 @@ +{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../packages/core/src/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAY,MAAM,aAAa,CAAC;AAC9C,oCAAoC;AACpC,OAAO,EAAE,OAAO,IAAI,IAAI,EAA+B,MAAM,MAAM,CAAC;AACpE,OAAO,EAAW,OAAO,EAAE,WAAW,EAAE,cAAc,EAAW,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC7F,OAAO,EAAO,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,UAAU,EAAgB,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CA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AC;QACjB,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,QAAe,CAAC,CAAC;YAC5C,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,QAAe,CAAC,CAAC;SACxC;QAED,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;QAEtB,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC9B,CAAC;IACH,eAAC;AAAD,CAAC,AA12GD,IA02GC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/divLayer.d.ts b/nezha-fronted/src/components/common/@topology/core/src/divLayer.d.ts new file mode 100644 index 000000000..b020bb9c8 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/divLayer.d.ts @@ -0,0 +1,54 @@ +import { Options } from './options'; +import { Node } from './models/node'; +import { Layer } from './layer'; +export declare class DivLayer extends Layer { + parentElem: HTMLElement; + options: Options; + canvas: HTMLDivElement; + player: HTMLDivElement; + curNode: Node; + playBtn: HTMLElement; + currentTime: HTMLElement; + progressCurrent: HTMLElement; + progress: HTMLElement; + loop: HTMLElement; + media: HTMLMediaElement; + audios: { + [key: string]: { + player: HTMLElement; + current: HTMLElement; + media: HTMLMediaElement; + }; + }; + iframes: { + [key: string]: HTMLIFrameElement; + }; + elements: { + [key: string]: HTMLElement; + }; + gifs: { + [key: string]: HTMLImageElement; + }; + private subcribeDiv; + private subcribePlay; + private subcribeNode; + constructor(parentElem: HTMLElement, options: Options, TID: string); + addDiv: (node: Node) => void; + createPlayer: () => void; + getMediaCurrent: () => void; + addMedia: (node: Node, type: string) => HTMLDivElement; + play(idOrTag: any, pause?: boolean): void; + playOne(item: Node, pause?: boolean): void; + addIframe(node: Node): HTMLIFrameElement; + addGif(node: Node): HTMLImageElement; + setElemPosition: (node: Node, elem: HTMLElement) => void; + removeDiv: (item: Node) => void; + clear(shallow?: boolean): void; + formatSeconds(seconds: number): string; + resize(size?: { + width: number; + height: number; + }): void; + render(): void; + destroy(): void; +} diff --git a/nezha-fronted/src/components/common/@topology/core/src/divLayer.js b/nezha-fronted/src/components/common/@topology/core/src/divLayer.js new file mode 100644 index 000000000..1f4b52e02 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/divLayer.js @@ -0,0 +1,527 @@ +import { Store } from 'le5le-store' +import { Lock } from './models/status' +import { images, PenType } from './models/pen' +import { Layer } from './layer' +import { find } from './utils' +const __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b }) || + function (d, b) { for (const p in b) if (b.hasOwnProperty(p)) d[p] = b[p] } + return extendStatics(d, b) + } + return function (d, b) { + extendStatics(d, b) + function __ () { this.constructor = d } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()) + } +})() +let videos = {} +const DivLayer = /** @class */ (function (_super) { + __extends(DivLayer, _super) + function DivLayer (parentElem, options, TID) { + if (options === void 0) { options = {} } + const _this = _super.call(this, TID) || this + _this.parentElem = parentElem + _this.options = options + _this.canvas = document.createElement('div') + _this.player = document.createElement('div') + _this.audios = {} + _this.iframes = {} + _this.elements = {} + _this.gifs = {} + _this.addDiv = function (node) { + if (node.audio) { + if (_this.audios[node.id] && _this.audios[node.id].media.src !== node.audio) { + _this.audios[node.id].media.src = node.audio + } + setTimeout(function () { + _this.setElemPosition(node, (_this.audios[node.id] && _this.audios[node.id].player) || _this.addMedia(node, 'audio')) + }) + } + if (node.video) { + if (videos[node.id] && videos[node.id].media.src !== node.video) { + videos[node.id].media.src = node.video + } + setTimeout(function () { + _this.setElemPosition(node, (videos[node.id] && videos[node.id].player) || _this.addMedia(node, 'video')) + }) + } + if (node.iframe) { + if (!_this.iframes[node.id]) { + _this.addIframe(node) + setTimeout(function () { + _this.addDiv(node) + }) + } else { + if (_this.iframes[node.id].src !== node.iframe) { + _this.iframes[node.id].src = node.iframe + } + _this.setElemPosition(node, _this.iframes[node.id]) + } + } + if (node.elementId) { + if (!_this.elements[node.id]) { + _this.elements[node.id] = document.getElementById(node.elementId) + if (_this.elements[node.id]) { + _this.canvas.appendChild(_this.elements[node.id]) + } + } + _this.setElemPosition(node, _this.elements[node.id]) + } + if (node.gif) { + if (node.image.indexOf('.gif') < 0) { + node.gif = false + _this.canvas.removeChild(_this.gifs[node.id]) + _this.gifs[node.id] = undefined + } else if (node.img) { + if (_this.gifs[node.id] && _this.gifs[node.id].src !== node.image) { + _this.gifs[node.id].src = node.image + } + if (_this.gifs[node.id]) { + _this.setElemPosition(node, _this.gifs[node.id]) + } else { + _this.addGif(node) + _this.setElemPosition(node, node.id) + } + } + } + if (node.children) { + for (let _i = 0, _a = node.children; _i < _a.length; _i++) { + const child = _a[_i] + if (child.type === PenType.Line) { + continue + } + _this.addDiv(child) + } + } + } + _this.createPlayer = function () { + _this.player.style.position = 'fixed' + _this.player.style.outline = 'none' + _this.player.style.top = '-99999px' + _this.player.style.height = '40px' + _this.player.style.padding = '10px 15px' + _this.player.style.background = 'rgba(200,200,200,.1)' + _this.player.style.display = 'flex' + _this.player.style.alignItems = 'center' + _this.player.style.userSelect = 'initial' + _this.player.style.pointerEvents = 'initial' + _this.player.style.zIndex = '1' + _this.playBtn = document.createElement('i') + _this.currentTime = document.createElement('span') + _this.progress = document.createElement('div') + _this.progressCurrent = document.createElement('div') + _this.loop = document.createElement('i') + _this.myfullScreen = document.createElement('i') + _this.playBtn.className = _this.options.playIcon + _this.playBtn.style.fontSize = '18px' + _this.playBtn.style.lineHeight = '20px' + _this.playBtn.style.cursor = 'pointer' + _this.currentTime.style.padding = '0 10px' + _this.currentTime.innerText = '0 / 0' + _this.progress.style.position = 'relative' + _this.progress.style.flexGrow = '1' + _this.progress.style.top = '0' + _this.progress.style.height = '4px' + _this.progress.style.background = '#ccc' + _this.progress.style.borderRadius = '2px' + _this.progress.style.overflow = 'hidden' + _this.progress.style.cursor = 'pointer' + _this.progressCurrent.style.position = 'absolute' + _this.progressCurrent.style.left = '0' + _this.progressCurrent.style.top = '0' + _this.progressCurrent.style.bottom = '0' + _this.progressCurrent.style.width = '0' + _this.progressCurrent.style.background = '#52c41a' + _this.loop.style.margin = '0 10px' + _this.loop.style.padding = '2px 5px' + _this.loop.style.borderRadius = '2px' + _this.loop.className = _this.options.loopIcon + _this.loop.style.fontSize = '18px' + _this.loop.style.lineHeight = '20px' + _this.loop.style.cursor = 'pointer' + _this.myfullScreen.className = _this.options.fullScreenIcon + _this.myfullScreen.style.fontSize = '17px' + _this.myfullScreen.style.lineHeight = '20px' + _this.myfullScreen.style.cursor = 'pointer' + _this.player.appendChild(_this.playBtn) + _this.player.appendChild(_this.currentTime) + _this.player.appendChild(_this.progress) + _this.progress.appendChild(_this.progressCurrent) + _this.player.appendChild(_this.loop) + _this.player.appendChild(_this.myfullScreen) + _this.playBtn.onclick = function () { + if (_this.media.paused) { + _this.media.play() + _this.playBtn.className = _this.options.pauseIcon + } else { + _this.media.pause() + _this.playBtn.className = _this.options.playIcon + } + } + _this.progress.onclick = function (e) { + _this.media.currentTime = (e.offsetX / _this.progress.clientWidth) * _this.media.duration + } + _this.loop.onclick = function () { + _this.media.loop = !_this.media.loop + _this.curNode.playLoop = _this.media.loop + if (_this.media.loop) { + _this.loop.style.background = '#ddd' + } else { + _this.loop.style.background = 'none' + } + } + _this.myfullScreen.onclick = function () { + _this.media.requestFullscreen() + } + } + _this.getMediaCurrent = function () { + if (!_this.media) { + return + } + _this.currentTime.innerText = + _this.formatSeconds(_this.media.currentTime) + ' / ' + _this.formatSeconds(_this.media.duration) + _this.progressCurrent.style.width = + (_this.media.currentTime / _this.media.duration) * _this.progress.clientWidth + 'px' + } + _this.addMedia = function (node, type) { + let player = document.createElement('div') + let current = document.createElement('div') + let media = document.createElement(type) + player.id = node.id + current.style.position = 'absolute' + current.style.outline = 'none' + current.style.left = '0' + current.style.bottom = '0' + current.style.height = '2px' + current.style.background = '#52c41a' + media.style.position = 'absolute' + media.style.outline = 'none' + media.style.left = '0' + media.style.right = '0' + media.style.top = '0' + media.style.bottom = '0' + if (type === 'video') { + media.style.width = node.rect.width + 'px' + media.style.height = node.rect.height + 'px' + } + player.style.background = 'transparent' + if (node.playType === 1) { + media.autoplay = true + } + media.loop = node.playLoop + media.ontimeupdate = function () { + current.style.width = (media.currentTime / media.duration) * node.rect.width + 'px' + _this.getMediaCurrent() + if (_this.media === media) { + if (node.playLoop) { + media.loop = true + _this.loop.style.background = '#ddd' + } else { + media.loop = false + _this.loop.style.background = 'none' + } + } + } + media.onended = function () { + Store.set(_this.generateStoreKey('mediaEnd'), node) + if (_this.media === media) { + _this.playBtn.className = _this.options.playIcon + } + _this.play(node.nextPlay) + } + media.onloadedmetadata = function () { + _this.getMediaCurrent() + } + media.src = node[type] + player.appendChild(media) + player.appendChild(current) + if (type === 'video') { + videos[node.id] = { + player: player, + current: current, + media: media + } + } else { + _this.audios[node.id] = { + player: player, + current: current, + media: media + } + } + _this.canvas.appendChild(player) + setTimeout(() => { + player = null + current = null + media = null + }, 100) + return player + } + _this.setElemPosition = function (node, elem) { + if (!elem) { + return + } + elem.style.position = 'absolute' + elem.style.outline = 'none' + elem.style.left = node.rect.x + _this.data.x + 'px' + elem.style.top = node.rect.y + _this.data.y + 'px' + elem.style.width = node.rect.width + 'px' + elem.style.height = node.rect.height + 'px' + elem.style.display = node.visible ? 'inline' : 'none' // 是否隐藏元素 + if (node.rotate || node.offsetRotate) { + elem.style.transform = 'rotate(' + (node.rotate + node.offsetRotate) + 'deg)' + } + if (node.video && videos[node.id] && videos[node.id].media) { + videos[node.id].media.style.width = '100%' + videos[node.id].media.style.height = '100%' + } + if (_this.data.locked > Lock.None || node.locked > Lock.None) { + elem.style.userSelect = 'initial' + elem.style.pointerEvents = 'initial' + } else { + elem.style.userSelect = 'none' + elem.style.pointerEvents = 'none' + } + } + _this.removeDiv = function (item) { + if (_this.curNode && item.id === _this.curNode.id) { + _this.curNode = undefined + _this.media = undefined + _this.player.style.top = '-99999px' + } + if (item.audio) { + _this.canvas.removeChild(_this.audios[item.id].player) + _this.audios[item.id] = undefined + } + if (item.video) { + _this.canvas.removeChild(videos[item.id].player) + videos[item.id] = undefined + } + if (item.iframe) { + _this.canvas.removeChild(_this.iframes[item.id]) + _this.iframes[item.id] = undefined + } + if (item.elementId) { + _this.canvas.removeChild(_this.elements[item.id]) + _this.elements[item.id] = undefined + item.elementId = '' + } + if (item.gif) { + _this.canvas.removeChild(_this.gifs[item.id]) + _this.gifs[item.id] = undefined + } + if (item.children) { + for (let _i = 0, _a = item.children; _i < _a.length; _i++) { + const child = _a[_i] + if (child.type === PenType.Line) { + continue + } + _this.removeDiv(child) + } + } + } + if (!_this.options.playIcon) { + _this.options.playIcon = 't-icon t-play' + } + if (!_this.options.pauseIcon) { + _this.options.pauseIcon = 't-icon t-pause' + } + if (!_this.options.fullScreenIcon) { + _this.options.fullScreenIcon = 't-icon t-full-screen' + } + if (!_this.options.loopIcon) { + _this.options.loopIcon = 't-icon t-loop' + } + _this.canvas.style.position = 'absolute' + _this.canvas.style.left = '0' + _this.canvas.style.top = '0' + _this.canvas.style.outline = 'none' + _this.canvas.style.background = 'transparent' + parentElem.appendChild(_this.canvas) + parentElem.appendChild(_this.player) + _this.createPlayer() + _this.subcribeDiv = Store.subscribe(_this.generateStoreKey('LT:addDiv'), _this.addDiv) + _this.subcribeDiv = Store.subscribe(_this.generateStoreKey('LT:removeDiv'), _this.removeDiv) + _this.subcribePlay = Store.subscribe(_this.generateStoreKey('LT:play'), function (e) { + _this.playOne(e.pen, e.pause) + }) + _this.subcribeNode = Store.subscribe(_this.generateStoreKey('LT:activeNode'), function (node) { + if (!node || (!node.video && !node.audio)) { + _this.player.style.top = '-99999px' + return + } + if (node.audio && _this.audios[node.id]) { + _this.media = _this.audios[node.id].media + } else if (node.video && videos[node.id]) { + _this.media = videos[node.id].media + } else { + return + } + _this.curNode = node + const rect = _this.parentElem.getBoundingClientRect() + _this.player.style.top = rect.top + _this.parentElem.clientHeight - 40 + 'px' + _this.player.style.left = rect.left + 'px' + _this.player.style.width = _this.parentElem.clientWidth + 'px' + _this.getMediaCurrent() + if (_this.media.paused) { + _this.playBtn.className = _this.options.playIcon + } else { + _this.playBtn.className = _this.options.pauseIcon + } + }) + _this.fullscreenchange = function (e) { + if (!_this.media) { + return + } + if (document.fullscreen) { + _this.media.controls = true + _this.media.style.userSelect = 'initial' + _this.media.style.pointerEvents = 'initial' + } else { + _this.media.style.userSelect = 'none' + _this.media.style.pointerEvents = 'none' + _this.media.controls = false + } + } + document.addEventListener('fullscreenchange', _this.fullscreenchange) + return _this + } + DivLayer.prototype.play = function (idOrTag, pause) { + const _this = this + if (!idOrTag) { + return + } + const pens = find(idOrTag, this.data.pens) + pens.forEach(function (item) { + _this.playOne(item, pause) + }) + } + DivLayer.prototype.playOne = function (item, pause) { + if (item.audio && this.audios[item.id] && this.audios[item.id].media) { + if (pause) { + this.audios[item.id].media.pause() + } else if (this.audios[item.id].media.paused) { + this.audios[item.id].media.play() + } + } else if (item.video && videos[item.id].media) { + if (pause) { + videos[item.id].media.pause() + } else if (videos[item.id].media.paused) { + videos[item.id].media.play() + } + } + } + DivLayer.prototype.addIframe = function (node) { + const iframe = document.createElement('iframe') + iframe.scrolling = 'no' + iframe.frameBorder = '0' + iframe.src = node.iframe + this.iframes[node.id] = iframe + this.canvas.appendChild(iframe) + return iframe + } + DivLayer.prototype.addGif = function (node) { + this.gifs[node.id] = node.img + this.canvas.appendChild(node.img) + } + DivLayer.prototype.clear = function (shallow) { + this.canvas.innerHTML = '' + this.audios = {} + videos = {} + this.iframes = {} + this.elements = {} + this.gifs = {} + if (!shallow) { + // tslint:disable-next-line:forin + for (const key in images) { + delete images[key] + } + } + this.player.style.top = '-99999px' + } + DivLayer.prototype.formatSeconds = function (seconds) { + const h = Math.floor(seconds / 3600) + const m = Math.floor(seconds / 60) % 60 + const s = Math.floor(seconds % 60) + let txt = s + '' + if (m) { + txt = m + ':' + s + } else { + txt = '0:' + s + } + if (h) { + txt = h + ':' + m + ':' + s + } + return txt + } + DivLayer.prototype.resize = function (size) { + if (size) { + this.canvas.style.width = size.width + 'px' + this.canvas.style.height = size.height + 'px' + } else { + if (this.options.width && this.options.width !== 'auto') { + this.canvas.style.width = this.options.width + 'px' + } else { + this.canvas.style.width = this.parentElem.clientWidth + 'px' + } + if (this.options.height && this.options.height !== 'auto') { + this.canvas.style.height = this.options.height + 'px' + } else { + this.canvas.style.height = this.parentElem.clientHeight - 8 + 'px' + } + } + } + DivLayer.prototype.render = function () { + for (let _i = 0, _a = this.data.pens; _i < _a.length; _i++) { + const item = _a[_i] + if (!item.getTID()) { + item.setTID(this.TID) + } + this.addDiv(item) + } + } + DivLayer.prototype.destroy = function () { + _super.prototype.destroy.call(this) + this.clear() + this.subcribeDiv.unsubscribe() + this.subcribeNode.unsubscribe() + this.subcribePlay.unsubscribe() + this.parentElem.removeChild(this.canvas) + this.parentElem.removeChild(this.player) + document.removeEventListener('fullscreenchange', this.fullscreenchange) + Object.keys(this.audios).forEach(key => { + this.audios[key] = null + }) + this.myfullScreen.onclick = null + this.playBtn.onclick = null + this.progress.onclick = null + this.loop.onclick = null + this.subcribeDiv = null + this.subcribeNode = null + this.subcribePlay = null + this.parentElem = null + this.options = null + this.canvas = null + this.player = null + this.audios = null + this.iframes = null + this.elements = null + this.gifs = null + this.playBtn = null + this.currentTime = null + this.progress = null + this.progressCurrent = null + this.loop = null + videos = null + this.iframes = null + this.elements = null + this.gifs = null + this.addDiv = null + this.createPlayer = null + this.setElemPosition = null + } + return DivLayer +}(Layer)) +export { DivLayer } +// # sourceMappingURL=divLayer.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/divLayer.js.map b/nezha-fronted/src/components/common/@topology/core/src/divLayer.js.map new file mode 100644 index 000000000..f917fcbc9 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/divLayer.js.map @@ -0,0 +1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MAAM,EAAE,EAAE;gBAClB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aACvB;YACD,IAAI,CAAC,MAAM,CAAC,IAAY,CAAC,CAAC;SAC3B;IACH,CAAC;IAED,0BAAO,GAAP;QACE,iBAAM,OAAO,WAAE,CAAC;QAChB,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC;QAC/B,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;QAChC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;IAClC,CAAC;IACH,eAAC;AAAD,CAAC,AA9fD,CAA8B,KAAK,GA8flC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/hoverLayer.d.ts b/nezha-fronted/src/components/common/@topology/core/src/hoverLayer.d.ts new file mode 100644 index 000000000..b92c6ddc5 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/hoverLayer.d.ts @@ -0,0 +1,27 @@ +import { Rect } from './models/rect'; +import { Point } from './models/point'; +import { Line } from './models/line'; +import { Node } from './models/node'; +import { Pen } from './models/pen'; +import { Options } from './options'; +import { Layer } from './layer'; +export declare class HoverLayer extends Layer { + options: Options; + line: Line; + initLine: Line; + node: Node; + hoverLineCP: Point; + lasthoverLineCP: Point; + dockAnchor: Point; + hoverAnchorIndex: number; + dockLineX: number; + dockLineY: number; + root: Node; + dragRect: Rect; + constructor(options: Options, TID: string); + lineTo(to: Point, toArrow?: string): void; + lineFrom(from: Point): void; + render(ctx: CanvasRenderingContext2D): void; + getRoot(pen: Pen): any; + clear(): void; +} diff --git a/nezha-fronted/src/components/common/@topology/core/src/hoverLayer.js b/nezha-fronted/src/components/common/@topology/core/src/hoverLayer.js new file mode 100644 index 000000000..1e89b17f3 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/hoverLayer.js @@ -0,0 +1,211 @@ +import { PenType } from './models/pen' +import { Store } from 'le5le-store' +import { Lock } from './models/status' +import { Layer } from './layer' +import { rgba } from './utils/math' +const __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b }) || + function (d, b) { for (const p in b) if (b.hasOwnProperty(p)) d[p] = b[p] } + return extendStatics(d, b) + } + return function (d, b) { + extendStatics(d, b) + function __ () { this.constructor = d } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()) + } +})() +const HoverLayer = /** @class */ (function (_super) { + __extends(HoverLayer, _super) + function HoverLayer (options, TID) { + if (options === void 0) { options = {} } + const _this = _super.call(this, TID) || this + _this.options = options + _this.hoverAnchorIndex = -1 + _this.dockLineX = 0 + _this.dockLineY = 0 + Store.set(_this.generateStoreKey('LT:HoverLayer'), _this) + return _this + } + HoverLayer.prototype.lineTo = function (to, toArrow) { + if (toArrow === void 0) { toArrow = 'triangleSolid' } + if (!this.line || this.line.locked) { + return + } + this.line.setTo(to, toArrow) + if (this.line.from.id || this.line.to.id) { + this.line.calcControlPoints() + } + Store.set(this.generateStoreKey('pts-') + this.line.id, undefined) + Store.set(this.generateStoreKey('LT:updateLines'), [this.line]) + } + HoverLayer.prototype.lineFrom = function (from) { + if (this.line.locked) { + return + } + this.line.setFrom(from, this.line.fromArrow) + if (this.line.from.id || this.line.to.id) { + this.line.calcControlPoints() + } + Store.set(this.generateStoreKey('pts-') + this.line.id, undefined) + Store.set(this.generateStoreKey('LT:updateLines'), [this.line]) + } + HoverLayer.prototype.render = function (ctx) { + const _this = this + if (this.data.locked === Lock.NoEvent || this.options.hoverColor === 'transparent') { + return + } + ctx.fillStyle = this.options.hoverColor + ctx.save() + // anchors + if (this.options.alwaysAnchor) { + this.data.pens.forEach(function (pen) { + if (pen.type === PenType.Line) { + return + } + if (pen.hideAnchor) { + return + } + for (let _i = 0, _a = pen.rotatedAnchors; _i < _a.length; _i++) { + const anchor = _a[_i] + if (anchor.hidden) { + continue + } + ctx.beginPath() + ctx.arc(anchor.x, anchor.y, anchor.radius || _this.options.anchorRadius, 0, Math.PI * 2) + ctx.strokeStyle = anchor.strokeStyle || _this.options.hoverColor + ctx.fillStyle = anchor.fillStyle || _this.options.anchorFillStyle + ctx.fill() + ctx.stroke() + } + if (_this.options.autoAnchor) { + ctx.beginPath() + ctx.arc(pen.rect.center.x, pen.rect.center.y, pen.rect.center.radius || _this.options.anchorRadius, 0, Math.PI * 2) + ctx.strokeStyle = _this.options.hoverColor + ctx.fillStyle = _this.options.anchorFillStyle + ctx.fill() + ctx.stroke() + } + }) + } + ctx.restore() + if (this.node && !this.data.locked) { + if (!this.node.getTID()) { + this.node.setTID(this.TID) + } + this.root = this.getRoot(this.node) || this.node + if (this.root) { + ctx.save() + ctx.strokeStyle = this.options.dragColor + ctx.globalAlpha = 0.2 + if (this.root.rotate) { + ctx.translate(this.root.rect.center.x, this.root.rect.center.y) + ctx.rotate(((this.root.rotate + this.root.offsetRotate) * Math.PI) / 180) + ctx.translate(-this.root.rect.center.x, -this.root.rect.center.y) + } + ctx.beginPath() + ctx.strokeRect(this.root.rect.x, this.root.rect.y, this.root.rect.width, this.root.rect.height) + ctx.restore() + } + if (!this.options.hideAnchor) { + for (let i = 0; i < this.node.rotatedAnchors.length; ++i) { + if (this.node.locked || + this.node.hideAnchor || + (this.node.rotatedAnchors[i].hidden && this.hoverAnchorIndex !== i)) { + continue + } + ctx.beginPath() + ctx.arc(this.node.rotatedAnchors[i].x, this.node.rotatedAnchors[i].y, this.node.rotatedAnchors[i].radius || this.options.anchorRadius, 0, Math.PI * 2) + ctx.strokeStyle = this.node.rotatedAnchors[i].strokeStyle || this.options.hoverColor + ctx.fillStyle = this.node.rotatedAnchors[i].fillStyle || this.options.anchorFillStyle + ctx.fill() + ctx.stroke() + } + } + if (this.options.autoAnchor) { + ctx.beginPath() + ctx.arc(this.node.rect.center.x, this.node.rect.center.y, this.node.rect.center.radius || this.options.anchorRadius, 0, Math.PI * 2) + ctx.strokeStyle = this.options.hoverColor + ctx.fillStyle = this.options.anchorFillStyle + ctx.fill() + ctx.stroke() + } + } + if (this.line && !this.data.locked) { + this.root = this.getRoot(this.line) + if (this.root) { + ctx.save() + ctx.strokeStyle = this.options.dragColor + ctx.globalAlpha = 0.2 + if (this.root.rotate) { + ctx.translate(this.root.rect.center.x, this.root.rect.center.y) + ctx.rotate(((this.root.rotate + this.root.offsetRotate) * Math.PI) / 180) + ctx.translate(-this.root.rect.center.x, -this.root.rect.center.y) + } + ctx.beginPath() + ctx.strokeRect(this.root.rect.x, this.root.rect.y, this.root.rect.width, this.root.rect.height) + ctx.restore() + } + } + if (this.dockAnchor) { + ctx.save() + ctx.beginPath() + ctx.arc(this.dockAnchor.x, this.dockAnchor.y, this.dockAnchor.radius || this.options.anchorRadius, 0, Math.PI * 2) + ctx.strokeStyle = this.options.dockStrokeStyle + ctx.fillStyle = this.options.dockFillStyle + ctx.fill() + ctx.stroke() + ctx.restore() + } + if (this.hoverLineCP) { + ctx.beginPath() + ctx.arc(this.hoverLineCP.x, this.hoverLineCP.y, 5, 0, Math.PI * 2) + ctx.fill() + } + ctx.strokeStyle = rgba(0.5, this.options.hoverColor) + ctx.lineWidth = 1 + if (this.dockLineX > 0) { + var size = Store.get(this.generateStoreKey('LT:size')) + ctx.beginPath() + ctx.moveTo(this.dockLineX, -this.data.y) + ctx.lineTo(this.dockLineX, size.height) + ctx.stroke() + } + if (this.dockLineY > 0) { + var size = Store.get(this.generateStoreKey('LT:size')) + ctx.beginPath() + ctx.moveTo(-this.data.x, this.dockLineY) + ctx.lineTo(size.width, this.dockLineY) + ctx.stroke() + } + // Select nodes by drag. + if (this.dragRect) { + ctx.fillStyle = rgba(0.2, this.options.dragColor) + ctx.strokeStyle = this.options.dragColor + ctx.beginPath() + ctx.strokeRect(this.dragRect.x, this.dragRect.y, this.dragRect.width, this.dragRect.height) + ctx.fillRect(this.dragRect.x, this.dragRect.y, this.dragRect.width, this.dragRect.height) + } + } + HoverLayer.prototype.getRoot = function (pen) { + if (!pen.parentId) { + return null + } + for (let _i = 0, _a = this.data.pens; _i < _a.length; _i++) { + const item = _a[_i] + if (item.id === pen.parentId) { + const n = this.getRoot(item) + return n || item + } + } + return null + } + HoverLayer.prototype.clear = function () { + this.node = undefined + this.line = undefined + } + return HoverLayer +}(Layer)) +export { HoverLayer } +// # sourceMappingURL=hoverLayer.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/hoverLayer.js.map b/nezha-fronted/src/components/common/@topology/core/src/hoverLayer.js.map new file mode 100644 index 000000000..b157eea57 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/hoverLayer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"hoverLayer.js","sourceRoot":"","sources":["../../../packages/core/src/hoverLayer.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAIA,OAAO,EAAO,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC;IAAgC,8BAAK;IAiBnC,oBAAmB,OAAqB,EAAE,GAAW;QAAlC,wBAAA,EAAA,YAAqB;QAAxC,YACE,kBAAM,GAAG,CAAC,SAEX;QAHkB,aAAO,GAAP,OAAO,CAAc;QAPxC,sBAAgB,GAAG,CAAC,CAAC,CAAC;QAEtB,eAAS,GAAG,CAAC,CAAC;QACd,eAAS,GAAG,CAAC,CAAC;QAMZ,KAAK,CAAC,GAAG,CAAC,KAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,EAAE,KAAI,CAAC,CAAC;;IAC1D,CAAC;IAED,2BAAM,GAAN,UAAO,EAAS,EAAE,OAAiC;QAAjC,wBAAA,EAAA,yBAAiC;QACjD,IAAI,CAAC,IAAI,CAAC,IA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,CAAC;SACb;QACD,KAAmB,UAAc,EAAd,KAAA,IAAI,CAAC,IAAI,CAAC,IAAI,EAAd,cAAc,EAAd,IAAc,EAAE;YAA9B,IAAM,IAAI,SAAA;YACb,IAAI,IAAI,CAAC,EAAE,KAAK,GAAG,CAAC,QAAQ,EAAE;gBAC5B,IAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBAC7B,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;aACrB;SACF;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAAK,GAAL;QACE,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;IACxB,CAAC;IACH,iBAAC;AAAD,CAAC,AAlPD,CAAgC,KAAK,GAkPpC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/layer.d.ts b/nezha-fronted/src/components/common/@topology/core/src/layer.d.ts new file mode 100644 index 000000000..1a4163ad9 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/layer.d.ts @@ -0,0 +1,10 @@ +import { Observer } from 'le5le-store'; +import { TopologyData } from './models/data'; +export declare class Layer { + protected TID: string; + protected data: TopologyData; + subcribe: Observer; + constructor(TID: string); + protected generateStoreKey(key: any): string; + destroy(): void; +} diff --git a/nezha-fronted/src/components/common/@topology/core/src/layer.js b/nezha-fronted/src/components/common/@topology/core/src/layer.js new file mode 100644 index 000000000..97c772c64 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/layer.js @@ -0,0 +1,20 @@ +import { Store } from 'le5le-store' +const Layer = /** @class */ (function () { + function Layer (TID) { + const _this = this + this.TID = TID + this.subcribe = Store.subscribe(this.generateStoreKey('topology-data'), function (val) { + _this.data = val + }) + } + Layer.prototype.generateStoreKey = function (key) { + return this.TID + '-' + key + } + Layer.prototype.destroy = function () { + this.subcribe.unsubscribe() + this.subcribe = null + } + return Layer +}()) +export { Layer } +// # sourceMappingURL=layer.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/layer.js.map b/nezha-fronted/src/components/common/@topology/core/src/layer.js.map new file mode 100644 index 000000000..5007e9147 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/layer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"layer.js","sourceRoot":"","sources":["../../../packages/core/src/layer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,EAAE,MAAM,aAAa,CAAC;AAG9C;IAIE,eAAY,GAAW;QAAvB,iBAKC;QAJC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,EAAE,UAAC,GAAG;YAC1E,KAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;IAES,gCAAgB,GAA1B,UAA2B,GAAG;QAC5B,OAAU,IAAI,CAAC,GAAG,SAAI,GAAK,CAAC;IAC9B,CAAC;IAED,uBAAO,GAAP;QACE,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;IAC9B,CAAC;IACH,YAAC;AAAD,CAAC,AAlBD,IAkBC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/circle.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/circle.d.ts new file mode 100644 index 000000000..e1c6e6b32 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/circle.d.ts @@ -0,0 +1,3 @@ +import { Point } from '../../models/point'; +export declare function circleSolid(ctx: CanvasRenderingContext2D, from: Point, to: Point, size: number, fillStyle?: string): void; +export declare function circle(ctx: CanvasRenderingContext2D, from: Point, to: Point, size: number): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/circle.js b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/circle.js new file mode 100644 index 000000000..d9264503a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/circle.js @@ -0,0 +1,23 @@ +import { Store } from 'le5le-store' +export function circleSolid (ctx, from, to, size, fillStyle) { + size += ctx.lineWidth * 3 + const r = size / 2 + if (ctx.lineWidth < 2) { + ctx.lineWidth = 2 + } + ctx.translate(to.x, to.y) + ctx.rotate(Math.atan2(to.y - from.y, to.x - from.x)) + ctx.translate(-to.x, -to.y - ctx.lineWidth / 10) + ctx.arc(to.x - r - ctx.lineWidth / 2, to.y, r, 0, 2 * Math.PI) + ctx.stroke() + if (fillStyle) { + ctx.fillStyle = fillStyle + } else { + ctx.fillStyle = ctx.strokeStyle + } + ctx.fill() +} +export function circle (ctx, from, to, size) { + circleSolid(ctx, from, to, size, Store.get('LT:bkColor') || '#fff') +} +// # sourceMappingURL=circle.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/circle.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/circle.js.map new file mode 100644 index 000000000..98354653c --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/circle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"circle.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/arrows/circle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC,MAAM,UAAU,WAAW,CAAC,GAA6B,EAAE,IAAW,EAAE,EAAS,EAAE,IAAY,EAAE,SAAkB;IACjH,IAAI,IAAI,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC;IAC1B,IAAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;IACnB,IAAI,GAAG,CAAC,SAAS,GAAG,CAAC,EAAE;QACrB,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC;KACnB;IACD,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1B,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,SAAS,GAAG,EAAE,CAAC,CAAC;IACjD,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,SAAS,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/D,GAAG,CAAC,MAAM,EAAE,CAAC;IACb,IAAI,SAAS,EAAE;QACb,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC;KAC3B;SAAM;QACL,GAAG,CAAC,SAAS,GAAG,GAAG,CAAC,WAAW,CAAC;KACjC;IACD,GAAG,CAAC,IAAI,EAAE,CAAC;AACb,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,GAA6B,EAAE,IAAW,EAAE,EAAS,EAAE,IAAY;IACxF,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,MAAM,CAAC,CAAC;AACtE,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/diamond.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/diamond.d.ts new file mode 100644 index 000000000..c3cbe5193 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/diamond.d.ts @@ -0,0 +1,3 @@ +import { Point } from '../../models/point'; +export declare function diamondSolid(ctx: CanvasRenderingContext2D, from: Point, to: Point, size: number, fillStyle?: string): void; +export declare function diamond(ctx: CanvasRenderingContext2D, from: Point, to: Point, size: number): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/diamond.js b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/diamond.js new file mode 100644 index 000000000..54731b8f7 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/diamond.js @@ -0,0 +1,31 @@ +import { Store } from 'le5le-store' +export function diamondSolid (ctx, from, to, size, fillStyle) { + size += ctx.lineWidth * 3 + const r = size / 2 + let arrowWidth = ctx.lineWidth / 10 + if (ctx.lineWidth < 2) { + ctx.lineWidth = 2 + arrowWidth = 0 + } + ctx.translate(to.x, to.y) + ctx.rotate(Math.atan2(to.y - from.y, to.x - from.x)) + ctx.translate(-to.x - ctx.lineWidth + arrowWidth * 5, -to.y) + ctx.moveTo(to.x, to.y + arrowWidth) + ctx.lineTo(to.x, to.y - arrowWidth) + ctx.lineTo(to.x - r, to.y - r / 2) + ctx.lineTo(to.x - size, to.y - arrowWidth) + ctx.lineTo(to.x - size, to.y + arrowWidth) + ctx.lineTo(to.x - r, to.y + r / 2) + ctx.closePath() + ctx.stroke() + if (fillStyle) { + ctx.fillStyle = fillStyle + } else { + ctx.fillStyle = ctx.strokeStyle + } + ctx.fill() +} +export function diamond (ctx, from, to, size) { + diamondSolid(ctx, from, to, size, Store.get('LT:bkColor') || '#fff') +} +// # sourceMappingURL=diamond.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/diamond.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/diamond.js.map new file mode 100644 index 000000000..4b143ece8 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/diamond.js.map @@ -0,0 +1 @@ +{"version":3,"file":"diamond.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/arrows/diamond.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC,MAAM,UAAU,YAAY,CAAC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E,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC;IAC3C,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,MAAM,EAAE,CAAC;IACb,IAAI,SAAS,EAAE;QACb,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC;KAC3B;SAAM;QACL,GAAG,CAAC,SAAS,GAAG,GAAG,CAAC,WAAW,CAAC;KACjC;IACD,GAAG,CAAC,IAAI,EAAE,CAAC;AACb,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,GAA6B,EAAE,IAAW,EAAE,EAAS,EAAE,IAAY;IACzF,YAAY,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,MAAM,CAAC,CAAC;AACvE,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/line.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/line.d.ts new file mode 100644 index 000000000..c6ef278e5 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/line.d.ts @@ -0,0 +1,4 @@ +import { Point } from '../../models/point'; +export declare function line(ctx: CanvasRenderingContext2D, from: Point, to: Point, size: number): void; +export declare function lineUp(ctx: CanvasRenderingContext2D, from: Point, to: Point, size: number): void; +export declare function lineDown(ctx: CanvasRenderingContext2D, from: Point, to: Point, size: number): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/line.js b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/line.js new file mode 100644 index 000000000..763fba64e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/line.js @@ -0,0 +1,40 @@ +export function line (ctx, from, to, size) { + size += ctx.lineWidth * 3 + ctx.translate(to.x, to.y) + ctx.rotate(Math.atan2(to.y - from.y, to.x - from.x)) + ctx.translate(-to.x - ctx.lineWidth / 5, -to.y - ctx.lineWidth / 5) + ctx.moveTo(to.x, to.y) + ctx.lineTo(to.x - size, to.y - size / 3) + ctx.moveTo(to.x, to.y) + ctx.lineTo(to.x - size, to.y + size / 3) + ctx.stroke() +} +export function lineUp (ctx, from, to, size) { + size += ctx.lineWidth * 3 + ctx.translate(to.x, to.y) + ctx.rotate(Math.atan2(to.y - from.y, to.x - from.x)) + ctx.translate(-to.x - ctx.lineWidth / 5, -to.y - ctx.lineWidth / 5) + if (to.x > from.x) { + ctx.moveTo(to.x, to.y) + ctx.lineTo(to.x - size, to.y - size / 3) + } else { + ctx.moveTo(to.x, to.y) + ctx.lineTo(to.x - size, to.y + size / 3) + } + ctx.stroke() +} +export function lineDown (ctx, from, to, size) { + size += ctx.lineWidth * 3 + ctx.translate(to.x, to.y) + ctx.rotate(Math.atan2(to.y - from.y, to.x - from.x)) + ctx.translate(-to.x - ctx.lineWidth / 5, -to.y - ctx.lineWidth / 5) + if (to.x < from.x) { + ctx.moveTo(to.x, to.y) + ctx.lineTo(to.x - size, to.y - size / 3) + } else { + ctx.moveTo(to.x, to.y) + ctx.lineTo(to.x - size, to.y + size / 3) + } + ctx.stroke() +} +// # sourceMappingURL=line.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/line.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/line.js.map new file mode 100644 index 000000000..e367601de --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/line.js.map @@ -0,0 +1 @@ +{"version":3,"file":"line.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/arrows/line.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,IAAI,CAAC,GAA6B,EAAE,IAAW,EAAE,EAAS,EAAE,IAAY;IACtF,IAAI,IAAI,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC;IAC1B,GAAG,CAAC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AC,CAAC,CAAC;IACpE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE;QACjB,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QACvB,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC;KAC1C;SAAM;QACL,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QACvB,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC;KAC1C;IACD,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/triangle.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/triangle.d.ts new file mode 100644 index 000000000..dbbadb14e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/triangle.d.ts @@ -0,0 +1,3 @@ +import { Point } from '../../models/point'; +export declare function triangleSolid(ctx: CanvasRenderingContext2D, from: Point, to: Point, size?: number, fillStyle?: string): void; +export declare function triangle(ctx: CanvasRenderingContext2D, from: Point, to: Point, size: number): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/triangle.js b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/triangle.js new file mode 100644 index 000000000..5db610a36 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/triangle.js @@ -0,0 +1,28 @@ +import { Store } from 'le5le-store' +export function triangleSolid (ctx, from, to, size, fillStyle) { + size += ctx.lineWidth * 3 + let arrowWidth = ctx.lineWidth / 10 + if (ctx.lineWidth < 2) { + ctx.lineWidth = 2 + arrowWidth = 0 + } + ctx.translate(to.x, to.y) + ctx.rotate(Math.atan2(to.y - from.y, to.x - from.x)) + ctx.translate(-to.x - ctx.lineWidth + arrowWidth * 5, -to.y) + ctx.moveTo(to.x, to.y + arrowWidth) + ctx.lineTo(to.x, to.y - arrowWidth) + ctx.lineTo(to.x - size, to.y - size / 3) + ctx.lineTo(to.x - size, to.y + size / 3) + ctx.closePath() + ctx.stroke() + if (fillStyle) { + ctx.fillStyle = fillStyle + } else { + ctx.fillStyle = ctx.strokeStyle + } + ctx.fill() +} +export function triangle (ctx, from, to, size) { + triangleSolid(ctx, from, to, size, Store.get('LT:bkColor') || '#fff') +} +// # sourceMappingURL=triangle.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/triangle.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/triangle.js.map new file mode 100644 index 000000000..8ed8c62bd --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/arrows/triangle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"triangle.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/arrows/triangle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC,MAAM,UAAU,aAAa,CAC3B,GAA6B,EAC7B,IAAW,EACX,EAAS,EACT,IAAa,EACb,SAAkB;IAElB,IAAI,IAAI,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC;IAC1B,IAAI,UAAU,GAAG,GAAG,CAAC,SAAS,GAAG,EAAE,CAAC;IACpC,IAAI,GAAG,CAAC,SAAS,GAAG,CAAC,EAAE;QACrB,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC;QAClB,UAAU,GAAG,CAAC,CAAC;KAChB;IACD,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1B,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,SAAS,GAAG,UAAU,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7D,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC;IACpC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC;IACpC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC;IACzC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC;IAEzC,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,MAAM,EAAE,CAAC;IACb,IAAI,SAAS,EAAE;QACb,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC;KAC3B;SAAM;QACL,GAAG,CAAC,SAAS,GAAG,GAAG,CAAC,WAAW,CAAC;KACjC;IACD,GAAG,CAAC,IAAI,EAAE,CAAC;AACb,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,GAA6B,EAAE,IAAW,EAAE,EAAS,EAAE,IAAY;IAC1F,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,MAAM,CAAC,CAAC;AACxE,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/default.anchor.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/default.anchor.d.ts new file mode 100644 index 000000000..bb44fe680 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/default.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../models/node'; +export declare function defaultAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/default.anchor.js b/nezha-fronted/src/components/common/@topology/core/src/middles/default.anchor.js new file mode 100644 index 000000000..8f1e337ba --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/default.anchor.js @@ -0,0 +1,9 @@ +import { Point } from '../models/point' +import { Direction } from '../models/direction' +export function defaultAnchors (node) { + node.anchors.push(new Point(node.rect.x, node.rect.y + node.rect.height / 2, Direction.Left)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y, Direction.Up)) + node.anchors.push(new Point(node.rect.x + node.rect.width, node.rect.y + node.rect.height / 2, Direction.Right)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y + node.rect.height, Direction.Bottom)) +} +// # sourceMappingURL=default.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/default.anchor.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/default.anchor.js.map new file mode 100644 index 000000000..cc1b83474 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/default.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"default.anchor.js","sourceRoot":"","sources":["../../../../packages/core/src/middles/default.anchor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,MAAM,UAAU,cAAc,CAAC,IAAU;IACvC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9F,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3F,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IACjH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;AACpH,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/default.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/default.d.ts new file mode 100644 index 000000000..c1cfedc60 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/default.d.ts @@ -0,0 +1,12 @@ +import { Point } from '../models/point'; +import { Node } from '../models/node'; +import { Line } from '../models/line'; +export declare const drawNodeFns: any; +export declare const iconRectFns: any; +export declare const textRectFns: any; +export declare const anchorsFns: any; +export declare const drawLineFns: any; +export declare const drawArrowFns: any; +export declare function registerNode(name: string, drawFn: (ctx: CanvasRenderingContext2D, node: Node) => void, anchorsFn?: (node: Node) => void, iconRectFn?: (node: Node) => void, textRectFn?: (node: Node) => void, protect?: boolean): boolean; +export declare function registerLine(name: string, drawFn: (ctx: CanvasRenderingContext2D, line: Line) => void, drawControlPointsFn?: (ctx: CanvasRenderingContext2D, line: Line) => void, controlPointsFn?: (line: Line) => void, dockControlPointFn?: (point: Point, line: Line) => void, pointInFn?: (point: Point, line: Line) => boolean, getLength?: (line: Line) => void, getCenter?: (line: Line) => void, getPointByPos?: (line: Line) => void, force?: boolean): boolean; +export declare function registerArrow(name: string, drawFn: (ctx: CanvasRenderingContext2D, from: Point, to: Point, size: number) => void, protect?: boolean): boolean; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/default.js b/nezha-fronted/src/components/common/@topology/core/src/middles/default.js new file mode 100644 index 000000000..310d4c6c6 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/default.js @@ -0,0 +1,268 @@ +import { rectangle } from './nodes/rectangle' +import { circle } from './nodes/circle' +import { triangle } from './nodes/triangle' +import { diamond } from './nodes/diamond' +import { leftArrow, rightArrow, twowayArrow } from './nodes/arrow' +import { text } from './nodes/text' +import { line as nodeLine } from './nodes/line' +import { triangleAnchors } from './nodes/triangle.anchor' +import { arrowAnchors } from './nodes/arrow.anchor' +import { lineAnchors } from './nodes/line.anchor' +import { circleIconRect, circleTextRect } from './nodes/circle.rect' +import { triangleIconRect, triangleTextRect } from './nodes/triangle.rect' +import { diamondIconRect, diamondTextRect } from './nodes/diamond.rect' +import { twowayArrowIconRect, twowayArrowTextRect, leftArrowIconRect, leftArrowTextRect, rightArrowIconRect, rightArrowTextRect } from './nodes/arrow.rect' +import { lineIconRect, lineTextRect } from './nodes/line.rect' +import { line, lineControlPoints, calcLineControlPoints } from './lines/line' +import { polyline, polylineControlPoints, pointInPolyline, calcPolylineControlPoints, dockPolylineControlPoint } from './lines/polyline' +import { curve, curveControlPoints, pointInCurve, calcCurveControlPoints } from './lines/curve' +import { calcMindControlPoints } from './lines/mind' +import { triangleSolid, triangle as arrowTriangle } from './arrows/triangle' +import { diamondSolid, diamond as arrowDiamond } from './arrows/diamond' +import { circleSolid, circle as arrowCircle } from './arrows/circle' +import { circleAnchors } from './nodes/circle.anchor' +import { lineUp, lineDown, line as arrowLine } from './arrows/line' +import { pentagon } from './nodes/pentagon' +import { pentagonIconRect, pentagonTextRect } from './nodes/pentagon.rect' +import { pentagonAnchors } from './nodes/pentagon.anchor' +import { hexagon } from './nodes/hexagon' +import { hexagonAnchors } from './nodes/hexagon.anchor' +import { hexagonIconRect, hexagonTextRect } from './nodes/hexagon.rect' +import { pentagram } from './nodes/pentagram' +import { pentagramAnchors } from './nodes/pentagram.anchor' +import { pentagramIconRect, pentagramTextRect } from './nodes/pentagram.rect' +import { cloud } from './nodes/cloud' +import { cloudAnchors } from './nodes/cloud.anchor' +import { cloudIconRect, cloudTextRect } from './nodes/cloud.rect' +import { message } from './nodes/message' +import { messageIconRect, messageTextRect } from './nodes/message.rect' +import { messageAnchors } from './nodes/message.anchor' +import { file } from './nodes/file' +import { imageIconRect, imageTextRect } from './nodes/image.rect' +import { imageAnchors } from './nodes/image.anchor' +import { cube } from './nodes/cube' +import { cubeAnchors } from './nodes/cube.anchor' +import { cubeIconRect, cubeTextRect } from './nodes/cube.rect' +import { people } from './nodes/people' +import { peopleIconRect, peopleTextRect } from './nodes/people.rect' +import { rectangleIconRect, rectangleTextRect } from './nodes/rectangle.rect' +import { graffiti } from './nodes/graffiti' +import { graffitiAnchors } from './nodes/graffiti.anchor' +import { mindNodeAnchors } from './nodes/mindNode.anchor' +import { mindLine } from './nodes/mindLine' +import { mindLineAnchors } from './nodes/mindLine.anchor' +import { lines } from './nodes/lines' +// Functions of drawing a node. +export var drawNodeFns = {} +// Calc the occupy rect of icon. +export var iconRectFns = {} +// Calc the occupy rect of text. +export var textRectFns = {} +// Calc the anchors of node. +export var anchorsFns = {} +// Functions of drawing a line. +export var drawLineFns = {} +// Functions of drawing a arrow. +export var drawArrowFns = {} +function init () { + // ********Default nodes.******* + // Combine + drawNodeFns.combine = rectangle + // Div + drawNodeFns.div = rectangle + // graffiti + drawNodeFns.graffiti = graffiti + anchorsFns.graffiti = graffitiAnchors + // lines + drawNodeFns.lines = lines + // Square + drawNodeFns.square = rectangle + // Rectangle + drawNodeFns.rectangle = rectangle + iconRectFns.rectangle = rectangleIconRect + textRectFns.rectangle = rectangleTextRect + // Ciricle + drawNodeFns.circle = circle + iconRectFns.circle = circleIconRect + textRectFns.circle = circleTextRect + anchorsFns.circle = circleAnchors + // Triangle + drawNodeFns.triangle = triangle + anchorsFns.triangle = triangleAnchors + iconRectFns.triangle = triangleIconRect + textRectFns.triangle = triangleTextRect + // Diamond + drawNodeFns.diamond = diamond + iconRectFns.diamond = diamondIconRect + textRectFns.diamond = diamondTextRect + // Hexagon + drawNodeFns.hexagon = hexagon + iconRectFns.hexagon = hexagonIconRect + textRectFns.hexagon = hexagonTextRect + anchorsFns.hexagon = hexagonAnchors + // Pentagon + drawNodeFns.pentagon = pentagon + iconRectFns.pentagon = pentagonIconRect + textRectFns.pentagon = pentagonTextRect + anchorsFns.pentagon = pentagonAnchors + // Pentagram + drawNodeFns.pentagram = pentagram + iconRectFns.pentagram = pentagramIconRect + textRectFns.pentagram = pentagramTextRect + anchorsFns.pentagram = pentagramAnchors + // Left arrow + drawNodeFns.leftArrow = leftArrow + anchorsFns.leftArrow = arrowAnchors + iconRectFns.leftArrow = leftArrowIconRect + textRectFns.leftArrow = leftArrowTextRect + // Right arrow + drawNodeFns.rightArrow = rightArrow + anchorsFns.rightArrow = arrowAnchors + iconRectFns.rightArrow = rightArrowIconRect + textRectFns.rightArrow = rightArrowTextRect + // Two-way arrow + drawNodeFns.twowayArrow = twowayArrow + anchorsFns.twowayArrow = arrowAnchors + iconRectFns.twowayArrow = twowayArrowIconRect + textRectFns.twowayArrow = twowayArrowTextRect + // Cloud + drawNodeFns.cloud = cloud + anchorsFns.cloud = cloudAnchors + iconRectFns.cloud = cloudIconRect + textRectFns.cloud = cloudTextRect + // Message + drawNodeFns.message = message + anchorsFns.message = messageAnchors + iconRectFns.message = messageIconRect + textRectFns.message = messageTextRect + // File + drawNodeFns.file = file + // Text + drawNodeFns.text = text + iconRectFns.text = lineIconRect + // Line + drawNodeFns.line = nodeLine + anchorsFns.line = lineAnchors + iconRectFns.line = lineIconRect + textRectFns.line = lineTextRect + // Image + drawNodeFns.image = function (ctx, node) { } + iconRectFns.image = imageIconRect + textRectFns.image = imageTextRect + anchorsFns.image = imageAnchors + // Cube + drawNodeFns.cube = cube + anchorsFns.cube = cubeAnchors + iconRectFns.cube = cubeIconRect + textRectFns.cube = cubeTextRect + // People + drawNodeFns.people = people + iconRectFns.people = peopleIconRect + textRectFns.people = peopleTextRect + // MindNode + drawNodeFns.mindNode = rectangle + anchorsFns.mindNode = mindNodeAnchors + iconRectFns.mindNode = rectangleIconRect + textRectFns.mindNode = rectangleTextRect + // MindLine + drawNodeFns.mindLine = mindLine + anchorsFns.mindLine = mindLineAnchors + // ********end******** + // ********Default lines.******* + drawLineFns.line = { + drawFn: line, + drawControlPointsFn: lineControlPoints, + controlPointsFn: calcLineControlPoints, + pointIn: pointInPolyline + } + drawLineFns.polyline = { + drawFn: polyline, + drawControlPointsFn: polylineControlPoints, + controlPointsFn: calcPolylineControlPoints, + dockControlPointFn: dockPolylineControlPoint, + pointIn: pointInPolyline + } + drawLineFns.curve = { + drawFn: curve, + drawControlPointsFn: curveControlPoints, + controlPointsFn: calcCurveControlPoints, + pointIn: pointInCurve + } + drawLineFns.mind = { + drawFn: curve, + drawControlPointsFn: curveControlPoints, + controlPointsFn: calcMindControlPoints, + pointIn: pointInCurve + } + // ********end******** + // ********Default nodes.******* + drawArrowFns.triangleSolid = triangleSolid + drawArrowFns.triangle = arrowTriangle + drawArrowFns.diamondSolid = diamondSolid + drawArrowFns.diamond = arrowDiamond + drawArrowFns.circleSolid = circleSolid + drawArrowFns.circle = arrowCircle + drawArrowFns.line = arrowLine + drawArrowFns.lineUp = lineUp + drawArrowFns.lineDown = lineDown + // ********end******** +} +init() +// registerNode: Register a custom node. +// name - The name of node. +// drawFn - How to draw. +// anchorsFn - How to get the anchors. +// iconRectFn - How to get the icon rect. +// textRectFn - How to get the text rect. +// protect - No overwirte the node if exists. +export function registerNode (name, drawFn, anchorsFn, iconRectFn, textRectFn, protect) { + // Exist + if (drawNodeFns[name] && protect) { + return false + } + drawNodeFns[name] = drawFn + anchorsFns[name] = anchorsFn + iconRectFns[name] = iconRectFn + textRectFns[name] = textRectFn + return true +} +// registerLine: Register a custom line. +// name - The name of line. +// drawFn - How to draw. +// drawControlPointsFn - Draw the control points. +// controlPointsFn - How to get the controlPoints. +// dockControlPointFn - Dock a point to horizontal/vertial or related position. +// force - Overwirte the node if exists. +export function registerLine (name, drawFn, drawControlPointsFn, controlPointsFn, dockControlPointFn, pointInFn, getLength, getCenter, getPointByPos, force) { + if (force === void 0) { force = true } + // Exist + if (drawLineFns[name] && !force) { + return false + } + drawLineFns[name] = { + drawFn: drawFn, + drawControlPointsFn: drawControlPointsFn, + controlPointsFn: controlPointsFn, + dockControlPointFn: dockControlPointFn, + pointIn: pointInFn, + getLength: getLength, + getCenter: getCenter, + getPointByPos: getPointByPos + } + return true +} +// registerArrow: Register a custom arrow. +// name - the name of arrow. +// drawFn - how to draw. +// force - Overwirte the node if exists. +export function registerArrow (name, drawFn, protect) { + // Exist + if (drawArrowFns[name] && protect) { + return false + } + drawArrowFns[name] = drawFn + return true +} +window.registerTopologyNode = registerNode +window.registerTopologyLine = registerLine +// # sourceMappingURL=default.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/default.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/default.js.map new file mode 100644 index 000000000..8bcbb4b33 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/default.js.map @@ -0,0 +1 @@ +{"version":3,"file":"default.js","sourceRoot":"","sources":["../../../../packages/core/src/middles/default.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EA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,CAAC;AACnD,MAAc,CAAC,oBAAoB,GAAG,YAAY,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/default.rect.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/default.rect.d.ts new file mode 100644 index 000000000..7817c50fc --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/default.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '../models/node'; +export declare function defaultIconRect(node: Node): void; +export declare function defaultTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/default.rect.js b/nezha-fronted/src/components/common/@topology/core/src/middles/default.rect.js new file mode 100644 index 000000000..969ee277e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/default.rect.js @@ -0,0 +1,17 @@ +import { Rect } from '../models/rect' +export function defaultIconRect (node) { + if (node.image && node.imageWidth) { + node.iconRect = new Rect(node.rect.x + node.paddingLeftNum, node.rect.y + node.paddingTopNum, node.imageWidth, node.imageHeight) + } else if (node.icon && node.iconSize) { + node.iconRect = new Rect(node.rect.x + node.paddingLeftNum, node.rect.y + node.paddingTopNum, node.iconSize, node.iconSize) + } else { + node.iconRect = new Rect(node.rect.x + node.paddingLeftNum, node.rect.y + node.paddingTopNum, node.rect.width - node.paddingLeftNum - node.paddingRightNum, (node.rect.height * 3) / 4 - node.paddingTopNum - node.paddingBottomNum) + } + node.fullIconRect = new Rect(node.rect.x + node.paddingLeftNum, node.rect.y + node.paddingTopNum, node.rect.width - node.paddingLeftNum - node.paddingRightNum, node.rect.height - node.paddingTopNum - node.paddingBottomNum) +} +export function defaultTextRect (node) { + const height = node.rect.height - node.paddingTopNum - node.paddingBottomNum + node.textRect = new Rect(node.rect.x + node.paddingLeftNum, node.rect.y + node.paddingTopNum + (height * 3) / 4, node.rect.width - node.paddingLeftNum - node.paddingRightNum, height / 4) + node.fullTextRect = new Rect(node.rect.x + node.paddingLeftNum, node.rect.y + node.paddingTopNum, node.rect.width - node.paddingLeftNum - node.paddingRightNum, height) +} +// # sourceMappingURL=default.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/default.rect.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/default.rect.js.map new file mode 100644 index 000000000..2e6e95063 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/default.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"default.rect.js","sourceRoot":"","sources":["../../../../packages/core/src/middles/default.rect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,MAAM,UAAU,eAAe,CAAC,IAAU;IACxC,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,UAAU,EAAE;QACjC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CACtB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,cAAc,EACjC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,aAAa,EAChC,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,WAAW,CACjB,CAAC;KACH;SAAM,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE;QACrC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CACtB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,cAAc,EACjC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,aAAa,EAChC,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,QAAQ,CACd,CAAC;KACH;SAAM;QACL,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CACtB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,cAAc,EACjC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,aAAa,EAChC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,E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MAAM,CACP,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/index.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/index.d.ts new file mode 100644 index 000000000..f3d25ba2d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/index.d.ts @@ -0,0 +1,3 @@ +export * from './default'; +export * from './nodes/rectangle'; +export * from './nodes/text'; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/index.js b/nezha-fronted/src/components/common/@topology/core/src/middles/index.js new file mode 100644 index 000000000..260369402 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/index.js @@ -0,0 +1,4 @@ +export * from './default' +export * from './nodes/rectangle' +export * from './nodes/text' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/index.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/index.js.map new file mode 100644 index 000000000..af4cada9d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/core/src/middles/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/lines/curve.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/curve.d.ts new file mode 100644 index 000000000..b91971d48 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/curve.d.ts @@ -0,0 +1,10 @@ +import { Point } from '../../models/point'; +import { Pen } from '../../models/pen'; +import { Line } from '../../models/line'; +export declare function curve(ctx: CanvasRenderingContext2D, l: Line): void; +export declare function curveControlPoints(ctx: CanvasRenderingContext2D, l: Line): void; +export declare function calcCurveControlPoints(l: Line): void; +export declare function pointInCurve(point: Point, l: Line): boolean; +export declare function getBezierPoint(pos: number, from: Point, cp1: Point, cp2: Point, to: Point): Point; +export declare function getControlPt(pt: Point, to: Point): Point; +export declare function generateStoreKey(pen: Pen, key: String): string; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/lines/curve.js b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/curve.js new file mode 100644 index 000000000..373fbcb7e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/curve.js @@ -0,0 +1,128 @@ +import { Store } from 'le5le-store' +import { Point } from '../../models/point' +import { Direction } from '../../models/direction' +import { pointInLine } from '../../utils/canvas' +import { rgba } from '../../utils/math' +const distance = 80 +export function curve (ctx, l) { + ctx.beginPath() + ctx.moveTo(l.from.x, l.from.y) + ctx.bezierCurveTo(l.controlPoints[0].x, l.controlPoints[0].y, l.controlPoints[1].x, l.controlPoints[1].y, l.to.x, l.to.y) + ctx.stroke() +} +export function curveControlPoints (ctx, l) { + ctx.save() + ctx.fillStyle = rgba(0.5, ctx.strokeStyle + '') + ctx.lineWidth = 1 + ctx.beginPath() + ctx.moveTo(l.from.x, l.from.y) + ctx.lineTo(l.controlPoints[0].x, l.controlPoints[0].y) + ctx.stroke() + ctx.beginPath() + ctx.moveTo(l.to.x, l.to.y) + ctx.lineTo(l.controlPoints[1].x, l.controlPoints[1].y) + ctx.stroke() + ctx.fillStyle = '#fff' + ctx.lineWidth = 2 + for (let _i = 0, _a = l.controlPoints; _i < _a.length; _i++) { + const item = _a[_i] + ctx.beginPath() + ctx.arc(item.x, item.y, 4, 0, Math.PI * 2) + ctx.stroke() + ctx.fill() + } + ctx.restore() +} +export function calcCurveControlPoints (l) { + if (!l.from.direction) { + l.from.direction = Direction.Bottom + } + if (!l.to.direction) { + l.to.direction = (l.from.direction + 2) % 4 + if (!l.to.direction) { + l.to.direction = Direction.Left + } + } + l.controlPoints = [getControlPt(l.from, l.to), getControlPt(l.to, l.from)] + Store.set(generateStoreKey(l, 'pts-') + l.id, undefined) +} +export function pointInCurve (point, l) { + let points = Store.get(generateStoreKey(l, 'pts-') + l.id) + if (!points) { + points = [l.from] + if (l.controlPoints) { + for (var i = 0.01; i < 1; i += 0.01) { + points.push(getBezierPoint(i, l.from, l.controlPoints[0], l.controlPoints[1], l.to)) + } + } + points.push(l.to) + Store.set(generateStoreKey(l, 'pts-') + l.id, points) + } + const cnt = points.length - 1 + for (var i = 0; i < cnt; ++i) { + if (pointInLine(point, points[i], points[i + 1])) { + return true + } + } + return false +} +// Get a point in bezier. +// pos - The position of point in bezier. It is expressed as a percentage(0 - 1). +export function getBezierPoint (pos, from, cp1, cp2, to) { + const x1 = from.x; const y1 = from.y + const x2 = to.x; const y2 = to.y + const cx1 = cp1.x; const cy1 = cp1.y + const cx2 = cp2.x; const cy2 = cp2.y + const x = x1 * (1 - pos) * (1 - pos) * (1 - pos) + + 3 * cx1 * pos * (1 - pos) * (1 - pos) + + 3 * cx2 * pos * pos * (1 - pos) + + x2 * pos * pos * pos + const y = y1 * (1 - pos) * (1 - pos) * (1 - pos) + + 3 * cy1 * pos * (1 - pos) * (1 - pos) + + 3 * cy2 * pos * pos * (1 - pos) + + y2 * pos * pos * pos + return new Point(x, y) +} +export function getControlPt (pt, to) { + const point = new Point(pt.x, pt.y, pt.direction, pt.anchorIndex, pt.id) + let dis = window.topologyControlPtDistance || distance + if ((pt.direction === Direction.Up || pt.direction === Direction.Bottom) && Math.abs(pt.x - to.x) < 3) { + if (to.y > pt.y) { + dis = Math.round((to.y - pt.y) / 3) + point.y += dis + } else { + dis = Math.round((pt.y - to.y) / 3) + point.y -= dis + } + return point + } + if ((pt.direction === Direction.Left || pt.direction === Direction.Right) && Math.abs(pt.y - to.y) < 3) { + if (to.x > pt.x) { + dis = Math.round((to.x - pt.x) / 3) + point.x += dis + } else { + dis = Math.round((pt.x - to.x) / 3) + point.x -= dis + } + return point + } + switch (pt.direction) { + case Direction.Up: + point.y -= dis + break + case Direction.Right: + point.x += dis + break + case Direction.Bottom: + point.y += dis + break + case Direction.Left: + point.x -= dis + break + } + return point +} +export function generateStoreKey (pen, key) { + return pen.getTID() + '-' + key +} +// # sourceMappingURL=curve.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/lines/curve.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/curve.js.map new file mode 100644 index 000000000..204323bc9 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/curve.js.map @@ -0,0 +1 @@ +{"version":3,"file":"curve.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/lines/curve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAG3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,IAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB,MAAM,UAAU,KAAK,CAAC,GAA6B,EAAE,CAAO;IAC1D,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/B,GAAG,CAAC,aAAa,CACf,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,EACpB,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,EACpB,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,EACpB,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,EACpB,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAAC,CAAC,EAAE,CAAC,CAAC,CACP,CAAC;IACF,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,GAA6B,EAA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AAI;YACjB,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC;YACf,MAAM;KACT;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,GAAQ,EAAE,GAAW;IACpD,OAAU,GAAG,CAAC,MAAM,EAAE,SAAI,GAAK,CAAC;AAClC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/lines/line.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/line.d.ts new file mode 100644 index 000000000..6072001d5 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/line.d.ts @@ -0,0 +1,4 @@ +import { Line } from '../../models/line'; +export declare function line(ctx: CanvasRenderingContext2D, l: Line): void; +export declare function lineControlPoints(ctx: CanvasRenderingContext2D, l: Line): void; +export declare function calcLineControlPoints(l: Line): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/lines/line.js b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/line.js new file mode 100644 index 000000000..92f00d506 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/line.js @@ -0,0 +1,11 @@ +export function line (ctx, l) { + ctx.beginPath() + ctx.moveTo(l.from.x, l.from.y) + ctx.lineTo(l.to.x, l.to.y) + ctx.stroke() +} +export function lineControlPoints (ctx, l) { } +export function calcLineControlPoints (l) { + l.controlPoints = [] +} +// # sourceMappingURL=line.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/lines/line.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/line.js.map new file mode 100644 index 000000000..643ac794b --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/line.js.map @@ -0,0 +1 @@ +{"version":3,"file":"line.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/lines/line.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,IAAI,CAAC,GAA6B,EAAE,CAAO;IACzD,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/B,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3B,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,GAA6B,EAAE,CAAO,IAAI,CAAC;AAE7E,MAAM,UAAU,qBAAqB,CAAC,CAAO;IAC3C,CAAC,CAAC,aAAa,GAAG,EAAE,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/lines/mind.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/mind.d.ts new file mode 100644 index 000000000..a8f42335a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/mind.d.ts @@ -0,0 +1,2 @@ +import { Line } from '../../models/line'; +export declare function calcMindControlPoints(l: Line): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/lines/mind.js b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/mind.js new file mode 100644 index 000000000..ac5b5ac97 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/mind.js @@ -0,0 +1,32 @@ +import { Store } from 'le5le-store' +import { Point } from '../../models/point' +import { Direction } from '../../models/direction' +import { generateStoreKey } from './curve' +const distance = 20 +export function calcMindControlPoints (l) { + if (!l.from.direction) { + l.from.direction = Direction.Bottom + } + if (!l.to.direction) { + l.to.direction = (l.from.direction + 2) % 4 + if (!l.to.direction) { + l.to.direction = Direction.Left + } + } + switch (l.from.direction) { + case Direction.Up: + l.controlPoints = [new Point(l.from.x, l.from.y - distance), new Point(l.from.x, l.to.y)] + break + case Direction.Right: + l.controlPoints = [new Point(l.from.x + distance, l.from.y), new Point(l.from.x, l.to.y)] + break + case Direction.Bottom: + l.controlPoints = [new Point(l.from.x, l.from.y + distance), new Point(l.from.x, l.to.y)] + break + case Direction.Left: + l.controlPoints = [new Point(l.from.x - distance, l.from.y), new Point(l.from.x, l.to.y)] + break + } + Store.set(generateStoreKey(l, 'pts-') + l.id, undefined) +} +// # sourceMappingURL=mind.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/lines/mind.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/mind.js.map new file mode 100644 index 000000000..5c3012568 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/mind.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mind.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/lines/mind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,IAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB,MAAM,UAAU,qBAAqB,CAAC,CAAO;IAC3C,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE;QACrB,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC;KACrC;IACD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,EAAE;QACnB,CAAC,CAAC,EAAE,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,EAAE;YACnB,CAAC,CAAC,EAAE,CAAC,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC;SACjC;KACF;IAED,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE;QACxB,K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AAC,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;AAC3D,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/lines/polyline.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/polyline.d.ts new file mode 100644 index 000000000..42bc7877e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/polyline.d.ts @@ -0,0 +1,7 @@ +import { Point } from '../../models/point'; +import { Line } from '../../models/line'; +export declare function polyline(ctx: CanvasRenderingContext2D, l: Line): void; +export declare function polylineControlPoints(ctx: CanvasRenderingContext2D, l: Line): void; +export declare function calcPolylineControlPoints(l: Line): void; +export declare function pointInPolyline(point: Point, l: Line): boolean; +export declare function dockPolylineControlPoint(point: Point, l: Line): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/lines/polyline.js b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/polyline.js new file mode 100644 index 000000000..57a494f84 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/polyline.js @@ -0,0 +1,285 @@ +import { Point } from '../../models/point' +import { Direction } from '../../models/direction' +import { pointInLine } from '../../utils/canvas' +const minDistance = 50 +export function polyline (ctx, l) { + ctx.beginPath() + ctx.moveTo(l.from.x, l.from.y) + for (let _i = 0, _a = l.controlPoints; _i < _a.length; _i++) { + const item = _a[_i] + ctx.lineTo(item.x, item.y) + } + ctx.lineTo(l.to.x, l.to.y) + ctx.stroke() +} +export function polylineControlPoints (ctx, l) { + ctx.save() + ctx.fillStyle = '#fff' + ctx.lineWidth = 2 + for (let _i = 0, _a = l.controlPoints; _i < _a.length; _i++) { + const item = _a[_i] + ctx.beginPath() + ctx.arc(item.x, item.y, 4, 0, Math.PI * 2) + ctx.stroke() + ctx.fill() + } + ctx.restore() +} +export function calcPolylineControlPoints (l) { + l.controlPoints = [] + const from = getDirectionPoint(l.from, l.to) + if (l.from.direction) { + l.controlPoints.push(from) + } + const to = getDirectionPoint(l.to, l.from) + let pts + switch (from.direction) { + case Direction.Up: + pts = getNextPointByUp(from, to) + break + case Direction.Right: + pts = getNextPointByRight(from, to) + break + case Direction.Bottom: + pts = getNextPointByBottom(from, to) + break + case Direction.Left: + pts = getNextPointByLeft(from, to) + break + } + l.controlPoints.push.apply(l.controlPoints, pts) + if (l.to.direction) { + l.controlPoints.push(to) + } +} +export function pointInPolyline (point, l) { + if (!l.controlPoints || !l.controlPoints.length) { + return pointInLine(point, l.from, l.to, l.lineWidth / 2) + } + if (pointInLine(point, l.from, l.controlPoints[0])) { + return true + } + if (pointInLine(point, l.to, l.controlPoints[l.controlPoints.length - 1])) { + return true + } + for (let i = 0; i < l.controlPoints.length - 1; ++i) { + if (pointInLine(point, l.controlPoints[i], l.controlPoints[i + 1])) { + return true + } + } + return false +} +export function dockPolylineControlPoint (point, l) { + const pts = [l.from] + pts.push.apply(pts, l.controlPoints) + pts.push(l.to) + for (let _i = 0, pts_1 = pts; _i < pts_1.length; _i++) { + const item = pts_1[_i] + if (Math.abs(point.x - item.x) < 7) { + point.x = item.x + } + if (Math.abs(point.y - item.y) < 7) { + point.y = item.y + } + } +} +function getDirectionPoint (pt, to) { + const point = pt.clone() + switch (pt.direction) { + case Direction.Up: + if (to.y < pt.y) { + point.y -= Math.round((pt.y - to.y) / 2) + } else { + point.y -= minDistance + } + break + case Direction.Right: + if (to.x > pt.x) { + point.x += Math.round((to.x - pt.x) / 2) + } else { + point.x += minDistance + } + break + case Direction.Bottom: + if (to.y > pt.y) { + point.y += Math.round((to.y - pt.y) / 2) + } else { + point.y += minDistance + } + break + case Direction.Left: + if (to.x < pt.x) { + point.x -= Math.round((pt.x - to.x) / 2) + } else { + point.x -= minDistance + } + break + } + return point +} +function getNextPointByUp (from, to) { + if (from.x === to.x || from.y === to.y) { + return [] + } + // The to point above the from point. + if (from.y > to.y) { + if (to.direction === Direction.Up && from.y - to.y > 3 * minDistance) { + if (from.x < to.x) { + if (to.x - from.x < minDistance) { + return [new Point(from.x - 2 * minDistance, from.y), new Point(from.x - 2 * minDistance, to.y)] + } + return [new Point(from.x, to.y)] + } else { + if (from.x - to.x < minDistance) { + return [new Point(from.x + 2 * minDistance, from.y), new Point(from.x + 2 * minDistance, to.y)] + } + return [new Point(from.x, to.y)] + } + } else { + // Left top + if ((to.direction === Direction.Left && from.x > to.x) || (to.direction === Direction.Right && from.x < to.x)) { + return [new Point(to.x, from.y)] + } + return [new Point(from.x, to.y)] + } + // The to point below the from point. + } else { + if (to.direction === Direction.Bottom) { + if (from.x < to.x) { + return getHorizontalPoints(from, to) + } else { + const pts = getHorizontalPoints(to, from) + return [pts[1], pts[0]] + } + } else { + return [new Point(to.x, from.y)] + } + } +} +function getNextPointByBottom (from, to) { + if (from.x === to.x || from.y === to.y) { + return [] + } + // The to point below the from point. + if (from.y < to.y) { + if (to.direction === Direction.Bottom && to.y - from.y > 3 * minDistance) { + if (from.x < to.x) { + if (to.x - from.x < minDistance) { + return [new Point(from.x - 2 * minDistance, from.y), new Point(from.x - 2 * minDistance, to.y)] + } + return [new Point(from.x, to.y)] + } else { + if (from.x - to.x < minDistance) { + return [new Point(from.x + 2 * minDistance, from.y), new Point(from.x + 2 * minDistance, to.y)] + } + return [new Point(from.x, to.y)] + } + } else { + if ((to.direction === Direction.Left && from.x > to.x) || (to.direction === Direction.Right && from.x < to.x)) { + return [new Point(to.x, from.y)] + } + return [new Point(from.x, to.y)] + } + // The to point below the from point. + } else { + if (to.direction === Direction.Up) { + if (from.x < to.x) { + return getHorizontalPoints(from, to) + } else { + const pts = getHorizontalPoints(to, from) + return [pts[1], pts[0]] + } + } else { + return [new Point(to.x, from.y)] + } + } +} +function getNextPointByLeft (from, to) { + if (from.x === to.x || from.y === to.y) { + return [] + } + // The to point is on the left. + if (from.x > to.x) { + if (to.direction === Direction.Left && from.x - to.x > 3 * minDistance) { + if (from.y < to.y) { + if (to.y - from.y < minDistance) { + return [new Point(from.x, from.y + 2 * minDistance), new Point(to.x, from.y + 2 * minDistance)] + } + return [new Point(to.x, from.y)] + } else { + if (from.y - to.y < minDistance) { + return [new Point(from.x, from.y - 2 * minDistance), new Point(to.x, from.y - 2 * minDistance)] + } + return [new Point(to.x, from.y)] + } + } else { + if (to.direction === Direction.Left || + (to.direction === Direction.Up && from.y < to.y) || + (to.direction === Direction.Bottom && from.y > to.y)) { + return [new Point(to.x, from.y)] + } + return [new Point(from.x, to.y)] + } + // The to point is on the right. + } else { + if (to.direction === Direction.Right) { + if (from.y < to.y) { + return getVerticalPoints(from, to) + } else { + const pts = getVerticalPoints(to, from) + return [pts[1], pts[0]] + } + } else { + return [new Point(from.x, to.y)] + } + } +} +function getNextPointByRight (from, to) { + if (from.x === to.x || from.y === to.y) { + return [] + } + // The to point is on the right. + if (from.x < to.x) { + if (to.direction === Direction.Right && to.x - from.x > 3 * minDistance) { + if (from.y < to.y) { + if (to.y - from.y < minDistance) { + return [new Point(from.x, from.y - 2 * minDistance), new Point(to.x, from.y - 2 * minDistance)] + } + return [new Point(to.x, from.y)] + } else { + if (from.y - to.y < minDistance) { + return [new Point(from.x, from.y + 2 * minDistance), new Point(to.x, from.y + 2 * minDistance)] + } + return [new Point(to.x, from.y)] + } + } else { + if (to.direction === Direction.Right || + (to.direction === Direction.Up && from.y < to.y) || + (to.direction === Direction.Bottom && from.y > to.y)) { + return [new Point(to.x, from.y)] + } + return [new Point(from.x, to.y)] + } + // The to point is on the left. + } else { + if (to.direction === Direction.Left) { + if (from.y < to.y) { + return getVerticalPoints(from, to) + } else { + const pts = getVerticalPoints(to, from) + return [pts[1], pts[0]] + } + } else { + return [new Point(from.x, to.y)] + } + } +} +function getHorizontalPoints (left, right) { + const x = left.x + (right.x - left.x) / 2 + return [new Point(x, left.y), new Point(x, right.y)] +} +function getVerticalPoints (up, bottom) { + const y = up.y + (bottom.y - up.y) / 2 + return [new Point(up.x, y), new Point(bottom.x, y)] +} +// # sourceMappingURL=polyline.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/lines/polyline.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/polyline.js.map new file mode 100644 index 000000000..77eb90ac9 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/lines/polyline.js.map @@ -0,0 +1 @@ +{"version":3,"file":"polyline.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/lines/polyline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,IAAM,WAAW,GAAG,EAAE,CAAC;AAEvB,MAAM,UAAU,QAAQ,CAAC,GAA6B,EAAE,CAAO;IAC7D,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/B,KAAmB,UAAe,EAAf,KAAA,CAAC,CAAC,aAAa,EAAf,cAAe,EAAf,IAAe,EAAE;QAA/B,IAAM,IAAI,SAAA;QACb,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;KAC5B;IACD,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3B,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,GAA6B,EAAE,CAAO;IAC1E,GAAG,CAAC,IAAI,EAAE,CAAC;IACX,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC;IACvB,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC;IAClB,KAAmB,UAAe,EAAf,KAAA,CAAC,CAAC,aAAa,EAAf,cAAe,EAAf,IAAe,EAAE;QAA/B,IAAM,IAAI,SAAA;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;AACvD,CAAC;AAED,SAAS,iBAAiB,CAAC,EAAS,EAAE,MAAa;IACjD,IAAM,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACvC,OAAO,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.anchor.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.anchor.d.ts new file mode 100644 index 000000000..de28d6452 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function arrowAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.anchor.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.anchor.js new file mode 100644 index 000000000..0221a5849 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.anchor.js @@ -0,0 +1,7 @@ +import { Point } from '../../models/point' +import { Direction } from '../../models/direction' +export function arrowAnchors (node) { + node.anchors.push(new Point(node.rect.x, node.rect.y + node.rect.height / 2, Direction.Left)) + node.anchors.push(new Point(node.rect.x + node.rect.width, node.rect.y + node.rect.height / 2, Direction.Right)) +} +// # sourceMappingURL=arrow.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.anchor.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.anchor.js.map new file mode 100644 index 000000000..5a1edc44c --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"arrow.anchor.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/arrow.anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,UAAU,YAAY,CAAC,IAAU;IACrC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9F,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;AACnH,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.d.ts new file mode 100644 index 000000000..912f942f2 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.d.ts @@ -0,0 +1,4 @@ +import { Node } from '../../models/node'; +export declare function leftArrow(ctx: CanvasRenderingContext2D, node: Node): void; +export declare function rightArrow(ctx: CanvasRenderingContext2D, node: Node): void; +export declare function twowayArrow(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.js new file mode 100644 index 000000000..768ad3e16 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.js @@ -0,0 +1,45 @@ +export function leftArrow (ctx, node) { + ctx.beginPath() + ctx.moveTo(node.rect.x, node.rect.y + node.rect.height / 2) + ctx.lineTo(node.rect.x + node.rect.height / 2, node.rect.y) + ctx.lineTo(node.rect.x + node.rect.height / 2, node.rect.y + node.rect.height / 3) + ctx.lineTo(node.rect.x + node.rect.width, node.rect.y + node.rect.height / 3) + ctx.lineTo(node.rect.x + node.rect.width, node.rect.y + (node.rect.height * 2) / 3) + // ctx.lineTo(node.rect.x + (node.rect.width - node.rect.height / 2), node.rect.y + (node.rect.height * 2) / 3); + ctx.lineTo(node.rect.x + node.rect.height / 2, node.rect.y + (node.rect.height * 2) / 3) + ctx.lineTo(node.rect.x + node.rect.height / 2, node.rect.y + (node.rect.height * 2) / 3) + ctx.lineTo(node.rect.x + node.rect.height / 2, node.rect.y + node.rect.height) + ctx.closePath(); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +export function rightArrow (ctx, node) { + ctx.beginPath() + ctx.moveTo(node.rect.x, node.rect.y + node.rect.height / 3) + ctx.lineTo(node.rect.x + (node.rect.width - node.rect.height / 2), node.rect.y + node.rect.height / 3) + ctx.lineTo(node.rect.x + (node.rect.width - node.rect.height / 2), node.rect.y) + ctx.lineTo(node.rect.x + node.rect.width, node.rect.y + node.rect.height / 2) + ctx.lineTo(node.rect.x + (node.rect.width - node.rect.height / 2), node.rect.y + node.rect.height) + ctx.lineTo(node.rect.x + (node.rect.width - node.rect.height / 2), node.rect.y + (node.rect.height * 2) / 3) + ctx.lineTo(node.rect.x, node.rect.y + (node.rect.height * 2) / 3) + ctx.closePath(); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +export function twowayArrow (ctx, node) { + ctx.beginPath() + ctx.moveTo(node.rect.x, node.rect.y + node.rect.height / 2) + ctx.lineTo(node.rect.x + node.rect.height / 2, node.rect.y) + ctx.lineTo(node.rect.x + node.rect.height / 2, node.rect.y + node.rect.height / 3) + ctx.lineTo(node.rect.x + (node.rect.width - node.rect.height / 2), node.rect.y + node.rect.height / 3) + ctx.lineTo(node.rect.x + (node.rect.width - node.rect.height / 2), node.rect.y) + ctx.lineTo(node.rect.x + node.rect.width, node.rect.y + node.rect.height / 2) + ctx.lineTo(node.rect.x + (node.rect.width - node.rect.height / 2), node.rect.y + node.rect.height) + ctx.lineTo(node.rect.x + (node.rect.width - node.rect.height / 2), node.rect.y + (node.rect.height * 2) / 3) + ctx.lineTo(node.rect.x + node.rect.height / 2, node.rect.y + (node.rect.height * 2) / 3) + ctx.lineTo(node.rect.x + node.rect.height / 2, node.rect.y + node.rect.height) + ctx.closePath(); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=arrow.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.js.map new file mode 100644 index 000000000..1476c3de4 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.js.map @@ -0,0 +1 @@ +{"version":3,"file":"arrow.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/arrow.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,SAAS,CAAC,GAA6B,EAAE,IAAU;IACjE,GAAG,CAAC,SAAS,EAAE,CAAC;IAEhB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC5D,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC5D,GAAG,CAAC,MAAM,CACR,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG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,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAClC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CACzC,CAAC;IACF,GAAG,CAAC,MAAM,CACR,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAClC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAC/B,CAAC;IACF,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.rect.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.rect.d.ts new file mode 100644 index 000000000..4f2bbc033 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.rect.d.ts @@ -0,0 +1,7 @@ +import { Node } from '../../models/node'; +export declare function leftArrowIconRect(node: Node): void; +export declare function leftArrowTextRect(node: Node): void; +export declare function rightArrowIconRect(node: Node): void; +export declare function rightArrowTextRect(node: Node): void; +export declare function twowayArrowIconRect(node: Node): void; +export declare function twowayArrowTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.rect.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.rect.js new file mode 100644 index 000000000..62fc29887 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.rect.js @@ -0,0 +1,23 @@ +import { Rect } from '../../models/rect' +export function leftArrowIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function leftArrowTextRect (node) { + node.textRect = new Rect(node.rect.x + node.rect.height / 2, node.rect.y + node.rect.height / 3, node.rect.width - node.rect.height / 2, node.rect.height / 3) + node.fullTextRect = node.textRect +} +export function rightArrowIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function rightArrowTextRect (node) { + node.textRect = new Rect(node.rect.x, node.rect.y + node.rect.height / 3, node.rect.width - node.rect.height / 2, node.rect.height / 3) + node.fullTextRect = node.textRect +} +export function twowayArrowIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function twowayArrowTextRect (node) { + node.textRect = new Rect(node.rect.x + node.rect.height / 2, node.rect.y + node.rect.height / 3, node.rect.width - node.rect.height, node.rect.height / 3) + node.fullTextRect = node.textRect +} +// # sourceMappingURL=arrow.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.rect.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.rect.js.map new file mode 100644 index 000000000..9c9a3556e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/arrow.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"arrow.rect.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/arrow.rect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,MAAM,UAAU,iBAAiB,CAAC,IAAU;IAC1C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAU;IAC1C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CACtB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAClC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG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AI,CAAC,IAAI,CAAC,MAAM,EAClC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CACrB,CAAC;IACF,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.anchor.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.anchor.d.ts new file mode 100644 index 000000000..522bf532d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function circleAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.anchor.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.anchor.js new file mode 100644 index 000000000..51222be8d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.anchor.js @@ -0,0 +1,18 @@ +import { Point } from '../../models/point' +import { Direction } from '../../models/direction' +export function circleAnchors (node) { + node.anchors.push(new Point(node.rect.x, node.rect.y + node.rect.height / 2, Direction.Left)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y, Direction.Up)) + node.anchors.push(new Point(node.rect.x + node.rect.width, node.rect.y + node.rect.height / 2, Direction.Right)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y + node.rect.height, Direction.Bottom)) + for (let i = 5; i < 360; i += 5) { + if (i % 90 === 0) { + continue + } + const direction = Math.round(i / 90) + const pt = new Point(node.rect.center.x + (Math.sin((i / 180) * Math.PI) * node.rect.width) / 2, node.rect.center.y + (Math.cos((i / 180) * Math.PI) * node.rect.height) / 2, direction) + pt.hidden = true + node.anchors.push(pt) + } +} +// # sourceMappingURL=circle.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.anchor.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.anchor.js.map new file mode 100644 index 000000000..70c561e3d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"circle.anchor.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/circle.anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,UAAU,aAAa,CAAC,IAAU;IACtC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9F,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3F,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IACjH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IAElH,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;QAC/B,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE;YAChB,SAAS;SACV;QAED,IAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;QACrC,IAAM,EAAE,GAAG,IAAI,KAAK,CAClB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAC1E,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAC3E,SAAS,CACV,CAAC;QACF,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KACvB;AACH,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.d.ts new file mode 100644 index 000000000..e19f41f9b --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function circle(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.js new file mode 100644 index 000000000..59a951aeb --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.js @@ -0,0 +1,7 @@ +export function circle (ctx, node) { + ctx.beginPath() + ctx.ellipse(node.rect.x + node.rect.width / 2, node.rect.y + node.rect.height / 2, node.rect.width / 2, node.rect.height / 2, 0, 0, Math.PI * 2); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=circle.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.js.map new file mode 100644 index 000000000..8083a706e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"circle.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/circle.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,MAAM,CAAC,GAA6B,EAAE,IAAU;IAC9D,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,OAAO,CACT,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EACjC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAClC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EACnB,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EACpB,CAAC,EACD,CAAC,EACD,IAAI,CAAC,EAAE,GAAG,CAAC,CACZ,CAAC;IACF,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.rect.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.rect.d.ts new file mode 100644 index 000000000..10d1372c8 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '../../models/node'; +export declare function circleIconRect(node: Node): void; +export declare function circleTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.rect.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.rect.js new file mode 100644 index 000000000..05e2e573a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.rect.js @@ -0,0 +1,26 @@ +import { Rect } from '../../models/rect' +export function circleIconRect (node) { + let w = node.rect.width / 2 + let h = node.rect.height / 2 + if (w > h) { + w = h + } else { + h = w + } + let top = node.rect.height / 10 + if (top < 10) { + top = 10 + } + node.iconRect = new Rect(node.rect.x + (node.rect.width - w) / 2, node.rect.y + top, w, h) +} +export function circleTextRect (node) { + let bottom = node.rect.height / 20 + if (bottom < 5) { + bottom = 0 + } + node.textRect = new Rect(node.rect.x + node.rect.width / 4, node.rect.y + (node.rect.height * 2) / 3 - bottom, node.rect.width / 2, node.rect.height / 3 - 5) + const w = (node.rect.width * 5) / 7 + const h = (node.rect.height * 5) / 7 + node.fullTextRect = new Rect(node.rect.x + (node.rect.width - w) / 2, node.rect.y + (node.rect.height - h) / 2, w, h) +} +// # sourceMappingURL=circle.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.rect.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.rect.js.map new file mode 100644 index 000000000..28f8b64fe --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/circle.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"circle.rect.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/circle.rect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,MAAM,UAAU,cAAc,C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IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACpC,IAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,CAAC,YAAY,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACxH,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.anchor.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.anchor.d.ts new file mode 100644 index 000000000..47a29cbb9 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function cloudAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.anchor.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.anchor.js new file mode 100644 index 000000000..463fa9c57 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.anchor.js @@ -0,0 +1,9 @@ +import { Point } from '../../models/point' +import { Direction } from '../../models/direction' +export function cloudAnchors (node) { + node.anchors.push(new Point(node.rect.x, node.rect.y + (node.rect.height * 3) / 5, Direction.Left)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y + node.rect.height / 9, Direction.Up)) + node.anchors.push(new Point(node.rect.x + node.rect.width, node.rect.y + (node.rect.height * 3) / 5, Direction.Right)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y + (node.rect.height * 4) / 5, Direction.Bottom)) +} +// # sourceMappingURL=cloud.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.anchor.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.anchor.js.map new file mode 100644 index 000000000..7cba6b8cd --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cloud.anchor.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/cloud.anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,UAAU,YAAY,CAAC,IAAU;IACrC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACpG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IAClH,IAAI,CAAC,OAAO,CAAC,IAAI,CACf,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CACpG,CAAC;IAEF,IAAI,CAAC,OAAO,CAAC,IAAI,CACf,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CACzG,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.d.ts new file mode 100644 index 000000000..6b7b4d184 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function cloud(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.js new file mode 100644 index 000000000..d8c022c41 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.js @@ -0,0 +1,11 @@ +export function cloud (ctx, node) { + ctx.beginPath() + ctx.moveTo(node.rect.x + node.rect.width / 5, node.rect.y + (node.rect.height * 13) / 16) + ctx.bezierCurveTo(node.rect.x - node.rect.width / 15, node.rect.y + (node.rect.height * 13) / 16, node.rect.x - node.rect.width / 15, node.rect.y + (node.rect.height * 7) / 16, node.rect.x + node.rect.width / 5, node.rect.y + (node.rect.height * 7) / 16) + ctx.bezierCurveTo(node.rect.x + node.rect.width / 5, node.rect.y, node.rect.x + (node.rect.width * 4) / 5, node.rect.y, node.rect.x + (node.rect.width * 4) / 5, node.rect.y + (node.rect.height * 7) / 16) + ctx.bezierCurveTo(node.rect.x + (node.rect.width * 16) / 15, node.rect.y + (node.rect.height * 7) / 16, node.rect.x + (node.rect.width * 16) / 15, node.rect.y + (node.rect.height * 13) / 16, node.rect.x + (node.rect.width * 4) / 5, node.rect.y + (node.rect.height * 13) / 16) + ctx.closePath(); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=cloud.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.js.map new file mode 100644 index 000000000..417ee67f4 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cloud.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/cloud.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,KAAK,CAAC,GAA6B,EAAE,IAAU;IAC7D,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;IAC1F,GAAG,CAAC,aAAa,CACf,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,EAAE,EAClC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,EAAE,EAC1C,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,EAAE,EAClC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,EACzC,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AI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,EACvC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,EAAE,CAC3C,CAAC;IACF,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.rect.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.rect.d.ts new file mode 100644 index 000000000..3cedf42ba --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '../../models/node'; +export declare function cloudIconRect(node: Node): void; +export declare function cloudTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.rect.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.rect.js new file mode 100644 index 000000000..964188f3e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.rect.js @@ -0,0 +1,9 @@ +import { Rect } from '../../models/rect' +export function cloudIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function cloudTextRect (node) { + node.textRect = new Rect(node.rect.x + node.rect.width / 4, node.rect.y + node.rect.height / 4, node.rect.width / 2, (node.rect.height * 6) / 11) + node.fullTextRect = node.textRect +} +// # sourceMappingURL=cloud.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.rect.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.rect.js.map new file mode 100644 index 000000000..340c667a6 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cloud.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cloud.rect.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/cloud.rect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,MAAM,UAAU,aAAa,CAAC,IAAU;IACtC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAU;IACtC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CACtB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EACjC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAClC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EACnB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,CAC5B,CAAC;IACF,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.anchor.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.anchor.d.ts new file mode 100644 index 000000000..0dead4cc7 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function cubeAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.anchor.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.anchor.js new file mode 100644 index 000000000..f294e59ac --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.anchor.js @@ -0,0 +1,10 @@ +import { Point } from '../../models/point' +import { Direction } from '../../models/direction' +export function cubeAnchors (node) { + const offset = node.z * Math.sin((45 * Math.PI) / 180) + node.anchors.push(new Point(node.rect.x, node.rect.ey - (node.rect.height - offset) / 2, Direction.Left)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y + offset / 2, Direction.Up)) + node.anchors.push(new Point(node.rect.ex - offset / 2, node.rect.y + node.rect.height / 2, Direction.Right)) + node.anchors.push(new Point(node.rect.x + (node.rect.width - offset) / 2, node.rect.y + node.rect.height, Direction.Bottom)) +} +// # sourceMappingURL=cube.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.anchor.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.anchor.js.map new file mode 100644 index 000000000..405d74b37 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cube.anchor.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/cube.anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,UAAU,WAAW,CAAC,IAAU;IACpC,IAAM,MAAM,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC;IAEvD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1G,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IACxG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7G,IAAI,CAAC,OAAO,CAAC,IAAI,CACf,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAC1G,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.d.ts new file mode 100644 index 000000000..10e8164a9 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function cube(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.js new file mode 100644 index 000000000..45e776815 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.js @@ -0,0 +1,5 @@ +import { Cube } from './cube.model' +export function cube (ctx, node) { + new Cube(node.rect, node.z, node.zRotate, node.fillStyle, node.strokeStyle).render(ctx) +} +// # sourceMappingURL=cube.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.js.map new file mode 100644 index 000000000..fb3bcc786 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cube.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/cube.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,MAAM,UAAU,IAAI,CAAC,GAA6B,EAAE,IAAU;IAC5D,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAC1F,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.model.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.model.d.ts new file mode 100644 index 000000000..b8550685e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.model.d.ts @@ -0,0 +1,14 @@ +import { Point } from '../../models/point'; +import { Rect } from '../../models/rect'; +export declare class Surface { + points: Point[]; + fillStyle: string; + strokeStyle: string; + constructor(pt1: Point, pt2: Point, pt3: Point, pt4: Point, fillStyle?: string, strokeStyle?: string); + render(ctx: CanvasRenderingContext2D): void; +} +export declare class Cube { + surfaces: Surface[]; + constructor(rect: Rect, z: number, zRotate: number, fillStyle?: string, strokeStyle?: string); + render(ctx: CanvasRenderingContext2D): void; +} diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.model.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.model.js new file mode 100644 index 000000000..c0fc8b860 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.model.js @@ -0,0 +1,63 @@ +import { Point } from '../../models/point' +import { pSBC } from '../../utils/math' +const Surface = /** @class */ (function () { + function Surface (pt1, pt2, pt3, pt4, fillStyle, strokeStyle) { + if (fillStyle === void 0) { fillStyle = '' } + if (strokeStyle === void 0) { strokeStyle = '' } + this.points = [] + this.fillStyle = '' + this.strokeStyle = '' + this.points.push(pt1) + this.points.push(pt2) + this.points.push(pt3) + this.points.push(pt4) + this.fillStyle = fillStyle + this.strokeStyle = strokeStyle || fillStyle + } + Surface.prototype.render = function (ctx) { + ctx.save() + ctx.fillStyle = this.fillStyle + ctx.strokeStyle = this.strokeStyle + ctx.beginPath() + for (let i = 0; i < this.points.length; ++i) { + if (i) { + ctx.lineTo(this.points[i].x, this.points[i].y) + } else { + ctx.moveTo(this.points[i].x, this.points[i].y) + } + } + ctx.closePath() + this.fillStyle && ctx.fill() + ctx.stroke() + ctx.restore() + } + return Surface +}()) +export { Surface } +const Cube = /** @class */ (function () { + function Cube (rect, z, zRotate, fillStyle, strokeStyle) { + if (fillStyle === void 0) { fillStyle = '#ddd' } + if (strokeStyle === void 0) { strokeStyle = '#ccc' } + this.surfaces = [] + const offset = z * Math.sin((45 * Math.PI) / 180) + const p1 = new Point(rect.x, rect.y + offset) + const p2 = new Point(rect.ex - offset, rect.y + offset) + const p3 = new Point(rect.ex - offset, rect.ey) + const p4 = new Point(rect.x, rect.ey) + // front + this.surfaces.push(new Surface(p1, p2, p3, p4, fillStyle, strokeStyle)) + // up + this.surfaces.push(new Surface(p1, new Point(rect.x + offset, rect.y), new Point(rect.ex, rect.y), p2, pSBC(0.5, fillStyle), strokeStyle)) + // right + this.surfaces.push(new Surface(p2, new Point(rect.ex, rect.y), new Point(rect.ex, rect.ey - offset), p3, pSBC(0.6, fillStyle), strokeStyle)) + } + Cube.prototype.render = function (ctx) { + for (let _i = 0, _a = this.surfaces; _i < _a.length; _i++) { + const item = _a[_i] + item.render(ctx) + } + } + return Cube +}()) +export { Cube } +// # sourceMappingURL=cube.model.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.model.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.model.js.map new file mode 100644 index 000000000..f5f743f57 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.model.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cube.model.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/cube.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC;IAIE,iBAAY,GAAU,EAAE,GAAU,EAAE,GAAU,EAAE,GAAU,EAAE,SAAc,EAAE,WAAgB;QAAhC,0BAAA,EAAA,cAAc;QAAE,4BAAA,EAAA,gBAAgB;QAH5F,WAAM,GAAY,EAAE,CAAC;QACrB,cAAS,GAAG,EAAE,CAAC;QACf,gBAAW,GAAG,EAAE,CAAC;QAEf,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,WAAW,IAAI,SAAS,CAAC;IAC9C,CAAC;IAED,wBAAM,GAAN,UAAO,GAA6B;QAClC,GAAG,CAAC,IAAI,EAAE,CAAC;QACX,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAC/B,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACnC,GAAG,CAA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--git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.rect.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.rect.d.ts new file mode 100644 index 000000000..889a32c4c --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '../../models/node'; +export declare function cubeIconRect(node: Node): void; +export declare function cubeTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.rect.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.rect.js new file mode 100644 index 000000000..94c3703ef --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.rect.js @@ -0,0 +1,11 @@ +import { Rect } from '../../models/rect' +export function cubeIconRect (node) { + node.fullIconRect = node.fullTextRect + node.iconRect = new Rect(node.fullIconRect.x, node.fullIconRect.y, node.fullIconRect.width, (node.fullIconRect.height * 2) / 3) +} +export function cubeTextRect (node) { + const offset = node.z * Math.sin((45 * Math.PI) / 180) + node.fullTextRect = new Rect(node.rect.x, node.rect.y + offset, node.rect.width - offset, node.rect.height - offset) + node.textRect = new Rect(node.fullTextRect.x + 10, node.fullTextRect.y + (node.fullTextRect.height * 2) / 3, node.fullTextRect.width - 20, node.fullTextRect.height / 3 - 5) +} +// # sourceMappingURL=cube.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.rect.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.rect.js.map new file mode 100644 index 000000000..88d28b6bb --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/cube.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cube.rect.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/cube.rect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,MAAM,UAAU,YAAY,CAAC,IAAU;IACrC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IACtC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CACtB,IAAI,CAAC,YAAY,CAAC,CAAC,EACnB,IAAI,CAAC,YAAY,CAAC,CAAC,EACnB,IAAI,CAAC,YAAY,CAAC,KAAK,EACvB,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CACnC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAU;IACrC,IAAM,MAAM,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC;IACvD,IAAI,CAAC,YAAY,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAErH,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CACtB,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,EAAE,EACxB,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,EACxD,IAAI,CAAC,YAAY,CAAC,KAAK,GAAG,EAAE,EAC5B,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,CACjC,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/diamond.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/diamond.d.ts new file mode 100644 index 000000000..993632119 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/diamond.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function diamond(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/diamond.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/diamond.js new file mode 100644 index 000000000..c756e9acc --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/diamond.js @@ -0,0 +1,11 @@ +export function diamond (ctx, node) { + ctx.beginPath() + ctx.moveTo(node.rect.x + node.rect.width / 2, node.rect.y) + ctx.lineTo(node.rect.x + node.rect.width, node.rect.y + node.rect.height / 2) + ctx.lineTo(node.rect.x + node.rect.width / 2, node.rect.y + node.rect.height) + ctx.lineTo(node.rect.x, node.rect.y + node.rect.height / 2) + ctx.closePath(); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=diamond.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/diamond.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/diamond.js.map new file mode 100644 index 000000000..079786e36 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/diamond.js.map @@ -0,0 +1 @@ +{"version":3,"file":"diamond.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/diamond.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,OAAO,CAAC,GAA6B,EAAE,IAAU;IAC/D,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3D,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC9E,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9E,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC5D,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/diamond.rect.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/diamond.rect.d.ts new file mode 100644 index 000000000..9340e9594 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/diamond.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '../../models/node'; +export declare function diamondIconRect(node: Node): void; +export declare function diamondTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/diamond.rect.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/diamond.rect.js new file mode 100644 index 000000000..b41803197 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/diamond.rect.js @@ -0,0 +1,26 @@ +import { Rect } from '../../models/rect' +export function diamondIconRect (node) { + let w = node.rect.width / 3 + let h = node.rect.height / 3 + if (w > h) { + w = h + } else { + h = w + } + let top = node.rect.width / 5 + if (top < 10) { + top = 10 + } + node.iconRect = new Rect(node.rect.x + (node.rect.width - w) / 2, node.rect.y + top, w, h) +} +export function diamondTextRect (node) { + let bottom = node.rect.height / 10 + if (bottom < 5) { + bottom = 0 + } + node.textRect = new Rect(node.rect.x + node.rect.width / 3, node.rect.y + (node.rect.height * 2) / 3 - bottom, node.rect.width / 3, node.rect.height / 3 - 5) + const w = node.rect.width / 2 + const h = (node.rect.height * 1) / 2 + node.fullTextRect = new Rect(node.rect.x + (node.rect.width - w) / 2, node.rect.y + node.rect.height / 4, w, h) +} +// # sourceMappingURL=diamond.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/diamond.rect.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/diamond.rect.js.map new file mode 100644 index 000000000..ce36f10b9 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/diamond.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"diamond.rect.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/diamond.rect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,MAAM,UAAU,eAAe,CAAC,IAAU;IACxC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IAC5B,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7B,IAAI,CAAC,GAAG,CAAC,EAAE;QACT,CAAC,GAAG,CAAC,CAAC;KACP;SAAM;QACL,CAAC,GAAG,CAAC,CAAC;KACP;IACD,IAAI,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IAC9B,IAAI,GAAG,GAAG,EAAE,EAAE;QACZ,GAAG,GAAG,EAAE,CAAC;KACV;IACD,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC7F,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAU;IACxC,IAAI,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;IACnC,IAAI,MAAM,GAAG,CAAC,EAAE;QACd,MAAM,GAAG,CAAC,CAAC;KACZ;IACD,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CACtB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EACjC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,EACjD,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EACnB,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,CACzB,CAAC;IAEF,IAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IAC9B,IAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,CAAC,YAAY,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAClH,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/file.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/file.d.ts new file mode 100644 index 000000000..75c5b9561 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/file.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function file(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/file.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/file.js new file mode 100644 index 000000000..9c270f73d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/file.js @@ -0,0 +1,16 @@ +export function file (ctx, node) { + ctx.beginPath() + const offsetX = node.rect.width / 6 + ctx.moveTo(node.rect.x, node.rect.y) + ctx.lineTo(node.rect.ex - offsetX, node.rect.y) + ctx.lineTo(node.rect.ex, node.rect.y + offsetX) + ctx.lineTo(node.rect.ex, node.rect.ey) + ctx.lineTo(node.rect.x, node.rect.ey) + ctx.closePath() + ctx.moveTo(node.rect.ex - offsetX, node.rect.y) + ctx.lineTo(node.rect.ex - offsetX, node.rect.y + offsetX) + ctx.lineTo(node.rect.ex, node.rect.y + offsetX); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=file.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/file.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/file.js.map new file mode 100644 index 000000000..febfca653 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/file.js.map @@ -0,0 +1 @@ +{"version":3,"file":"file.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/file.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,IAAI,CAAC,GAA6B,EAAE,IAAU;IAC5D,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,IAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACpC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACrC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChD,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;IAChD,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACvC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtC,GAAG,CAAC,SAAS,EAAE,CAAC;IAEhB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChD,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;IAC1D,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;IAEhD,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/graffiti.anchor.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/graffiti.anchor.d.ts new file mode 100644 index 000000000..9e055eaa5 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/graffiti.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function graffitiAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/graffiti.anchor.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/graffiti.anchor.js new file mode 100644 index 000000000..145beace7 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/graffiti.anchor.js @@ -0,0 +1,17 @@ +import { Point } from '../../models/point' +import { Direction } from '../../models/direction' +export function graffitiAnchors (node) { + if (!node.points || !node.points.length) { + return + } + const pt1 = node.points[0] + const pt2 = node.points[node.points.length - 1] + if (pt1.x < pt2.x) { + node.anchors.push(new Point(pt1.x, pt1.y, Direction.Left)) + node.anchors.push(new Point(pt2.x, pt2.y, Direction.Right)) + } else { + node.anchors.push(new Point(pt1.x, pt1.y, Direction.Right)) + node.anchors.push(new Point(pt2.x, pt2.y, Direction.Left)) + } +} +// # sourceMappingURL=graffiti.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/graffiti.anchor.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/graffiti.anchor.js.map new file mode 100644 index 000000000..9ec11a678 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/graffiti.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"graffiti.anchor.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/graffiti.anchor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,UAAU,eAAe,CAAC,IAAU;IACxC,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;QACvC,OAAO;KACR;IACD,IAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC3B,IAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAChD,IAAI,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE;QACjB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3D,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;KAC7D;SAAM;QACL,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QAC5D,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;KAC5D;AACH,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/graffiti.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/graffiti.d.ts new file mode 100644 index 000000000..194f0a39d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/graffiti.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function graffiti(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/graffiti.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/graffiti.js new file mode 100644 index 000000000..61a1b5a62 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/graffiti.js @@ -0,0 +1,14 @@ +export function graffiti (ctx, node) { + if (!node.points || !node.points[0]) { + return + } + ctx.beginPath() + ctx.moveTo(node.points[0].x, node.points[0].y) + node.points.forEach(function (pt) { + ctx.lineTo(pt.x, pt.y) + }) + node.closePath && !node.doing && ctx.closePath(); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=graffiti.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/graffiti.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/graffiti.js.map new file mode 100644 index 000000000..29cc840fc --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/graffiti.js.map @@ -0,0 +1 @@ +{"version":3,"file":"graffiti.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/graffiti.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,QAAQ,CAAC,GAA6B,EAAE,IAAU;IAChE,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;QACnC,OAAO;KACR;IAED,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAC,EAAS;QAC5B,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IACH,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,SAAS,EAAE,CAAC;IACvD,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.anchor.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.anchor.d.ts new file mode 100644 index 000000000..81d45fa54 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function hexagonAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.anchor.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.anchor.js new file mode 100644 index 000000000..b35eaef9b --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.anchor.js @@ -0,0 +1,21 @@ +import { Point } from '../../models/point' +import { Direction } from '../../models/direction' +export function hexagonAnchors (node) { + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y, Direction.Up)) + node.anchors.push(new Point(node.rect.x + node.rect.width, node.rect.y + node.rect.height / 2, Direction.Right)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y + node.rect.height, Direction.Bottom)) + node.anchors.push(new Point(node.rect.x, node.rect.y + node.rect.height / 2, Direction.Left)) + const ptLT = new Point(node.rect.x + node.rect.width / 10, node.rect.y + node.rect.height / 4, Direction.Left) + ptLT.hidden = true + node.anchors.push(ptLT) + const ptRT = new Point(node.rect.x + node.rect.width / 10, node.rect.y + (node.rect.height * 3) / 4, Direction.Left) + ptRT.hidden = true + node.anchors.push(ptRT) + const ptLB = new Point(node.rect.x + (node.rect.width * 9) / 10, node.rect.y + node.rect.height / 4, Direction.Right) + ptLB.hidden = true + node.anchors.push(ptLB) + const ptRB = new Point(node.rect.x + (node.rect.width * 9) / 10, node.rect.y + (node.rect.height * 3) / 4, Direction.Right) + ptRB.hidden = true + node.anchors.push(ptRB) +} +// # sourceMappingURL=hexagon.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.anchor.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.anchor.js.map new file mode 100644 index 000000000..605aa5830 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"hexagon.anchor.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/hexagon.anchor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,UAAU,cAAc,CAAC,IAAU;IACvC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3F,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IACjH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IAClH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,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AC;IAExB,IAAM,IAAI,GAAG,IAAI,KAAK,CACpB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,EAAE,EACxC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,EACxC,SAAS,CAAC,KAAK,CAChB,CAAC;IACF,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACnB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.d.ts new file mode 100644 index 000000000..ee3b2594c --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function hexagon(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.js new file mode 100644 index 000000000..bbf8f0bf1 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.js @@ -0,0 +1,14 @@ +export function hexagon (ctx, node) { + ctx.beginPath() + const pos = node.rect.width / 5 + ctx.moveTo(node.rect.x + pos, node.rect.y) + ctx.lineTo(node.rect.x + node.rect.width - pos, node.rect.y) + ctx.lineTo(node.rect.x + node.rect.width, node.rect.y + node.rect.height / 2) + ctx.lineTo(node.rect.x + node.rect.width - pos, node.rect.y + node.rect.height) + ctx.lineTo(node.rect.x + pos, node.rect.y + node.rect.height) + ctx.lineTo(node.rect.x, node.rect.y + node.rect.height / 2) + ctx.closePath(); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=hexagon.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.js.map new file mode 100644 index 000000000..4cebc5552 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.js.map @@ -0,0 +1 @@ +{"version":3,"file":"hexagon.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/hexagon.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,OAAO,CAAC,GAA6B,EAAE,IAAU;IAC/D,GAAG,CAAC,SAAS,EAAE,CAAC;IAEhB,IAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IAChC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3C,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7D,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC9E,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChF,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9D,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC5D,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.rect.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.rect.d.ts new file mode 100644 index 000000000..b03e178c4 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '../../models/node'; +export declare function hexagonIconRect(node: Node): void; +export declare function hexagonTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.rect.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.rect.js new file mode 100644 index 000000000..bbcc2968a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.rect.js @@ -0,0 +1,14 @@ +import { Rect } from '../../models/rect' +export function hexagonIconRect (node) { + const w = (node.rect.width * 3) / 5 + const h = (node.rect.height * 3) / 4 + node.iconRect = new Rect(node.rect.x + node.rect.width / 5 + node.paddingLeftNum, node.rect.y + node.paddingTopNum, w - node.paddingLeftNum - node.paddingRightNum, h - node.paddingTopNum - node.paddingBottomNum) + node.fullIconRect = new Rect(node.rect.x + node.rect.width / 5 + node.paddingLeftNum, node.rect.y + node.paddingTopNum, w - node.paddingLeftNum - node.paddingRightNum, node.rect.height - node.paddingTopNum - node.paddingBottomNum) +} +export function hexagonTextRect (node) { + const w = (node.rect.width * 3) / 5 + const h = node.rect.height / 4 + node.textRect = new Rect(node.rect.x + node.rect.width / 5 + node.paddingLeftNum, node.rect.y + node.rect.height - h + node.paddingTopNum, w - node.paddingLeftNum - node.paddingRightNum, h) + node.fullTextRect = new Rect(node.rect.x + node.rect.width / 5 + node.paddingLeftNum, node.rect.y + node.paddingTopNum, w - node.paddingLeftNum - node.paddingRightNum, node.rect.height - node.paddingTopNum - node.paddingBottomNum) +} +// # sourceMappingURL=hexagon.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.rect.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.rect.js.map new file mode 100644 index 000000000..ec045228b --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/hexagon.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"hexagon.rect.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/hexagon.rect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,MAAM,UAAU,eAAe,CAAC,IAAU;IACxC,IAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACpC,IAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CACtB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,cAAc,EACvD,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,aAAa,EAChC,CAAC,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,EAC9C,CAAC,GAAG,IAAI,CA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AG,IAAI,CAAC,eAAe,EAC9C,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAC9D,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/image.anchor.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/image.anchor.d.ts new file mode 100644 index 000000000..379b0c87f --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/image.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function imageAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/image.anchor.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/image.anchor.js new file mode 100644 index 000000000..f5ff7fe78 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/image.anchor.js @@ -0,0 +1,18 @@ +import { Point } from '../../models/point' +import { Direction } from '../../models/direction' +export function imageAnchors (node) { + let textWidth = 0 + let textHeight = 0 + if (node.text) { + if (node.paddingRightNum) { + textWidth = node.paddingRightNum + } else { + textHeight = node.paddingBottomNum || node.lineHeight * node.fontSize * (node.textMaxLine || 1) + } + } + node.anchors.push(new Point(node.rect.x, node.rect.y + (node.rect.height - textHeight) / 2, Direction.Left)) + node.anchors.push(new Point(node.rect.x + (node.rect.width - textWidth) / 2, node.rect.y, Direction.Up)) + node.anchors.push(new Point(node.rect.x + node.rect.width - textWidth, node.rect.y + (node.rect.height - textHeight) / 2, Direction.Right)) + node.anchors.push(new Point(node.rect.x + (node.rect.width - textWidth) / 2, node.rect.y + node.rect.height - textHeight, Direction.Bottom)) +} +// # sourceMappingURL=image.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/image.anchor.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/image.anchor.js.map new file mode 100644 index 000000000..773ccc641 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/image.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"image.anchor.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/image.anchor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,UAAU,YAAY,CAAC,IAAU;IACrC,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,IAAI,IAAI,CAAC,IAAI,EAAE;QACb,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC;SAClC;aAAM;YACL,UAAU,GAAG,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC;SACjG;KACF;IAED,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7G,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IACzG,IAAI,CAAC,OAAO,CAAC,IAAI,CACf,IAAI,KAAK,CACP,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,SAAS,EACzC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,EACjD,SAAS,CAAC,KAAK,CAChB,CACF,CAAC;IACF,IAAI,CAAC,OAAO,CAAC,IAAI,CACf,IAAI,KAAK,CACP,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,EAC/C,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,UAAU,EAC3C,SAAS,CAAC,MAAM,CACjB,CACF,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/image.rect.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/image.rect.d.ts new file mode 100644 index 000000000..18c9e7080 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/image.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '../../models/node'; +export declare function imageIconRect(node: Node): void; +export declare function imageTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/image.rect.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/image.rect.js new file mode 100644 index 000000000..5152ef54a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/image.rect.js @@ -0,0 +1,25 @@ +import { Rect } from '../../models/rect' +export function imageIconRect (node) { + let textWidth = 0 + let textHeight = 0 + if (node.text) { + if (node.paddingRightNum) { + textWidth = node.paddingRightNum + } else { + textHeight = node.paddingBottomNum || node.lineHeight * node.fontSize * (node.textMaxLine || 1) + } + } + node.iconRect = new Rect(node.rect.x, node.rect.y, node.rect.width - textWidth, node.rect.height - textHeight) + node.fullIconRect = node.rect +} +export function imageTextRect (node) { + if (node.paddingRightNum) { + const width = node.paddingRightNum - 5 + node.textRect = new Rect(node.rect.x + node.rect.width - width, node.rect.y, width, node.rect.height - node.textOffsetY * 2) + } else { + const height = node.paddingBottomNum || node.lineHeight * node.fontSize * (node.textMaxLine || 1) + node.textRect = new Rect(node.rect.x, node.rect.y + node.rect.height - height, node.rect.width - node.textOffsetX * 2, height) + } + node.fullTextRect = node.rect +} +// # sourceMappingURL=image.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/image.rect.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/image.rect.js.map new file mode 100644 index 000000000..561b8e3f9 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/image.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"image.rect.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/image.rect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,MAAM,UAAU,aAAa,CAAC,IAAU;IACtC,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,IAAI,IAAI,CAAC,IAAI,EAAE;QACb,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC;SAClC;aAAM;YACL,UAAU,GAAG,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC;SACjG;KACF;IAED,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC;IAC/G,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAU;IACtC,IAAI,IAAI,CAAC,eAAe,EAAE;QACxB,IAAM,KAAK,GAAG,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACvC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CACtB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,EACrC,IAAI,CAAC,IAAI,CAAC,CAAC,EACX,KAAK,EACL,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,GAAG,CAAC,CACxC,CAAC;KACH;SAAM;QACL,IAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC;QAClG,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CACtB,IAAI,CAAC,IAAI,CAAC,CAAC,EACX,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,EACvC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,WAAW,GAAG,CAAC,EACtC,MAAM,CACP,CAAC;KACH;IAED,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC;AAChC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.anchor.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.anchor.d.ts new file mode 100644 index 000000000..1d6046e40 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function lineAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.anchor.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.anchor.js new file mode 100644 index 000000000..be35e466a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.anchor.js @@ -0,0 +1,14 @@ +import { Point } from '../../models/point' +import { Direction } from '../../models/direction' +export function lineAnchors (node) { + const y = node.rect.y + node.rect.height / 2 + node.anchors.push(new Point(node.rect.x, y, Direction.Left)) + node.anchors.push(new Point(node.rect.x + node.rect.width, y, Direction.Right)) + const scale = topology.data.scale || 1 // 取全局的 scale 属性 + for (let i = node.rect.x + 5 * scale; i < node.rect.ex; i += 5 * scale) { + const pt = new Point(i, y, Direction.Bottom) + pt.hidden = true + node.anchors.push(pt) + } +} +// # sourceMappingURL=line.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.anchor.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.anchor.js.map new file mode 100644 index 000000000..60ad28a2e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"line.anchor.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/line.anchor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAKnD,MAAM,UAAU,WAAW,CAAC,IAAU;IACpC,IAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7D,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IAChF,IAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,gBAAgB;IACxD,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,KAAK,EAAE;QACtE,IAAM,EAAE,GAAG,IAAI,KAAK,CAClB,CAAC,EACD,CAAC,EACD,SAAS,CAAC,MAAM,CACjB,CAAC;QACF,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KACvB;AACH,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.d.ts new file mode 100644 index 000000000..41c351f92 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function line(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.js new file mode 100644 index 000000000..c4f308d85 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.js @@ -0,0 +1,8 @@ +export function line (ctx, node) { + ctx.beginPath() + const y = node.rect.y + node.rect.height / 2 + ctx.moveTo(node.rect.x, y) + ctx.lineTo(node.rect.x + node.rect.width, y) + ctx.stroke() +} +// # sourceMappingURL=line.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.js.map new file mode 100644 index 000000000..bce3e6c1b --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.js.map @@ -0,0 +1 @@ +{"version":3,"file":"line.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/line.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,IAAI,CAAC,GAA6B,EAAE,IAAU;IAC5D,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,IAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7C,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3B,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAC7C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.rect.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.rect.d.ts new file mode 100644 index 000000000..2e9c5ee68 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '../../models/node'; +export declare function lineIconRect(node: Node): void; +export declare function lineTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.rect.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.rect.js new file mode 100644 index 000000000..38b011a53 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.rect.js @@ -0,0 +1,9 @@ +import { Rect } from '../../models/rect' +export function lineIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function lineTextRect (node) { + node.fullTextRect = new Rect(node.rect.x + 10, node.rect.y + node.rect.height / 2 - 20, node.rect.width - 20, 20) + node.textRect = node.fullTextRect +} +// # sourceMappingURL=line.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.rect.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.rect.js.map new file mode 100644 index 000000000..edb84c852 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/line.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"line.rect.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/line.rect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,MAAM,UAAU,YAAY,CAAC,IAAU;IACrC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAU;IACrC,IAAI,CAAC,YAAY,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;IAClH,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/lines.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/lines.d.ts new file mode 100644 index 000000000..4adcfacc5 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/lines.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function lines(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/lines.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/lines.js new file mode 100644 index 000000000..e7b01dca8 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/lines.js @@ -0,0 +1,25 @@ +export function lines (ctx, node) { + if (!node.points || !node.points[1]) { + return + } + ctx.beginPath() + ctx.moveTo(node.points[0].x, node.points[0].y) + for (let i = 1; i < node.points.length;) { + // curve 控制点 + if (node.points[i].data) { + if (node.points[i + 2]) { + ctx.bezierCurveTo(node.points[i].x, node.points[i].y, node.points[i + 1].x, node.points[i + 1].y, node.points[i + 2].x, node.points[i + 2].y) + i += 2 + } else { + break + } + } else { + ctx.lineTo(node.points[i].x, node.points[i].y) + ++i + } + } + node.closePath && !node.doing && ctx.closePath(); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=lines.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/lines.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/lines.js.map new file mode 100644 index 000000000..c6d81cf23 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/lines.js.map @@ -0,0 +1 @@ +{"version":3,"file":"lines.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/lines.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,KAAK,CAAC,GAA6B,EAAE,IAAU;IAC7D,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;QACnC,OAAO;KACR;IAED,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG;QACvC,YAAY;QACZ,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;YACvB,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE;gBACtB,GAAG,CAAC,aAAa,CACf,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAChB,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAChB,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EACpB,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EACpB,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EACpB,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CACrB,CAAC;gBACF,CAAC,IAAI,CAAC,CAAC;aACR;iBAAM;gBACL,MAAM;aACP;SACF;aAAM;YACL,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC/C,EAAE,CAAC,CAAC;SACL;KACF;IACD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,SAAS,EAAE,CAAC;IACvD,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.anchor.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.anchor.d.ts new file mode 100644 index 000000000..4477cbcac --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function messageAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.anchor.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.anchor.js new file mode 100644 index 000000000..32054811b --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.anchor.js @@ -0,0 +1,9 @@ +import { Point } from '../../models/point' +import { Direction } from '../../models/direction' +export function messageAnchors (node) { + node.anchors.push(new Point(node.rect.x, node.rect.y + (node.rect.height * 3) / 8, Direction.Left)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y, Direction.Up)) + node.anchors.push(new Point(node.rect.x + node.rect.width, node.rect.y + (node.rect.height * 3) / 8, Direction.Right)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 4, node.rect.ey, Direction.Bottom)) +} +// # sourceMappingURL=message.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.anchor.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.anchor.js.map new file mode 100644 index 000000000..315eb6b06 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"message.anchor.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/message.anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,UAAU,cAAc,CAAC,IAAU;IACvC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACpG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3F,IAAI,CAAC,OAAO,CAAC,IAAI,CACf,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CACpG,CAAC;IAEF,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;AAClG,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.d.ts new file mode 100644 index 000000000..fa2418ff2 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function message(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.js new file mode 100644 index 000000000..9cd76032f --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.js @@ -0,0 +1,14 @@ +export function message (ctx, node) { + ctx.beginPath() + ctx.moveTo(node.rect.x, node.rect.y) + ctx.lineTo(node.rect.x + node.rect.width, node.rect.y) + ctx.lineTo(node.rect.x + node.rect.width, node.rect.y + (node.rect.height * 3) / 4) + ctx.lineTo(node.rect.x + (node.rect.width * 8) / 16, node.rect.y + (node.rect.height * 3) / 4) + ctx.lineTo(node.rect.x + node.rect.width / 4, node.rect.ey) + ctx.lineTo(node.rect.x + (node.rect.width * 5) / 16, node.rect.y + (node.rect.height * 3) / 4) + ctx.lineTo(node.rect.x, node.rect.y + (node.rect.height * 3) / 4) + ctx.closePath(); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=message.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.js.map new file mode 100644 index 000000000..dfab535c3 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.js.map @@ -0,0 +1 @@ +{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/message.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,OAAO,CAAC,GAA6B,EAAE,IAAU;IAC/D,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACrC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACvD,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACpF,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/F,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5D,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/F,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAClE,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.rect.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.rect.d.ts new file mode 100644 index 000000000..e4035ad68 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '../../models/node'; +export declare function messageIconRect(node: Node): void; +export declare function messageTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.rect.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.rect.js new file mode 100644 index 000000000..4843e5abd --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.rect.js @@ -0,0 +1,10 @@ +import { Rect } from '../../models/rect' +export function messageIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) + node.fullIconRect = node.iconRect +} +export function messageTextRect (node) { + node.textRect = new Rect(node.rect.x + node.paddingLeftNum, node.rect.y + node.paddingTopNum, node.rect.width - node.paddingLeftNum - node.paddingRightNum, (node.rect.height * 3) / 4 - node.paddingTopNum - node.paddingBottomNum) + node.fullTextRect = node.textRect +} +// # sourceMappingURL=message.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.rect.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.rect.js.map new file mode 100644 index 000000000..7eaf3356e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/message.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"message.rect.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/message.rect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,MAAM,UAAU,eAAe,CAAC,IAAU;IACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACrC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAU;IACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CACtB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,cAAc,EACjC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,aAAa,EAChC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,EAC5D,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,gBAAgB,CACxE,CAAC;IACF,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindLine.anchor.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindLine.anchor.d.ts new file mode 100644 index 000000000..5ff5136ff --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindLine.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function mindLineAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindLine.anchor.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindLine.anchor.js new file mode 100644 index 000000000..b627bb9b7 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindLine.anchor.js @@ -0,0 +1,6 @@ +import { Point } from '../../models/point' +export function mindLineAnchors (node) { + node.anchors.push(new Point(node.rect.x, node.rect.y + node.rect.height, 4)) + node.anchors.push(new Point(node.rect.x + node.rect.width, node.rect.y + node.rect.height, 2)) +} +// # sourceMappingURL=mindLine.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindLine.anchor.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindLine.anchor.js.map new file mode 100644 index 000000000..29b2945ad --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindLine.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mindLine.anchor.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/mindLine.anchor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,MAAM,UAAU,eAAe,CAAC,IAAU;IACxC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;IAE7E,IAAI,CAAC,OAAO,CAAC,IAAI,CACf,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAC5E,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindLine.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindLine.d.ts new file mode 100644 index 000000000..aff5ac11c --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindLine.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function mindLine(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindLine.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindLine.js new file mode 100644 index 000000000..dd8a7a0ab --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindLine.js @@ -0,0 +1,8 @@ +export function mindLine (ctx, node) { + ctx.beginPath() + ctx.moveTo(node.rect.x, node.rect.y + node.rect.height) + ctx.lineTo(node.rect.x + node.rect.width, node.rect.y + node.rect.height) + ctx.closePath() + ctx.stroke() +} +// # sourceMappingURL=mindLine.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindLine.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindLine.js.map new file mode 100644 index 000000000..941ba5511 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindLine.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mindLine.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/mindLine.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,QAAQ,CAAC,GAA6B,EAAE,IAAU;IAChE,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxD,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1E,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindNode.anchor.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindNode.anchor.d.ts new file mode 100644 index 000000000..d5b8c63d5 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindNode.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function mindNodeAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindNode.anchor.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindNode.anchor.js new file mode 100644 index 000000000..a45b7c4e6 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindNode.anchor.js @@ -0,0 +1,113 @@ +import { Point } from '../../models/point' +import { Direction } from '../../models/direction' +export function mindNodeAnchors (node) { + const r = borderRadius(node) + // 上四 + const topN = 5 // 上方节点个数,控制位置,实际节点数依然是 4 个 + for (var i = 0; i < topN; i++) { + if (i === 2) { + continue + } + var x = node.rect.x + (node.rect.width * (i + 1)) / (topN + 1) + var y = node.rect.y + if (x < node.rect.x + r) { + // 在左侧圆角 + y = getYByCircle(node.rect.x + r, y + r, x, r, -1) + } else if (x > node.rect.x + node.rect.width - r) { + // 在右侧圆角 + y = getYByCircle(node.rect.x + node.rect.width - r, y + r, x, r, -1) + } + node.anchors.push(new Point(x, y, Direction.Up)) + } + // 右三 + const rightN = 3 // 右侧节点数 + for (var i = 0; i < rightN; i++) { + var y = node.rect.y + (node.rect.height * (i + 1)) / (rightN + 1) + var x = node.rect.x + node.rect.width + if (y < node.rect.y + r) { + // 在上侧圆角以内 + x = getXByCircle(x - r, node.rect.y + r, y, r) + } else if (y > node.rect.y + node.rect.height - r) { + // 下侧圆角 + x = getXByCircle(x - r, node.rect.y + node.rect.height - r, y, r) + } + node.anchors.push(new Point(x, y, Direction.Right)) + } + // 下四 + const bottomN = 5 // 下侧节点数 + for (var i = 0; i < bottomN; i++) { + if (i === 2) { + continue + } + var x = node.rect.x + (node.rect.width * (i + 1)) / (bottomN + 1) + var y = node.rect.y + node.rect.height + if (x < node.rect.x + r) { + // 在左侧圆角 + y = getYByCircle(node.rect.x + r, y - r, x, r) + } else if (x > node.rect.x + node.rect.width - r) { + // 在右侧圆角 + y = getYByCircle(node.rect.x + node.rect.width - r, y - r, x, r) + } + node.anchors.push(new Point(x, y, Direction.Bottom)) + } + // 左三 + const leftN = 3 // 左侧节点数 + for (var i = 0; i < leftN; i++) { + var y = node.rect.y + (node.rect.height * (i + 1)) / (leftN + 1) + var x = node.rect.x + if (y < node.rect.y + r) { + // 在上侧圆角以内 + x = getXByCircle(x + r, node.rect.y + r, y, r, -1) + } else if (y > node.rect.y + node.rect.height - r) { + // 下侧圆角 + x = getXByCircle(x + r, node.rect.y + node.rect.height - r, y, r, -1) + } + node.anchors.push(new Point(x, y, Direction.Left)) + } +} +/** + * 得到元素实际计算半径 + * @param node 元素 + * @returns 元素实际半径 + */ +function borderRadius (node) { + let wr = node.borderRadius + let hr = node.borderRadius + if (node.borderRadius < 1) { + wr = node.rect.width * node.borderRadius + hr = node.rect.height * node.borderRadius + } + let r = wr < hr ? wr : hr + if (node.rect.width < 2 * r) { + r = node.rect.width / 2 + } + if (node.rect.height < 2 * r) { + r = node.rect.height / 2 + } + return r +} +/** + * 获取圆的 x 坐标 + * @param ox 圆心x + * @param oy 圆心y + * @param y y + * @param r 半径 + * @param sqrt 点可能在左侧,左侧填-1,右侧1(默认值) + */ +function getXByCircle (ox, oy, y, r, sqrt) { + if (sqrt === void 0) { sqrt = 1 } + return sqrt * Math.sqrt(Math.pow(r, 2) - Math.pow((y - oy), 2)) + ox +} +/** + * 获取圆的 y 坐标 + * @param ox 圆心x + * @param oy 圆心y + * @param y y + * @param r 半径 + * @param sqrt 点可以在上侧,也可能在下侧,上侧-1,下侧1(默认) + */ +function getYByCircle (ox, oy, x, r, sqrt) { + if (sqrt === void 0) { sqrt = 1 } + return sqrt * Math.sqrt(Math.pow(r, 2) - Math.pow((x - ox), 2)) + oy +} +// # sourceMappingURL=mindNode.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindNode.anchor.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindNode.anchor.js.map new file mode 100644 index 000000000..f2f21c1e5 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/mindNode.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mindNode.anchor.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/mindNode.anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,SA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E,CAAC;IAC1B,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,EAAE;QAC3B,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;KACzB;IACD,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,EAAE;QAC5B,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;KAC1B;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,YAAY,CACnB,EAAU,EACV,EAAU,EACV,CAAS,EACT,CAAS,EACT,IAAgB;IAAhB,qBAAA,EAAA,QAAgB;IAEhB,OAAO,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,SAAA,CAAC,EAAI,CAAC,CAAA,GAAG,SAAA,CAAC,CAAC,GAAG,EAAE,CAAC,EAAI,CAAC,CAAA,CAAC,GAAG,EAAE,CAAC;AACvD,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,YAAY,CACnB,EAAU,EACV,EAAU,EACV,CAAS,EACT,CAAS,EACT,IAAgB;IAAhB,qBAAA,EAAA,QAAgB;IAEhB,OAAO,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,SAAA,CAAC,EAAI,CAAC,CAAA,GAAG,SAAA,CAAC,CAAC,GAAG,EAAE,CAAC,EAAI,CAAC,CAAA,CAAC,GAAG,EAAE,CAAC;AACvD,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.anchor.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.anchor.d.ts new file mode 100644 index 000000000..5603dfc64 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function pentagonAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.anchor.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.anchor.js new file mode 100644 index 000000000..71fe63a7a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.anchor.js @@ -0,0 +1,10 @@ +import { Point } from '../../models/point' +import { Direction } from '../../models/direction' +export function pentagonAnchors (node) { + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y, Direction.Up)) + node.anchors.push(new Point(node.rect.x + node.rect.width, node.rect.y + (node.rect.height * 2) / 5, Direction.Right)) + node.anchors.push(new Point(node.rect.x + (node.rect.width * 4) / 5, node.rect.y + node.rect.height, Direction.Bottom)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 5, node.rect.y + node.rect.height, Direction.Bottom)) + node.anchors.push(new Point(node.rect.x, node.rect.y + (node.rect.height * 2) / 5, Direction.Left)) +} +// # sourceMappingURL=pentagon.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.anchor.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.anchor.js.map new file mode 100644 index 000000000..b3de01e87 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pentagon.anchor.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/pentagon.anchor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,UAAU,eAAe,CAAC,IAAU;IACxC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3F,IAAI,CAAC,OAAO,CAAC,IAAI,CACf,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CACpG,CAAC;IACF,IAAI,CAAC,OAAO,CAAC,IAAI,CACf,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CACrG,CAAC;IACF,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IAClH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;AACtG,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.d.ts new file mode 100644 index 000000000..31fab78eb --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function pentagon(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.js new file mode 100644 index 000000000..821d0dfaf --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.js @@ -0,0 +1,12 @@ +export function pentagon (ctx, node) { + ctx.beginPath() + ctx.moveTo(node.rect.x + node.rect.width / 2, node.rect.y) + ctx.lineTo(node.rect.x + node.rect.width, node.rect.y + (node.rect.height * 2) / 5) + ctx.lineTo(node.rect.x + (node.rect.width * 4) / 5, node.rect.y + node.rect.height) + ctx.lineTo(node.rect.x + node.rect.width / 5, node.rect.y + node.rect.height) + ctx.lineTo(node.rect.x, node.rect.y + (node.rect.height * 2) / 5) + ctx.closePath(); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=pentagon.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.js.map new file mode 100644 index 000000000..3c56b6c30 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pentagon.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/pentagon.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,QAAQ,CAAC,GAA6B,EAAE,IAAU;IAChE,GAAG,CAAC,SAAS,EAAE,CAAC;IAEhB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3D,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACpF,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACpF,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9E,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAClE,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.rect.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.rect.d.ts new file mode 100644 index 000000000..e7d93ca06 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '../../models/node'; +export declare function pentagonIconRect(node: Node): void; +export declare function pentagonTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.rect.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.rect.js new file mode 100644 index 000000000..c7095b54e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.rect.js @@ -0,0 +1,22 @@ +import { Rect } from '../../models/rect' +export function pentagonIconRect (node) { + let w = node.rect.width / 2 + let h = node.rect.height / 2 + if (w > h) { + w = h + } else { + h = w + } + let top = node.rect.height / 7 + if (top < 10) { + top = 10 + } + node.iconRect = new Rect(node.rect.x + (node.rect.width - w) / 2, node.rect.y + top, w, h) +} +export function pentagonTextRect (node) { + node.textRect = new Rect(node.rect.x + node.rect.width / 5, node.rect.y + (node.rect.height * 5) / 7, (node.rect.width * 3) / 5, node.rect.height / 4) + const w = (node.rect.width * 3) / 5 + const h = (node.rect.height * 3) / 5 + node.fullTextRect = new Rect(node.rect.x + (node.rect.width - w) / 2, node.rect.y + node.rect.height / 4, w, h) +} +// # sourceMappingURL=pentagon.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.rect.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.rect.js.map new file mode 100644 index 000000000..868e62124 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagon.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pentagon.rect.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/pentagon.rect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,MAAM,UAAU,gBAAgB,CAAC,IAAU;IACzC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IAC5B,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7B,IAAI,CAAC,GAAG,CAAC,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AAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAClH,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.anchor.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.anchor.d.ts new file mode 100644 index 000000000..d1464b1e1 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function pentagramAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.anchor.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.anchor.js new file mode 100644 index 000000000..ccae46c9b --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.anchor.js @@ -0,0 +1,10 @@ +import { Point } from '../../models/point' +import { Direction } from '../../models/direction' +export function pentagramAnchors (node) { + node.anchors.push(new Point((Math.cos((18 / 180) * Math.PI) * node.rect.width) / 2 + node.rect.x + node.rect.width / 2, (-Math.sin((18 / 180) * Math.PI) * node.rect.width) / 2 + node.rect.y + node.rect.height / 2, Direction.Right)) + node.anchors.push(new Point((Math.cos(((18 + 72) / 180) * Math.PI) * node.rect.width) / 2 + node.rect.x + node.rect.width / 2, (-Math.sin(((18 + 72) / 180) * Math.PI) * node.rect.width) / 2 + node.rect.y + node.rect.height / 2, Direction.Up)) + node.anchors.push(new Point((Math.cos(((18 + 72 * 2) / 180) * Math.PI) * node.rect.width) / 2 + node.rect.x + node.rect.width / 2, (-Math.sin(((18 + 72 * 2) / 180) * Math.PI) * node.rect.width) / 2 + node.rect.y + node.rect.height / 2, Direction.Left)) + node.anchors.push(new Point((Math.cos(((18 + 72 * 3) / 180) * Math.PI) * node.rect.width) / 2 + node.rect.x + node.rect.width / 2, (-Math.sin(((18 + 72 * 3) / 180) * Math.PI) * node.rect.width) / 2 + node.rect.y + node.rect.height / 2, Direction.Bottom)) + node.anchors.push(new Point((Math.cos(((18 + 72 * 4) / 180) * Math.PI) * node.rect.width) / 2 + node.rect.x + node.rect.width / 2, (-Math.sin(((18 + 72 * 4) / 180) * Math.PI) * node.rect.width) / 2 + node.rect.y + node.rect.height / 2, Direction.Bottom)) +} +// # sourceMappingURL=pentagram.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.anchor.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.anchor.js.map new file mode 100644 index 000000000..1f3c58dec --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pentagram.anchor.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/pentagram.anchor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,UAAU,gBAAgB,CAAC,IAAU;IACzC,IAAI,CAAC,OAAO,CAAC,IAAI,CACf,IAAI,KAAK,CACP,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAC1F,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM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,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EACvG,SAAS,CAAC,MAAM,CACjB,CACF,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.d.ts new file mode 100644 index 000000000..d4d57feec --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function pentagram(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.js new file mode 100644 index 000000000..92ba1285e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.js @@ -0,0 +1,11 @@ +export function pentagram (ctx, node) { + ctx.beginPath() + for (let i = 0; i < 5; ++i) { + ctx.lineTo((Math.cos(((18 + 72 * i) / 180) * Math.PI) * node.rect.width) / 2 + node.rect.x + node.rect.width / 2, (-Math.sin(((18 + 72 * i) / 180) * Math.PI) * node.rect.width) / 2 + node.rect.y + node.rect.height / 2) + ctx.lineTo((Math.cos(((54 + 72 * i) / 180) * Math.PI) * node.rect.width) / 4 + node.rect.x + node.rect.width / 2, (-Math.sin(((54 + 72 * i) / 180) * Math.PI) * node.rect.width) / 4 + node.rect.y + node.rect.height / 2) + } + ctx.closePath(); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=pentagram.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.js.map new file mode 100644 index 000000000..1cd5c02ec --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.js.map @@ -0,0 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,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CACxG,CAAC;KACH;IACD,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.rect.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.rect.d.ts new file mode 100644 index 000000000..302804c1f --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '../../models/node'; +export declare function pentagramIconRect(node: Node): void; +export declare function pentagramTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.rect.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.rect.js new file mode 100644 index 000000000..19cf6717f --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.rect.js @@ -0,0 +1,11 @@ +import { Rect } from '../../models/rect' +export function pentagramIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function pentagramTextRect (node) { + const w = (node.rect.width * 2) / 5 + const h = (node.rect.height * 2) / 5 + node.fullTextRect = new Rect(node.rect.x + (node.rect.width - w) / 2, node.rect.y + (node.rect.height - h) / 2, w, h) + node.textRect = node.fullTextRect +} +// # sourceMappingURL=pentagram.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.rect.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.rect.js.map new file mode 100644 index 000000000..36294dc6b --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/pentagram.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pentagram.rect.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/pentagram.rect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,MAAM,UAAU,iBAAiB,CAAC,IAAU;IAC1C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAU;IAC1C,IAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACpC,IAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,CAAC,YAAY,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACtH,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/people.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/people.d.ts new file mode 100644 index 000000000..0d0196b9d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/people.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function people(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/people.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/people.js new file mode 100644 index 000000000..3bd20d427 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/people.js @@ -0,0 +1,17 @@ +export function people (ctx, node) { + ctx.beginPath() + const r = node.rect.width / 4 + const middle = node.rect.x + node.rect.width / 2 + ctx.arc(middle, node.rect.y + r, r, 0, Math.PI * 2) + ctx.moveTo(node.rect.x, node.rect.y + r * 3) + ctx.lineTo(node.rect.ex, node.rect.y + r * 3) + ctx.moveTo(middle, node.rect.y + r * 2) + ctx.lineTo(middle, node.rect.y + r * 4) + ctx.moveTo(middle, node.rect.y + r * 4) + ctx.lineTo(node.rect.x, node.rect.ey) + ctx.moveTo(middle, node.rect.y + r * 4) + ctx.lineTo(node.rect.ex, node.rect.ey); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=people.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/people.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/people.js.map new file mode 100644 index 000000000..51141d2ef --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/people.js.map @@ -0,0 +1 @@ +{"version":3,"file":"people.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/people.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,MAAM,CAAC,GAA6B,EAAE,IAAU;IAC9D,GAAG,CAAC,SAAS,EAAE,CAAC;IAEhB,IAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IAC9B,IAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACjD,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI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ha-fronted/src/components/common/@topology/core/src/middles/nodes/people.rect.d.ts new file mode 100644 index 000000000..52e527898 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/people.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '../../models/node'; +export declare function peopleIconRect(node: Node): void; +export declare function peopleTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/people.rect.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/people.rect.js new file mode 100644 index 000000000..9c64d5d23 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/people.rect.js @@ -0,0 +1,9 @@ +import { Rect } from '../../models/rect' +export function peopleIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function peopleTextRect (node) { + node.textRect = undefined + node.fullTextRect = node.textRect +} +// # sourceMappingURL=people.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/people.rect.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/people.rect.js.map new file mode 100644 index 000000000..1793412f1 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/people.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"people.rect.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/people.rect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,MAAM,UAAU,cAAc,CAAC,IAAU;IACvC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAU;IACvC,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC1B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/rectangle.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/rectangle.d.ts new file mode 100644 index 000000000..62b1fe9f8 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/rectangle.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function rectangle(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/rectangle.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/rectangle.js new file mode 100644 index 000000000..efc8c7b12 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/rectangle.js @@ -0,0 +1,25 @@ +export function rectangle (ctx, node) { + let wr = node.borderRadius + let hr = node.borderRadius + if (node.borderRadius < 1) { + wr = node.rect.width * node.borderRadius + hr = node.rect.height * node.borderRadius + } + let r = wr < hr ? wr : hr + if (node.rect.width < 2 * r) { + r = node.rect.width / 2 + } + if (node.rect.height < 2 * r) { + r = node.rect.height / 2 + } + ctx.beginPath() + ctx.moveTo(node.rect.x + r, node.rect.y) + ctx.arcTo(node.rect.x + node.rect.width, node.rect.y, node.rect.x + node.rect.width, node.rect.y + node.rect.height, r) + ctx.arcTo(node.rect.x + node.rect.width, node.rect.y + node.rect.height, node.rect.x, node.rect.y + node.rect.height, r) + ctx.arcTo(node.rect.x, node.rect.y + node.rect.height, node.rect.x, node.rect.y, r) + ctx.arcTo(node.rect.x, node.rect.y, node.rect.x + node.rect.width, node.rect.y, r) + ctx.closePath(); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=rectangle.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/rectangle.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/rectangle.js.map new file mode 100644 index 000000000..706f8bf90 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/rectangle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rectangle.js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AAC,MAAM,EAC9B,CAAC,CACF,CAAC;IACF,GAAG,CAAC,KAAK,CACP,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAC7B,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAC9B,IAAI,CAAC,IAAI,CAAC,CAAC,EACX,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAC9B,CAAC,CACF,CAAC;IACF,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpF,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACnF,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/rectangle.rect.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/rectangle.rect.d.ts new file mode 100644 index 000000000..b8ba83045 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/rectangle.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '../../models/node'; +export declare function rectangleIconRect(node: Node): void; +export declare function rectangleTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/rectangle.rect.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/rectangle.rect.js new file mode 100644 index 000000000..2d96c2ab5 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/rectangle.rect.js @@ -0,0 +1,11 @@ +import { Rect } from '../../models/rect' +export function rectangleIconRect (node) { + node.iconRect = new Rect(node.rect.x + node.paddingLeftNum, node.rect.y + node.paddingTopNum, node.rect.height - node.paddingTopNum - node.paddingBottomNum, node.rect.height - node.paddingTopNum - node.paddingBottomNum) + node.fullIconRect = new Rect(node.rect.x + node.paddingLeftNum, node.rect.y + node.paddingTopNum, node.rect.width - node.paddingLeftNum - node.paddingRightNum, node.rect.height - node.paddingTopNum - node.paddingBottomNum) +} +export function rectangleTextRect (node) { + const height = node.rect.height - node.paddingTopNum - node.paddingBottomNum + node.textRect = new Rect(node.rect.x + node.paddingLeftNum + height, node.rect.y + node.paddingTopNum, node.rect.width - node.paddingLeftNum - node.paddingRightNum - height, height) + node.fullTextRect = new Rect(node.rect.x + node.paddingLeftNum, node.rect.y + node.paddingTopNum, node.rect.width - node.paddingLeftNum - node.paddingRightNum, height) +} +// # sourceMappingURL=rectangle.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/rectangle.rect.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/rectangle.rect.js.map new file mode 100644 index 000000000..cc438fb7d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/rectangle.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rectangle.rect.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/rectangle.rect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,MAAM,UAAU,iBAAiB,CAAC,IAAU;IAC1C,IAAI,CAAC,QAAQ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Ac,EACjC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,aAAa,EAChC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,EAC5D,MAAM,CACP,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/text.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/text.d.ts new file mode 100644 index 000000000..633724a92 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/text.d.ts @@ -0,0 +1,12 @@ +import { Node } from '../../models/node'; +import { Pen } from '../../models/pen'; +export declare function getWords(txt: string): any[]; +export declare function getWrapLines(ctx: CanvasRenderingContext2D, words: string[], maxWidth: number, fontSize: number): any[]; +export declare function getLines(ctx: CanvasRenderingContext2D, pen: Pen): any[]; +export declare function calcTextRect(ctx: CanvasRenderingContext2D, pen: Pen): { + width: number; + height: number; +}; +export declare function fillText(ctx: CanvasRenderingContext2D, lines: string[], x: number, y: number, width: number, height: number, lineHeight: number, maxLineLen?: number, bk?: string): void; +export declare function text(ctx: CanvasRenderingContext2D, node: Pen): void; +export declare function iconfont(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/text.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/text.js new file mode 100644 index 000000000..9ba5ac339 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/text.js @@ -0,0 +1,263 @@ +import { Store } from 'le5le-store' +// getWords: Get the word array from text. A single Chinese character is a word. +export function getWords (txt) { + const words = [] + let word = '' + if (!txt) { + txt = '' + } + for (let i = 0; i < txt.length; ++i) { + const ch = txt.charCodeAt(i) + if (ch < 33 || ch > 126) { + if (word) { + words.push(word) + word = '' + } + words.push(txt[i]) + continue + } else { + word += txt[i] + } + } + if (word) { + words.push(word) + } + return words +} +// getWrapLines: Get the lines by wrap. +// words - the word array of text, to avoid spliting a word. +// maxWidth - the max width of the rect. +export function getWrapLines (ctx, words, maxWidth, fontSize) { + const lines = [] + let currentLine = words[0] || '' + for (let i = 1; i < words.length; ++i) { + const word = words[i] || '' + const text_1 = currentLine + word + const chinese = text_1.match(/[\u4e00-\u9fa5]/g) || '' + const chineseLen = chinese.length + if ((text_1.length - chineseLen) * fontSize * 0.5 + chineseLen * fontSize < maxWidth) { + currentLine += word + } else { + lines.push(currentLine) + currentLine = word + } + } + lines.push(currentLine) + return lines +} +export function getLines (ctx, pen) { + if (pen.text && !pen.text.split) { + pen.text += '' + } + let lines = [] + switch (pen.whiteSpace) { + case 'nowrap': + lines.push(pen.text) + break + case 'pre-line': + lines = pen.text.split(/[\n]/g) + break + default: + var textRect = pen.getTextRect() + var paragraphs = pen.text.split(/[\n]/g) + for (let i = 0; i < paragraphs.length; ++i) { + const l = getWrapLines(ctx, getWords(paragraphs[i]), textRect.width, pen.fontSize) + lines.push.apply(lines, l) + } + break + } + return lines +} +export function calcTextRect (ctx, pen) { + const lines = getLines(ctx, pen) + let width = 0 + for (let _i = 0, lines_1 = lines; _i < lines_1.length; _i++) { + const item = lines_1[_i] + ctx.font = (pen.fontStyle || 'normal') + ' normal ' + (pen.fontWeight || 'normal') + ' ' + pen.fontSize + 'px/' + pen.lineHeight + ' ' + pen.fontFamily + const r = ctx.measureText(item) + const w = r.width + if (w > width) { + width = w + } + } + return { + width: width, + height: lines.length * pen.fontSize * pen.lineHeight + } +} +function textBk (ctx, str, x, y, height, color) { + if (!str || !color) { + return + } + const w = ctx.measureText(str).width + ctx.save() + ctx.fillStyle = color + let l = x - w / 2 + let t = y - height / 2 + switch (ctx.textAlign) { + case 'left': + l = x + break + case 'right': + l = x - w + break + } + switch (ctx.textBaseline) { + case 'top': + t = y + break + case 'bottom': + t = y - height + break + } + ctx.fillRect(l, t, w, height) + ctx.restore() +} +export function fillText (ctx, lines, x, y, width, height, lineHeight, maxLineLen, bk) { + if (!maxLineLen || maxLineLen > lines.length) { + maxLineLen = lines.length + } else { + maxLineLen = Math.ceil(maxLineLen) + } + for (let i = 0; i < maxLineLen - 1; ++i) { + if (bk) { + textBk(ctx, lines[i], x, y + i * lineHeight, lineHeight, bk) + } + ctx.fillText(lines[i], x, y + i * lineHeight) + } + if (maxLineLen < lines.length) { + let str = (lines[maxLineLen - 1] || '') + '...' + if (lines[maxLineLen - 1] && ctx.measureText(str).width > width) { + str = lines[maxLineLen - 1].substr(0, lines[maxLineLen - 1].length - 2) + '...' + } + if (bk) { + textBk(ctx, str, x, y + (maxLineLen - 1) * lineHeight, lineHeight, bk) + } + ctx.fillText(str, x, y + (maxLineLen - 1) * lineHeight) + } else { + if (bk) { + textBk(ctx, lines[maxLineLen - 1], x, y + (maxLineLen - 1) * lineHeight, lineHeight, bk) + } + ctx.fillText(lines[maxLineLen - 1], x, y + (maxLineLen - 1) * lineHeight) + } +} +export function text (ctx, node) { + if (!node.text) { + return + } + if (!node.text.split) { + node.text += '' + } + ctx.save() + ctx.beginPath() + delete ctx.shadowColor + delete ctx.shadowBlur + ctx.font = (node.fontStyle || 'normal') + ' normal ' + (node.fontWeight || 'normal') + ' ' + node.fontSize + 'px/' + node.lineHeight + ' ' + node.fontFamily + if (node.fontColor) { + ctx.fillStyle = node.fontColor + } else { + ctx.fillStyle = Store.get(node.generateStoreKey('LT:fontColor')) + } + if (node.textAlign) { + ctx.textAlign = node.textAlign + } + if (node.textBaseline) { + ctx.textBaseline = node.textBaseline + } + const textRect = node.getTextRect() + if (!textRect) { + ctx.restore() + return + } + const lines = getLines(ctx, node) + const lineHeight = node.fontSize * node.lineHeight + const maxLineLen = node.textMaxLine > 0 && node.textMaxLine < lines.length ? node.textMaxLine : lines.length + // By default, the text is center aligned. + let x = textRect.x + textRect.width / 2 + let y = textRect.y + (textRect.height - lineHeight * maxLineLen) / 2 + (lineHeight * 4) / 7 + switch (ctx.textAlign) { + case 'left': + x = textRect.x + break + case 'right': + x = textRect.x + textRect.width + break + } + switch (ctx.textBaseline) { + case 'top': + y = textRect.y + (lineHeight - node.fontSize) / 2 + break + case 'bottom': + y = textRect.ey - lineHeight * maxLineLen + lineHeight + break + } + fillText(ctx, lines, x + node.textOffsetX, y + node.textOffsetY, textRect.width, textRect.height, lineHeight, maxLineLen, node.textBackground) + ctx.restore() +} +export function iconfont (ctx, node) { + ctx.save() + ctx.textAlign = 'center' + ctx.textBaseline = 'middle' + const iconRect = node.getIconRect() + let x = iconRect.x + iconRect.width / 2 + let y = iconRect.y + iconRect.height / 2 + switch (node.imageAlign) { + case 'top': + y = iconRect.y + ctx.textBaseline = 'top' + break + case 'bottom': + y = iconRect.ey + ctx.textBaseline = 'bottom' + break + case 'left': + x = iconRect.x + ctx.textAlign = 'left' + break + case 'right': + x = iconRect.ex + ctx.textAlign = 'right' + break + case 'left-top': + x = iconRect.x + y = iconRect.y + ctx.textAlign = 'left' + ctx.textBaseline = 'top' + break + case 'right-top': + x = iconRect.ex + y = iconRect.y + ctx.textAlign = 'right' + ctx.textBaseline = 'top' + break + case 'left-bottom': + x = iconRect.x + y = iconRect.ey + ctx.textAlign = 'left' + ctx.textBaseline = 'bottom' + break + case 'right-bottom': + x = iconRect.ex + y = iconRect.ey + ctx.textAlign = 'right' + ctx.textBaseline = 'bottom' + break + } + if (node.iconSize > 0) { + ctx.font = node.iconSize + 'px ' + node.iconFamily + } else if (iconRect.width > iconRect.height) { + ctx.font = iconRect.height + 'px ' + node.iconFamily + } else { + ctx.font = iconRect.width + 'px ' + node.iconFamily + } + ctx.fillStyle = node.iconColor || Store.get(node.generateStoreKey('LT:iconColor')) || node.fontColor + if (node.iconRotate) { + ctx.translate(iconRect.center.x, iconRect.center.y) + ctx.rotate((node.iconRotate * Math.PI) / 180) + ctx.translate(-iconRect.center.x, -iconRect.center.y) + } + ctx.beginPath() + ctx.fillText(node.icon, x, y) + ctx.restore() +} +// # sourceMappingURL=text.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/text.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/text.js.map new file mode 100644 index 000000000..42750fe60 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/text.js.map @@ -0,0 +1 @@ +{"version":3,"file":"text.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAKpC,gFAAgF;AAChF,MAAM,UAAU,QAAQ,CAAC,GAAW;IAClC,IAAM,KAAK,GAAG,EAAE,CAAC;IACjB,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,IAAI,CAAC,GAAG,EAAE;QACR,GAAG,GAAG,EAAE,CAAC;KACV;IACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;QACnC,IAAM,EAAE,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC7B,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,EAAE;YACvB,IAAI,IAAI,EAAE;gBACR,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACjB,IAAI,GAAG,EAAE,CAAC;aACX;YACD,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACnB,SAAS;SACV;aAAM;YACL,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;SAChB;KACF;IAED,IAAI,IAAI,EAAE;QACR,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAClB;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,uCAAuC;AACvC,4DAA4D;AAC5D,wCAAwC;AACxC,MAAM,UAAU,YAAY,CAAC,GAA6B,EAAE,KAAe,EAAE,QAAgB,EAAE,QAAgB;IAC7G,IAAM,KAAK,GAAG,EAAE,CAAC;IACjB,IAAI,WAAW,GAAG,KAAK,CAAC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AAQ,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACpD,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC;QAC9C,GAAG,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KACvD;IAED,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9B,GAAG,CAAC,OAAO,EAAE,CAAC;AAChB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.anchor.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.anchor.d.ts new file mode 100644 index 000000000..84bd90f2c --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function triangleAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.anchor.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.anchor.js new file mode 100644 index 000000000..d381ba798 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.anchor.js @@ -0,0 +1,9 @@ +import { Point } from '../../models/point' +import { Direction } from '../../models/direction' +export function triangleAnchors (node) { + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y, Direction.Up)) + node.anchors.push(new Point(node.rect.x + (node.rect.width * 3) / 4, node.rect.y + node.rect.height / 2, Direction.Right)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y + node.rect.height, Direction.Bottom)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 4, node.rect.y + node.rect.height / 2, Direction.Left)) +} +// # sourceMappingURL=triangle.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.anchor.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.anchor.js.map new file mode 100644 index 000000000..c79f55f30 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"triangle.anchor.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/triangle.anchor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,UAAU,eAAe,CAAC,IAAU;IACxC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3F,IAAI,CAAC,OAAO,CAAC,IAAI,CACf,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CACxG,CAAC;IACF,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IAClH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;AACtH,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.d.ts new file mode 100644 index 000000000..c7e9a2f06 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.d.ts @@ -0,0 +1,2 @@ +import { Node } from '../../models/node'; +export declare function triangle(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.js new file mode 100644 index 000000000..9fd8ab104 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.js @@ -0,0 +1,10 @@ +export function triangle (ctx, node) { + ctx.beginPath() + ctx.moveTo(node.rect.x + node.rect.width / 2, node.rect.y) + ctx.lineTo(node.rect.x + node.rect.width, node.rect.y + node.rect.height) + ctx.lineTo(node.rect.x, node.rect.y + node.rect.height) + ctx.closePath(); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=triangle.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.js.map new file mode 100644 index 000000000..4834c1ae0 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"triangle.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/triangle.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,QAAQ,CAAC,GAA6B,EAAE,IAAU;IAChE,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3D,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1E,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxD,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.rect.d.ts b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.rect.d.ts new file mode 100644 index 000000000..af510963a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '../../models/node'; +export declare function triangleIconRect(node: Node): void; +export declare function triangleTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.rect.js b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.rect.js new file mode 100644 index 000000000..48c0c62fa --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.rect.js @@ -0,0 +1,22 @@ +import { Rect } from '../../models/rect' +export function triangleIconRect (node) { + let w = (node.rect.width * 2) / 7 + let h = (node.rect.height * 2) / 7 + if (w > h) { + w = h + } else { + h = w + } + let top = w + if (top < 10) { + top = 10 + } + node.iconRect = new Rect(node.rect.x + (node.rect.width - w) / 2, node.rect.y + top, w, h) +} +export function triangleTextRect (node) { + node.textRect = new Rect(node.rect.x + node.rect.width / 4, node.rect.y + (node.rect.height * 2) / 3, node.rect.width / 2, node.rect.height / 3 - 5) + const w = node.rect.width / 2 + const h = (node.rect.height * 3) / 7 + node.fullTextRect = new Rect(node.rect.x + (node.rect.width - w) / 2, node.rect.y + node.rect.height / 2 - 5, w, h) +} +// # sourceMappingURL=triangle.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.rect.js.map b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.rect.js.map new file mode 100644 index 000000000..6b6b6aca0 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/middles/nodes/triangle.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"triangle.rect.js","sourceRoot":"","sources":["../../../../../packages/core/src/middles/nodes/triangle.rect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,MAAM,UAAU,gBAAgB,CAAC,IAAU;IACzC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAClC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACnC,IAAI,CAAC,GAAG,CAAC,EAAE;QACT,CAAC,GAAG,CAAC,CAAC;KACP;SAAM;QACL,CAAC,GAAG,CAAC,CAAC;KACP;IACD,IAAI,GAAG,GAAG,CAAC,CAAC;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b/nezha-fronted/src/components/common/@topology/core/src/models/data.d.ts new file mode 100644 index 000000000..dedd46e39 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/data.d.ts @@ -0,0 +1,39 @@ +import { Pen } from './pen'; +import { Lock } from './status'; +import { Rect } from './rect'; +export interface TopologyData { + pens: Pen[]; + lineName: string; + fromArrow: string; + toArrow: string; + lineWidth?: number; + x: number; + y: number; + scale: number; + locked: Lock; + bkImage?: string; + bkImageRect?: Rect; + bkImageStatic?: boolean; + bkColor?: string; + grid?: boolean; + gridColor?: string; + gridSize?: number; + rule?: boolean; + ruleColor?: string; + websocket?: string; + mqttUrl?: string; + mqttOptions?: { + clientId?: string; + username?: string; + password?: string; + customClientId?: boolean; + }; + mqttTopics?: string; + manualCps?: boolean; + tooltip?: boolean | number; + socketEvent?: boolean | number; + socketFn?: string; + initJS?: string; + data?: any; +} +export declare function createData(json?: any, tid?: string): TopologyData; diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/data.js b/nezha-fronted/src/components/common/@topology/core/src/models/data.js new file mode 100644 index 000000000..059aa54a9 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/data.js @@ -0,0 +1,64 @@ +import { Node } from './node' +import { Line } from './line' +import { Lock } from './status' +import { s8 } from '../utils' +import { Store } from 'le5le-store' +import { Rect } from './rect' +export function createData (json, tid) { + let data = { + pens: [], + lineName: 'curve', + fromArrow: '', + toArrow: 'triangleSolid', + scale: 1, + locked: Lock.None, + x: 0, + y: 0 + } + if (typeof json === 'string') { + json = JSON.parse(json) + } + data = Object.assign(data, json) + data.pens = [] + if (json) { + // for old data. + if (json.nodes) { + for (let _i = 0, _a = json.nodes; _i < _a.length; _i++) { + var item = _a[_i] + item.TID = tid + data.pens.push(new Node(item)) + } + for (let _b = 0, _c = json.lines; _b < _c.length; _b++) { + var item = _c[_b] + item.TID = tid + data.pens.push(new Line(item)) + } + } + // end. + json.pens && json.pens.forEach(function (item) { + tid && (item.TID = tid) + if (!item.type) { + data.pens.push(new Node(item)) + } else { + data.pens.push(new Line(item)) + } + }) + if (json.bkImageRect) { + data.bkImageRect = new Rect(json.bkImageRect.x, json.bkImageRect.y, json.bkImageRect.width, json.bkImageRect.height) + } + } + if (data.mqttOptions) { + let opts = '' + if (typeof data.mqttOptions === 'object') { + opts = JSON.stringify(data.mqttOptions) + } else { + opts = data.mqttOptions + '' + } + data.mqttOptions = JSON.parse(opts) + } else { + data.mqttOptions = { clientId: s8() } + } + tid && Store.set(tid + '-topology-data', data) + return data +} +// # sourceMappingURL=data.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/data.js.map b/nezha-fronted/src/components/common/@topology/core/src/models/data.js.map new file mode 100644 index 000000000..ef966a3e8 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/data.js.map @@ -0,0 +1 @@ +{"version":3,"file":"data.js","sourceRoot":"","sources":["../../../../packages/core/src/models/data.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAsC9B,MAAM,UAAU,UAAU,CAAC,IAAU,EAAE,GAAY;IACjD,IAAI,IAAI,GAAiB;QACvB,IAAI,EAAE,EAAE;QACR,QAAQ,EAAE,OAAO;QACjB,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,IAAI,CAAC,IAAI;QACjB,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;KACL,CAAC;IAEF,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,IAAI,GA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,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;SACtH;KACF;IAED,IAAI,IAAI,CAAC,WAAW,EAAE;QACpB,IAAI,IAAI,GAAG,EAAE,CAAC;QACd,IAAI,OAAO,IAAI,CAAC,WAAW,KAAK,QAAQ,EAAE;YACxC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SACzC;aAAM;YACL,IAAI,GAAG,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;SAC9B;QACD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;KACrC;SAAM;QACL,IAAI,CAAC,WAAW,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC;KACvC;IAED,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,gBAAgB,EAAE,IAAI,CAAC,CAAC;IAE/C,OAAO,IAAI,CAAC;AACd,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/direction.d.ts b/nezha-fronted/src/components/common/@topology/core/src/models/direction.d.ts new file mode 100644 index 000000000..7cfd61089 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/direction.d.ts @@ -0,0 +1,7 @@ +export declare enum Direction { + None = 0, + Up = 1, + Right = 2, + Bottom = 3, + Left = 4 +} diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/direction.js b/nezha-fronted/src/components/common/@topology/core/src/models/direction.js new file mode 100644 index 000000000..2359c5b30 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/direction.js @@ -0,0 +1,9 @@ +export var Direction; +(function (Direction) { + Direction[Direction.None = 0] = 'None' + Direction[Direction.Up = 1] = 'Up' + Direction[Direction.Right = 2] = 'Right' + Direction[Direction.Bottom = 3] = 'Bottom' + Direction[Direction.Left = 4] = 'Left' +})(Direction || (Direction = {})) +// # sourceMappingURL=direction.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/direction.js.map b/nezha-fronted/src/components/common/@topology/core/src/models/direction.js.map new file mode 100644 index 000000000..b28047271 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/direction.js.map @@ -0,0 +1 @@ +{"version":3,"file":"direction.js","sourceRoot":"","sources":["../../../../packages/core/src/models/direction.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,yCAAI,CAAA;IACJ,qCAAE,CAAA;IACF,2CAAK,CAAA;IACL,6CAAM,CAAA;IACN,yCAAI,CAAA;AACN,CAAC,EANW,SAAS,KAAT,SAAS,QAMpB"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/event.d.ts b/nezha-fronted/src/components/common/@topology/core/src/models/event.d.ts new file mode 100644 index 000000000..a6f0b94b7 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/event.d.ts @@ -0,0 +1,18 @@ +export declare enum EventType { + Click = 0, + DblClick = 1, + WebSocket = 2, + Mqtt = 3, + MoveIn = 4, + MoveOut = 5 +} +export declare enum EventAction { + Link = 0, + StartAnimate = 1, + Function = 2, + WindowFn = 3, + SetProps = 4, + PauseAnimate = 5, + StopAnimate = 6, + Emit = 7 +} diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/event.js b/nezha-fronted/src/components/common/@topology/core/src/models/event.js new file mode 100644 index 000000000..1ccf8bd2b --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/event.js @@ -0,0 +1,21 @@ +export var EventType; +(function (EventType) { + EventType[EventType.Click = 0] = 'Click' + EventType[EventType.DblClick = 1] = 'DblClick' + EventType[EventType.WebSocket = 2] = 'WebSocket' + EventType[EventType.Mqtt = 3] = 'Mqtt' + EventType[EventType.MoveIn = 4] = 'MoveIn' + EventType[EventType.MoveOut = 5] = 'MoveOut' +})(EventType || (EventType = {})) +export var EventAction; +(function (EventAction) { + EventAction[EventAction.Link = 0] = 'Link' + EventAction[EventAction.StartAnimate = 1] = 'StartAnimate' + EventAction[EventAction.Function = 2] = 'Function' + EventAction[EventAction.WindowFn = 3] = 'WindowFn' + EventAction[EventAction.SetProps = 4] = 'SetProps' + EventAction[EventAction.PauseAnimate = 5] = 'PauseAnimate' + EventAction[EventAction.StopAnimate = 6] = 'StopAnimate' + EventAction[EventAction.Emit = 7] = 'Emit' +})(EventAction || (EventAction = {})) +// # sourceMappingURL=event.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/event.js.map b/nezha-fronted/src/components/common/@topology/core/src/models/event.js.map new file mode 100644 index 000000000..08fbcad6f --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/event.js.map @@ -0,0 +1 @@ +{"version":3,"file":"event.js","sourceRoot":"","sources":["../../../../packages/core/src/models/event.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,SAOX;AAPD,WAAY,SAAS;IACnB,2CAAK,CAAA;IACL,iDAAQ,CAAA;IACR,mDAAS,CAAA;IACT,yCAAI,CAAA;IACJ,6CAAM,CAAA;IACN,+CAAO,CAAA;AACT,CAAC,EAPW,SAAS,KAAT,SAAS,QAOpB;AAED,MAAM,CAAN,IAAY,WASX;AATD,WAAY,WAAW;IACrB,6CAAI,CAAA;IACJ,6DAAY,CAAA;IACZ,qDAAQ,CAAA;IACR,qDAAQ,CAAA;IACR,qDAAQ,CAAA;IACR,6DAAY,CAAA;IACZ,2DAAW,CAAA;IACX,6CAAI,CAAA;AACN,CAAC,EATW,WAAW,KAAX,WAAW,QAStB"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/index.d.ts b/nezha-fronted/src/components/common/@topology/core/src/models/index.d.ts new file mode 100644 index 000000000..b252bb2da --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/index.d.ts @@ -0,0 +1,9 @@ +export * from './data'; +export * from './pen'; +export * from './node'; +export * from './line'; +export * from './direction'; +export * from './point'; +export * from './rect'; +export * from './status'; +export * from './event'; diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/index.js b/nezha-fronted/src/components/common/@topology/core/src/models/index.js new file mode 100644 index 000000000..2e743ee8b --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/index.js @@ -0,0 +1,10 @@ +export * from './data' +export * from './pen' +export * from './node' +export * from './line' +export * from './direction' +export * from './point' +export * from './rect' +export * from './status' +export * from './event' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/index.js.map b/nezha-fronted/src/components/common/@topology/core/src/models/index.js.map new file mode 100644 index 000000000..572b34c23 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/core/src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/line.d.ts b/nezha-fronted/src/components/common/@topology/core/src/models/line.d.ts new file mode 100644 index 000000000..e0e67a50f --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/line.d.ts @@ -0,0 +1,64 @@ +import { Pen } from './pen'; +import { Point } from './point'; +import { Rect } from './rect'; +export declare class Line extends Pen { + from: Point; + to: Point; + controlPoints: Point[]; + fromArrow: string; + toArrow: string; + fromArrowSize: number; + toArrowSize: number; + fromArrowColor: string; + toArrowColor: string; + length: number; + borderWidth: number; + borderColor: string; + animateColor: string; + animateSpan: number; + animateLineDash: number[]; + isAnimate: boolean; + animateFromSize: number; + animateToSize: number; + animateDot: { + x: number; + y: number; + }; + animateDotSize: number; + lineJoin: CanvasLineJoin; + manualCps: boolean; + disableEmptyLine: boolean; + constructor(json?: any); + setFrom(from: Point, fromArrow?: string): void; + setTo(to: Point, toArrow?: string): void; + calcControlPoints(force?: boolean): void; + draw(ctx: CanvasRenderingContext2D): void; + pointIn(pt: { + x: number; + y: number; + }): any; + getLen(): any; + strokeLinearGradient(ctx: CanvasRenderingContext2D): void; + calcTextRect(): void; + getTextRect(): Rect; + getCenter(): Point; + getLineCenter(from: Point, to: Point): Point; + getPointByPos(pos: number): Point; + getPointByReversePos(pos: number): Point; + getLinePtByPos(from: Point, to: Point, pos: number): Point; + calcRectInParent(parent: Pen): void; + calcRectByParent(parent: Pen): void; + initAnimate(): void; + pauseAnimate(): void; + stopAnimate(): void; + animate(now: number): void; + getBubbles(): any[]; + round(): void; + translate(x: number, y: number): void; + scale(scale: number, center: { + x: number; + y: number; + }): void; + hit(pt: Point, padding?: number): any; + clone(): Line; +} diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/line.js b/nezha-fronted/src/components/common/@topology/core/src/models/line.js new file mode 100644 index 000000000..2b650f42a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/line.js @@ -0,0 +1,538 @@ +import { Pen, PenType } from './pen' +import { Point } from './point' +import { drawLineFns, drawArrowFns } from '../middles' +import { getBezierPoint } from '../middles/lines/curve' +import { Store } from 'le5le-store' +import { lineLen, curveLen } from '../utils/canvas' +import { text } from '../middles/nodes/text' +import { Rect } from './rect' +import { abs } from '../utils/math' +const __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b }) || + function (d, b) { for (const p in b) if (b.hasOwnProperty(p)) d[p] = b[p] } + return extendStatics(d, b) + } + return function (d, b) { + extendStatics(d, b) + function __ () { this.constructor = d } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()) + } +})() +const Line = /** @class */ (function (_super) { + __extends(Line, _super) + function Line (json) { + const _this = _super.call(this) || this + const defaultData = { + name: 'curve', + fromArrow: '', + toArrow: '', + controlPoints: [], + fromArrowSize: 5, + toArrowSize: 5, + borderWidth: 0, + borderColor: '#000000', + animateColor: '', + animateSpan: 1, + animateFromSize: 0, + animateToSize: 0, + animateDotSize: 3, + textBackground: '#ffffff' + } + _this.fromData(defaultData, json) + _this.type = PenType.Line + if (json.from) { + _this.from = new Point(json.from.x, json.from.y, json.from.direction, json.from.anchorIndex, json.from.id, json.autoAnchor) + } + if (json.to) { + _this.to = new Point(json.to.x, json.to.y, json.to.direction, json.to.anchorIndex, json.to.id, json.autoAnchor) + } + // 暂时兼容老数据 + if (json.name === 'mind' && (!json.controlPoints || json.controlPoints.length > 2)) { + json.controlPoints = undefined + _this.calcControlPoints(true) + } + // end + else if (json.controlPoints) { + _this.controlPoints = [] + for (let _i = 0, _a = json.controlPoints; _i < _a.length; _i++) { + const item = _a[_i] + _this.controlPoints.push(new Point(item.x, item.y, item.direction, item.anchorIndex, item.id)) + } + } + if (json.children) { + _this.children = [] + json.children.forEach(function (item) { + _this.children.push(new Line(item)) + }) + } + return _this + } + Line.prototype.setFrom = function (from, fromArrow) { + if (fromArrow === void 0) { fromArrow = '' } + this.from = from + this.fromArrow = fromArrow + this.textRect = undefined + } + Line.prototype.setTo = function (to, toArrow) { + if (toArrow === void 0) { toArrow = 'triangleSolid' } + this.to = to + this.toArrow = toArrow + this.textRect = undefined + } + Line.prototype.calcControlPoints = function (force) { + if (this.name !== 'line' && this.manualCps && !force) { + return + } + this.textRect = undefined + if (this.from && this.to && drawLineFns[this.name]) { + drawLineFns[this.name].controlPointsFn(this) + } + } + Line.prototype.draw = function (ctx) { + if (this.animateDot) { + ctx.fillStyle = ctx.strokeStyle + if (this.animateType === 'dot') { + ctx.beginPath() + ctx.arc(this.animateDot.x, this.animateDot.y, this.animateDotSize, 0, 2 * Math.PI, false) + ctx.fill() + return + } else if (this.animateType === 'comet') { + const bulles = this.getBubbles() + ctx.save() + for (let _i = 0, bulles_1 = bulles; _i < bulles_1.length; _i++) { + const item = bulles_1[_i] + ctx.globalAlpha = item.a + ctx.beginPath() + ctx.arc(item.pos.x, item.pos.y, item.r, 0, 2 * Math.PI, false) + ctx.fill() + } + ctx.restore() + } + } + if (!this.isAnimate && this.borderWidth > 0 && this.borderColor) { + ctx.save() + if (this.lineJoin) { + ctx.lineJoin = this.lineJoin + } + ctx.lineWidth = this.lineWidth + this.borderWidth + ctx.strokeStyle = this.borderColor + if (drawLineFns[this.name]) { + drawLineFns[this.name].drawFn(ctx, this) + } + ctx.restore() + } + switch (this.strokeType) { + case 1: + this.strokeLinearGradient(ctx) + break + } + if ((!this.isAnimate || this.animateType !== 'comet') && drawLineFns[this.name]) { + if (this.lineJoin) { + ctx.lineJoin = this.lineJoin + } + drawLineFns[this.name].drawFn(ctx, this) + } + const scale = Store.get(this.generateStoreKey('LT:scale')) || 1 + if (this.fromArrow && drawArrowFns[this.fromArrow]) { + ctx.save() + ctx.beginPath() + ctx.lineDashOffset = 0 + ctx.setLineDash([]) + ctx.fillStyle = this.fromArrowColor || ctx.strokeStyle + ctx.strokeStyle = ctx.fillStyle + var f = this.to + if (this.name === 'curve') { + f = getBezierPoint(0.95 - this.lineWidth / 100, this.to, this.controlPoints[1], this.controlPoints[0], this.from) + } else if (this.name !== 'line' && this.controlPoints.length) { + f = this.controlPoints[0] + } + drawArrowFns[this.fromArrow](ctx, f, this.from, this.fromArrowSize * scale) + ctx.restore() + } + if (this.toArrow && drawArrowFns[this.toArrow]) { + ctx.save() + ctx.beginPath() + ctx.lineDashOffset = 0 + ctx.setLineDash([]) + ctx.fillStyle = this.toArrowColor || ctx.strokeStyle + ctx.strokeStyle = ctx.fillStyle + var f = this.from + if (this.name === 'curve') { + f = getBezierPoint(0.95 - this.lineWidth / 100, this.from, this.controlPoints[0], this.controlPoints[1], this.to) + } else if (this.name === 'mind') { + f = getBezierPoint(0.96 - this.lineWidth / 100, this.from, this.controlPoints[0], this.controlPoints[1], this.to) + } else if (this.name !== 'line' && this.controlPoints.length) { + f = this.controlPoints[this.controlPoints.length - 1] + } + drawArrowFns[this.toArrow](ctx, f, this.to, this.toArrowSize * scale) + ctx.restore() + } + if (this.text && !this.isAnimate) { + if (!this.textRect) { + this.calcTextRect() + } + text(ctx, this) + } + } + Line.prototype.pointIn = function (pt) { + return drawLineFns[this.name].pointIn(pt, this) + } + Line.prototype.getLen = function () { + switch (this.name) { + case 'line': + return lineLen(this.from, this.to) + case 'polyline': + if (!this.controlPoints || !this.controlPoints.length) { + return lineLen(this.from, this.to) + } + var len = 0 + var curPt = this.from + for (let _i = 0, _a = this.controlPoints; _i < _a.length; _i++) { + const pt = _a[_i] + len += lineLen(curPt, pt) + curPt = pt + } + len += lineLen(curPt, this.to) + return len | 0 + case 'curve': + case 'mind': + return curveLen(this.from, this.controlPoints[0], this.controlPoints[1], this.to) + default: + if (drawLineFns[this.name].getLength) { + return drawLineFns[this.name].getLength(this) + } + } + return 0 + } + Line.prototype.strokeLinearGradient = function (ctx) { + if (!this.lineGradientFromColor || !this.lineGradientToColor) { + return + } + const from = this.from + const to = this.to + // contributor: https://github.com/sunnyguohua/topology + const grd = ctx.createLinearGradient(from.x, from.y, to.x, to.y) + grd.addColorStop(0, this.lineGradientFromColor) + grd.addColorStop(1, this.lineGradientToColor) + ctx.strokeStyle = grd + } + Line.prototype.calcTextRect = function () { + const center = this.getCenter() + let width = Math.abs(this.from.x - this.to.x) + if (width < 100) { + width = 100 + } + if (this.text && !this.text.split) { + this.text += '' + } + const height = this.lineHeight * + this.fontSize * + (this.textMaxLine || (this.text && this.text.split('\n').length) || 1) + this.textRect = new Rect(center.x - width / 2, center.y - height / 2, width, height) + } + Line.prototype.getTextRect = function () { + // calc every time just in case text line is changed. + this.calcTextRect() + return this.textRect + } + Line.prototype.getCenter = function () { + let center = new Point(this.from.x, this.from.y) + switch (this.name) { + case 'line': + center = this.getLineCenter(this.from, this.to) + break + case 'polyline': + var i = Math.round(this.controlPoints.length / 2) + center = this.getLineCenter(this.controlPoints[i - 1] || this.from, this.controlPoints[i] || this.to) + break + case 'curve': + center = getBezierPoint(0.5, this.to, this.controlPoints[1], this.controlPoints[0], this.from) + break + default: + if (drawLineFns[this.name].getCenter) { + center = drawLineFns[this.name].getCenter(this) + } + } + return center + } + Line.prototype.getLineCenter = function (from, to) { + return new Point((from.x + to.x) / 2, (from.y + to.y) / 2) + } + Line.prototype.getPointByPos = function (pos) { + if (pos <= 0) { + return this.from + } + switch (this.name) { + case 'line': + return this.getLinePtByPos(this.from, this.to, pos) + case 'polyline': + if (!this.controlPoints || !this.controlPoints.length) { + return this.getLinePtByPos(this.from, this.to, pos) + } else { + const points = [].concat(this.controlPoints, this.to) + let curPt = this.from + for (let _i = 0, points_1 = points; _i < points_1.length; _i++) { + const pt = points_1[_i] + const l = lineLen(curPt, pt) + if (pos > l) { + pos -= l + curPt = pt + } else { + return this.getLinePtByPos(curPt, pt, pos) + } + } + return this.to + } + case 'curve': + return getBezierPoint(pos / this.getLen(), this.from, this.controlPoints[0], this.controlPoints[1], this.to) + default: + if (drawLineFns[this.name].getPointByPos) { + return drawLineFns[this.name].getPointByPos(pos, this) + } + } + return null + } + Line.prototype.getPointByReversePos = function (pos) { + if (pos <= 0) { + return this.to + } + switch (this.name) { + case 'line': + return this.getLinePtByPos(this.to, this.from, pos) + case 'polyline': + if (!this.controlPoints || !this.controlPoints.length) { + return this.getLinePtByPos(this.to, this.from, pos) + } else { + const points_3 = [] + this.controlPoints.forEach(function (item) { + points_3.unshift(item) + }) + points_3.unshift(this.to) + let curPt = this.to + for (let _i = 0, points_2 = points_3; _i < points_2.length; _i++) { + const pt = points_2[_i] + const l = lineLen(curPt, pt) + if (pos > l) { + pos -= l + curPt = pt + } else { + return this.getLinePtByPos(curPt, pt, pos) + } + } + return this.from + } + case 'curve': + return getBezierPoint(pos / this.getLen(), this.to, this.controlPoints[1], this.controlPoints[0], this.from) + default: + if (drawLineFns[this.name].getPointByReversePos) { + return drawLineFns[this.name].getPointByReversePos(pos, this) + } + } + return null + } + Line.prototype.getLinePtByPos = function (from, to, pos) { + const length = lineLen(from, to) + if (pos <= 0) { + return from + } + if (pos >= length) { + return to + } + let x, y + x = from.x + (to.x - from.x) * (pos / length) + y = from.y + (to.y - from.y) * (pos / length) + return new Point(x, y) + } + Line.prototype.calcRectInParent = function (parent) { + const parentW = parent.rect.width - parent.paddingLeftNum - parent.paddingRightNum + const parentH = parent.rect.height - parent.paddingTopNum - parent.paddingBottomNum + this.rectInParent = { + x: ((this.from.x - parent.rect.x - parent.paddingLeftNum) * 100) / parentW + '%', + y: ((this.from.y - parent.rect.y - parent.paddingTopNum) * 100) / parentH + '%', + width: 0, + height: 0, + rotate: 0 + } + } + // 根据父节点rect计算自己(子节点)的rect + Line.prototype.calcRectByParent = function (parent) { + if (!this.rectInParent) { + return + } + const parentW = parent.rect.width - parent.paddingLeftNum - parent.paddingRightNum + const parentH = parent.rect.height - parent.paddingTopNum - parent.paddingBottomNum + let x = parent.rect.x + + parent.paddingLeftNum + + abs(parentW, this.rectInParent.x) + + abs(parentW, this.rectInParent.marginLeft) + let y = parent.rect.y + + parent.paddingTopNum + + abs(parentH, this.rectInParent.y) + + abs(parentW, this.rectInParent.marginTop) + if (this.rectInParent.marginLeft === undefined && this.rectInParent.marginRight) { + x -= abs(parentW, this.rectInParent.marginRight) + } + if (this.rectInParent.marginTop === undefined && this.rectInParent.marginBottom) { + y -= abs(parentW, this.rectInParent.marginBottom) + } + this.translate(x - this.from.x, y - this.from.y) + } + Line.prototype.initAnimate = function () { + this.animateStart = 0 + this.animateDot = undefined + this.animatePos = 0 + } + Line.prototype.pauseAnimate = function () { + Store.set(this.generateStoreKey('LT:AnimatePlay'), { + pen: this, + stop: true + }) + } + Line.prototype.stopAnimate = function () { + const _this = this + this.pauseAnimate() + this.initAnimate() + setTimeout(function () { + Store.set(_this.generateStoreKey('LT:render'), { + pen: _this, + stop: true + }) + }, 50) + } + Line.prototype.animate = function (now) { + this.animatePos += this.animateSpan + switch (this.animateType) { + case 'beads': + if (this.animateReverse) { + this.lineDashOffset = this.animatePos + } else { + this.lineDashOffset = -this.animatePos + } + var len = this.lineWidth + if (len < 5) { + len = 5 + } + if (this.animateLineDash) { + this.lineDash = this.animateLineDash + } else { + this.lineDash = [len, len * 2] + } + break + case 'dot': + case 'comet': + this.lineDash = undefined + var pos = void 0 + if (this.animateReverse) { + pos = this.getPointByReversePos(this.animatePos + this.animateToSize) + } else { + pos = this.getPointByPos(this.animatePos + this.animateFromSize) + } + this.animateDot = pos + break + default: + if (this.animateReverse) { + this.lineDash = [0, this.length - this.animatePos + 1, this.animatePos] + } else { + this.lineDash = [this.animatePos, this.length - this.animatePos + 1] + } + break + } + if (this.animatePos > this.length + this.animateSpan - this.animateFromSize - this.animateToSize) { + if (++this.animateCycleIndex >= this.animateCycle && this.animateCycle > 0) { + this.animateStart = 0 + this.initAnimate() + Store.set(this.generateStoreKey('animateEnd'), this) + return + } + this.animatePos = this.animateSpan + } + } + Line.prototype.getBubbles = function () { + const bubbles = [] + for (let i = 0; i < 30 && this.animatePos - i > 0; ++i) { + if (this.animateReverse) { + bubbles.push({ + pos: this.getPointByReversePos(this.animatePos - i * 2 + this.animateToSize), + a: 1 - i * 0.03, + r: this.lineWidth - i * 0.01 + }) + } else { + bubbles.push({ + pos: this.getPointByPos(this.animatePos - i * 2 + this.animateFromSize), + a: 1 - i * 0.03, + r: this.lineWidth - i * 0.01 + }) + } + } + return bubbles + } + Line.prototype.round = function () { + this.from.round() + this.to.round() + } + Line.prototype.translate = function (x, y) { + if (this.from) { + this.from.x += x + this.from.y += y + this.to.x += x + this.to.y += y + if (this.text) { + this.textRect = undefined + } + for (let _i = 0, _a = this.controlPoints; _i < _a.length; _i++) { + const pt = _a[_i] + pt.x += x + pt.y += y + } + } + if (this.children) { + for (let _b = 0, _c = this.children; _b < _c.length; _b++) { + const item = _c[_b] + item.translate(x, y) + } + } + Store.set(this.generateStoreKey('pts-') + this.id, undefined) + } + Line.prototype.scale = function (scale, center) { + if (this.from) { + this.from.x = center.x - (center.x - this.from.x) * scale + this.from.y = center.y - (center.y - this.from.y) * scale + this.to.x = center.x - (center.x - this.to.x) * scale + this.to.y = center.y - (center.y - this.to.y) * scale + this.lineWidth *= scale + this.borderWidth *= scale + this.fontSize *= scale + if (this.text) { + this.textRect = undefined + } + this.textOffsetX *= scale + this.textOffsetY *= scale + for (let _i = 0, _a = this.controlPoints; _i < _a.length; _i++) { + const pt = _a[_i] + pt.x = center.x - (center.x - pt.x) * scale + pt.y = center.y - (center.y - pt.y) * scale + } + } + if (this.children) { + for (let _b = 0, _c = this.children; _b < _c.length; _b++) { + const item = _c[_b] + item.scale(scale, center) + } + } + Store.set(this.generateStoreKey('pts-') + this.id, undefined) + } + Line.prototype.hit = function (pt, padding) { + if (padding === void 0) { padding = 0 } + if (this.from.hit(pt, padding) || this.to.hit(pt, padding)) { + return this + } + } + Line.prototype.clone = function () { + return new Line(this) + } + return Line +}(Pen)) +export { Line } +// # sourceMappingURL=line.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/line.js.map b/nezha-fronted/src/components/common/@topology/core/src/models/line.js.map new file mode 100644 index 000000000..53bc1ecde --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/line.js.map @@ -0,0 +1 @@ +{"version":3,"file":"line.js","sourceRoot":"","sources":["../../../../packages/core/src/models/line.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACp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AC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;aAC7C;SACF;QAED,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,KAAmB,UAAa,EAAb,KAAA,IAAI,CAAC,QAAQ,EAAb,cAAa,EAAb,IAAa,EAAE;gBAA7B,IAAM,IAAI,SAAA;gBACb,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;aAC3B;SACF;QAED,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;IAChE,CAAC;IAED,kBAAG,GAAH,UAAI,EAAS,EAAE,OAAW;QAAX,wBAAA,EAAA,WAAW;QACxB,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE;YAC1D,OAAO,IAAI,CAAC;SACb;IACH,CAAC;IAED,oBAAK,GAAL;QACE,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IACH,WAAC;AAAD,CAAC,AAjmBD,CAA0B,GAAG,GAimB5B"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/node.d.ts b/nezha-fronted/src/components/common/@topology/core/src/models/node.d.ts new file mode 100644 index 000000000..579c54e3f --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/node.d.ts @@ -0,0 +1,116 @@ +import { Pen } from './pen'; +import { Rect } from './rect'; +import { Point } from './point'; +import { Direction } from './direction'; +export declare class Node extends Pen { + is3D: boolean; + z: number; + zRotate: number; + borderRadius: number; + icon: string; + iconFamily: string; + iconSize: number; + iconColor: string; + iconRotate: number; + image: string; + lastImage: string; + imgNaturalWidth: number; + imgNaturalHeight: number; + imageWidth: number; + imageHeight: number; + imageRatio: boolean; + imageAlign: string; + imageHide: boolean; + img: HTMLImageElement; + bkType: number; + gradientFromColor: string; + gradientToColor: string; + gradientAngle: number; + gradientRadius: number; + paddingTop: number | string; + paddingBottom: number | string; + paddingLeft: number | string; + paddingRight: number | string; + disableSizeX?: boolean; + disableSizeY?: boolean; + iconRect: Rect; + fullIconRect: Rect; + points: Point[]; + anchors: Point[]; + manualAnchors: Point[]; + rotatedAnchors: Point[]; + get dockWatchers(): Point[]; + set dockWatchers(v: Point[]); + animateDuration: number; + animateFrames: { + duration: number; + start?: number; + end?: number; + initState?: Node; + linear: boolean; + state: Node; + offsetRect: Rect; + }[]; + animateAlone: boolean; + animateReady: Node; + animateFrame: number; + private _animateFrame; + private _animatePos; + gif: boolean; + video: string; + audio: string; + playType: number; + playLoop: boolean; + nextPlay: string; + iframe: string; + elementId: string; + elementLoaded: any; + elementRendered: boolean; + constructor(json: any, cloneState?: boolean); + static cloneState(json: any): Node; + restore(state?: Node): void; + checkData(): void; + init(cloneState?: boolean): void; + addToDiv(): void; + removeFromDiv(): void; + hasGif(): boolean; + calcAbsPadding(): void; + draw(ctx: CanvasRenderingContext2D): void; + strokeLinearGradient(ctx: CanvasRenderingContext2D): void; + drawBkLinearGradient(ctx: CanvasRenderingContext2D): void; + drawBkRadialGradient(ctx: CanvasRenderingContext2D): void; + drawImg(ctx: CanvasRenderingContext2D): void; + calcAnchors(): void; + calcRotateAnchors(angle?: number): void; + getTextRect(): Rect; + getIconRect(): Rect; + calcRectByParent(parent: Pen): void; + calcChildrenRect(): void; + calcRectInParent(parent: Pen): void; + initAnimate(): void; + pauseAnimate(): void; + stopAnimate(): void; + animate(now: number): void; + scale(scale: number, center?: { + x: number; + y: number; + }): void; + scalePoints(scaleX?: number, scaleY?: number): void; + translate(x: number, y: number): void; + initRect(): void; + pushPoint(pt: Point): void; + nearestAnchor(pt: Point): { + index: number; + direction: Direction; + }; + hitInSelf(point: { + x: number; + y: number; + }, padding?: number): boolean; + hit(pt: { + x: number; + y: number; + }, padding?: number): any; + round(): void; + clone(): Node; +} diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/node.js b/nezha-fronted/src/components/common/@topology/core/src/models/node.js new file mode 100644 index 000000000..a33457344 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/node.js @@ -0,0 +1,1102 @@ +import { images, Pen, PenType } from './pen' +import { Line } from './line' +import { Rect } from './rect' +import { Point } from './point' +import { anchorsFns, iconRectFns, textRectFns, drawNodeFns } from '../middles' +import { defaultAnchors } from '../middles/default.anchor' +import { defaultIconRect, defaultTextRect } from '../middles/default.rect' +import { text, iconfont } from '../middles/nodes/text' +import { Store } from 'le5le-store' +import { abs, distance } from '../utils/math' +import { pointInRect } from '../utils/canvas' +import { Direction } from './direction' +const __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b }) || + function (d, b) { for (const p in b) if (b.hasOwnProperty(p)) d[p] = b[p] } + return extendStatics(d, b) + } + return function (d, b) { + extendStatics(d, b) + function __ () { this.constructor = d } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()) + } +})() +const __spreadArrays = (this && this.__spreadArrays) || function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length + for (var r = Array(s), k = 0, i = 0; i < il; i++) { + for (let a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) { r[k] = a[j] } + } + return r +} +// 动画帧不涉及的属性 +const animateOutsides = [ + 'TID', + 'events', + 'wheres', + 'text', + 'fontFamily', + 'fontSize', + 'lineHeight', + 'fontStyle', + 'fontWeight', + 'textAlign', + 'textBaseline', + 'textBackground', + 'iconFamily', + 'icon', + 'iconSize' +] +const Node = /** @class */ (function (_super) { + __extends(Node, _super) + function Node (json, cloneState) { + const _this = _super.call(this) || this + _this.imageRatio = true + _this.points = [] + _this.anchors = [] + _this.manualAnchors = [] + _this.rotatedAnchors = [] + _this.animateDuration = 0 + _this.animateFrames = [] + _this.animateFrame = 0 + const defaultData = { + zRotate: 0, + borderRadius: 0, + imageAlign: 'center', + gradientAngle: 0, + gradientRadius: 0.01, + paddingTop: 0, + paddingBottom: 0, + paddingLeft: 0, + paddingRight: 0, + animateFrame: 0, + children: [] + } + _this.fromData(defaultData, json) + _this.type = PenType.Node + if (!cloneState) { + delete _this.elementLoaded + delete _this.elementRendered + } + delete _this.animateReady + // 兼容老数据 + if (json.children && json.children[0] && json.children[0].parentRect) { + _this.paddingLeft = json.children[0].parentRect.offsetX + _this.paddingRight = 0 + _this.paddingTop = json.children[0].parentRect.offsetY + _this.paddingBottom = 0 + } + if (json.parentRect) { + _this.rectInParent = { + x: json.parentRect.x * 100 + '%', + y: json.parentRect.y * 100 + '%', + width: json.parentRect.width * 100 + '%', + height: json.parentRect.height * 100 + '%', + marginTop: 0, + marginRight: 0, + marginBottom: 0, + marginLeft: 0, + rotate: json.parentRect.rotate + } + _this.paddingTop = json.parentRect.marginY + _this.paddingBottom = json.parentRect.marginY + _this.paddingLeft = json.parentRect.marginX + _this.paddingRight = json.parentRect.marginX + } + // 兼容老数据 end + if (json.points) { + _this.points = [] + json.points.forEach(function (pt) { + _this.points.push(new Point(pt.x, pt.y)) + }) + } + if (json.manualAnchors) { + _this.manualAnchors = [] + json.manualAnchors.forEach(function (pt) { + const point = new Point(pt.x, pt.y) + point.id = json.id + _this.manualAnchors.push(point) + }) + } + if (cloneState) { + _this.animateFrames = undefined + } + if (!cloneState && json.animateFrames && json.animateFrames.length) { + for (let _i = 0, _a = json.animateFrames; _i < _a.length; _i++) { + const item = _a[_i] + item.children = undefined + if (item.initState) { + item.initState = Node.cloneState(item.initState) + } + item.state = Node.cloneState(item.state) + } + _this.animateFrames = json.animateFrames + } + _this.animateType = json.animateType + ? json.animateType + : json.animateDuration + ? 'custom' + : '' + _this.init(cloneState) + if (json.init && json.img && !json.image) { + _this.img = json.img + } + if (json.children) { + _this.children = [] + json.children.forEach(function (item) { + let child + item.TID = _this.TID + switch (item.type) { + case PenType.Line: + child = new Line(item) + child.calcRectByParent(_this) + break + default: + Node.prototype.calcRectByParent.apply(item, [_this]) + child = new Node(item) + child.parentId = _this.id + child.init(cloneState) + break + } + _this.children.push(child) + }) + } + return _this + } + Object.defineProperty(Node.prototype, 'dockWatchers', { + // nodes移动时,停靠点的参考位置 + // dockWatchers: Point[]; + get: function () { + return __spreadArrays([this.rect.center], this.rect.toPoints()) + }, + // 不做任何处理,兼容以前版本中节点属性存在该值的 + set: function (v) { + }, + enumerable: true, + configurable: true + }) + Node.cloneState = function (json) { + const n = new Node(json, true) + animateOutsides.forEach(function (item) { + delete n[item] + }) + return n + } + Node.prototype.restore = function (state) { + if (!state && this.animateReady) { + state = Node.cloneState(this.animateReady) + } + if (!state) { + return + } + for (const key in this) { + if (state[key] !== undefined && + key.indexOf('animate') < 0 && + key.indexOf('Animate') < 0) { + if (animateOutsides.includes(key)) { + continue + } + this[key] = state[key] + if (key === 'rect') { + this.rect = new Rect(this.rect.x, this.rect.y, this.rect.width, this.rect.height) + } + } + } + this.init(true) + } + Node.prototype.checkData = function () { + this.rect.width = this.rect.width < 0 ? 0 : this.rect.width + this.rect.height = this.rect.height < 0 ? 0 : this.rect.height + if (!this.rect.calcCenter) { + this.rect = new Rect(this.rect.x, this.rect.y, this.rect.width, this.rect.height) + } + } + Node.prototype.init = function (cloneState) { + this.checkData() + this.calcAbsPadding() + // Calc rect of text. + if (textRectFns[this.name]) { + textRectFns[this.name](this) + } else { + defaultTextRect(this) + } + // Calc rect of icon. + if (iconRectFns[this.name]) { + iconRectFns[this.name](this) + } else { + defaultIconRect(this) + } + this.calcAnchors() + this.elementRendered = false + if (!cloneState) { + this.addToDiv() + } + } + Node.prototype.addToDiv = function () { + if (this.audio || this.video || this.iframe || this.elementId || this.gif) { + Store.set(this.generateStoreKey('LT:addDiv'), this) + } + } + Node.prototype.removeFromDiv = function () { + Store.set(this.generateStoreKey('LT:removeDiv'), this) + } + Node.prototype.hasGif = function () { + if (this.gif) { + return true + } + if (this.children) { + for (let _i = 0, _a = this.children; _i < _a.length; _i++) { + const item = _a[_i] + if (item.type === PenType.Node && + item.hasGif && + item.hasGif()) { + return true + } + } + } + return false + } + Node.prototype.calcAbsPadding = function () { + this.paddingLeftNum = abs(this.rect.width, this.paddingLeft) + this.paddingRightNum = abs(this.rect.width, this.paddingRight) + this.paddingTopNum = abs(this.rect.height, this.paddingTop) + this.paddingBottomNum = abs(this.rect.height, this.paddingBottom) + } + // setChildrenIds() { + // if (!this.children) { + // return; + // } + // for (const item of this.children) { + // item.id = s8(); + // switch (item.type) { + // case PenType.Node: + // (item as Node).setChildrenIds(); + // break; + // } + // } + // } + Node.prototype.draw = function (ctx) { + if (!drawNodeFns[this.name]) { + return + } + // DrawBk + switch (this.bkType) { + case 1: + this.drawBkLinearGradient(ctx) + break + case 2: + this.drawBkRadialGradient(ctx) + break + } + switch (this.strokeType) { + case 1: + this.strokeLinearGradient(ctx) + break + } + // Draw shape. + drawNodeFns[this.name](ctx, this) + // Draw image. + if (this.image || (this.img && this.elementId === '')) { + this.drawImg(ctx) + } else if (this.icon) { + ctx.save() + ctx.shadowColor = '' + ctx.shadowBlur = 0 + iconfont(ctx, this) + ctx.restore() + } + // Draw text. + if (this.name !== 'text' && this.text) { + text(ctx, this) + } + } + Node.prototype.strokeLinearGradient = function (ctx) { + if (!this.lineGradientFromColor || !this.lineGradientToColor) { + return + } + const from = new Point(this.rect.x, this.rect.center.y) + const to = new Point(this.rect.ex, this.rect.center.y) + if (this.lineGradientAngle % 90 === 0 && this.lineGradientAngle % 180) { + if (this.lineGradientAngle % 270) { + from.x = this.rect.center.x + from.y = this.rect.y + to.x = this.rect.center.x + to.y = this.rect.ey + } else { + from.x = this.rect.center.x + from.y = this.rect.ey + to.x = this.rect.center.x + to.y = this.rect.y + } + } else if (this.lineGradientAngle) { + from.rotate(this.lineGradientAngle, this.rect.center) + to.rotate(this.lineGradientAngle, this.rect.center) + } + // contributor: https://github.com/sunnyguohua/topology + const grd = ctx.createLinearGradient(from.x, from.y, to.x, to.y) + grd.addColorStop(0, this.lineGradientFromColor) + grd.addColorStop(1, this.lineGradientToColor) + ctx.strokeStyle = grd + } + Node.prototype.drawBkLinearGradient = function (ctx) { + if (!this.gradientFromColor || !this.gradientToColor) { + return + } + const from = new Point(this.rect.x, this.rect.center.y) + const to = new Point(this.rect.ex, this.rect.center.y) + if (this.gradientAngle % 90 === 0 && this.gradientAngle % 180) { + if (this.gradientAngle % 270) { + from.x = this.rect.center.x + from.y = this.rect.y + to.x = this.rect.center.x + to.y = this.rect.ey + } else { + from.x = this.rect.center.x + from.y = this.rect.ey + to.x = this.rect.center.x + to.y = this.rect.y + } + } else if (this.gradientAngle) { + from.rotate(this.gradientAngle, this.rect.center) + to.rotate(this.gradientAngle, this.rect.center) + } + // contributor: https://github.com/sunnyguohua/topology + const grd = ctx.createLinearGradient(from.x, from.y, to.x, to.y) + grd.addColorStop(0, this.gradientFromColor) + grd.addColorStop(1, this.gradientToColor) + ctx.fillStyle = grd + } + Node.prototype.drawBkRadialGradient = function (ctx) { + if (!this.gradientFromColor || !this.gradientToColor) { + return + } + let r = this.rect.width + if (r < this.rect.height) { + r = this.rect.height + } + r *= 0.5 + const grd = ctx.createRadialGradient(this.rect.center.x, this.rect.center.y, r * this.gradientRadius, this.rect.center.x, this.rect.center.y, r) + grd.addColorStop(0, this.gradientFromColor) + grd.addColorStop(1, this.gradientToColor) + ctx.fillStyle = grd + } + Node.prototype.drawImg = function (ctx) { + const _this = this + if (this.lastImage !== this.image) { + this.img = undefined + if (this.lastImage && this.lastImage.indexOf('.gif') > 0) { + Store.set(this.generateStoreKey('LT:addDiv'), this) + } + } + const gif = this.image && this.image.indexOf('.gif') > 0 + if (!gif) { + if (this.img) { + ctx.save() + ctx.shadowColor = '' + ctx.shadowBlur = 0 + const rect = this.getIconRect() + let x = rect.x + let y = rect.y + let w = rect.width + let h = rect.height + if (this.imageWidth) { + w = this.imageWidth + } + if (this.imageHeight) { + h = this.imageHeight + } + if (this.imgNaturalWidth && this.imgNaturalHeight && this.imageRatio) { + if (this.imageWidth) { + h = (this.imgNaturalHeight / this.imgNaturalWidth) * w + } else { + w = (this.imgNaturalWidth / this.imgNaturalHeight) * h + } + } + x += (rect.width - w) / 2 + y += (rect.height - h) / 2 + switch (this.imageAlign) { + case 'top': + y = rect.y + break + case 'bottom': + y = rect.ey - h + break + case 'left': + x = rect.x + break + case 'right': + x = rect.ex - w + break + case 'left-top': + x = rect.x + y = rect.y + break + case 'right-top': + x = rect.ex - w + y = rect.y + break + case 'left-bottom': + x = rect.x + y = rect.ey - h + break + case 'right-bottom': + x = rect.ex - w + y = rect.ey - h + break + } + if (this.iconRotate) { + ctx.translate(rect.center.x, rect.center.y) + ctx.rotate((this.iconRotate * Math.PI) / 180) + ctx.translate(-rect.center.x, -rect.center.y) + } + if (this.imageHide) { + // 在业务层面去自定义绘制图片 + } else { + ctx.drawImage(this.img, x, y, w, h) + } + ctx.restore() + return + } else if (images[this.image]) { + this.img = images[this.image].img + this.lastImage = this.image + this.imgNaturalWidth = this.img.naturalWidth + this.imgNaturalHeight = this.img.naturalHeight + this.drawImg(ctx) + return + } + } else if (this.img) { + if (this.TID && !this.elementLoaded) { + this.elementLoaded = true + Store.set(this.generateStoreKey('LT:addDiv'), this) + } + return + } + if (!this.image) { + return + } + let img = new Image() + img.crossOrigin = 'anonymous' + img.src = this.image + img.onload = function () { + _this.lastImage = _this.image + _this.imgNaturalWidth = img.naturalWidth + _this.imgNaturalHeight = img.naturalHeight + _this.img = img + images[_this.image] = { + img: img + } + Store.set(_this.generateStoreKey('LT:imageLoaded'), true) + if (!_this.gif && gif) { + _this.gif = true + if (_this.TID) { + _this.elementLoaded = true + Store.set(_this.generateStoreKey('LT:addDiv'), _this) + } + } + img = null + } + } + Node.prototype.calcAnchors = function () { + const _this = this + this.anchors = [] + if (anchorsFns[this.name]) { + anchorsFns[this.name](this) + } else { + defaultAnchors(this) + } + if (this.manualAnchors) { + this.manualAnchors.forEach(function (pt) { + const x = Math.abs(pt.x - _this.rect.center.x) + const y = Math.abs(pt.y - _this.rect.center.y) + if (x > y) { + if (pt.x < _this.rect.center.x) { + pt.direction = Direction.Left + } else { + pt.direction = Direction.Right + } + } else { + if (pt.y < _this.rect.center.y) { + pt.direction = Direction.Up + } else { + pt.direction = Direction.Bottom + } + } + _this.anchors.push(pt) + }) + } + this.calcRotateAnchors() + } + Node.prototype.calcRotateAnchors = function (angle) { + if (angle === undefined) { + angle = this.rotate + } + this.rotatedAnchors = [] + for (let _i = 0, _a = this.anchors; _i < _a.length; _i++) { + const item = _a[_i] + this.rotatedAnchors.push(item.clone().rotate(angle, this.rect.center)) + } + } + Node.prototype.getTextRect = function () { + let textRect = this.textRect + if (!this.icon && !this.image) { + textRect = this.fullTextRect + } + return textRect + } + Node.prototype.getIconRect = function () { + let rect = this.iconRect + if (!this.text) { + rect = this.fullIconRect || this.fullTextRect || this.rect + } + return rect + } + // 根据父节点rect计算自己(子节点)的rect + Node.prototype.calcRectByParent = function (parent) { + if (!this.rectInParent) { + return + } + const parentW = parent.rect.width - parent.paddingLeftNum - parent.paddingRightNum + const parentH = parent.rect.height - parent.paddingTopNum - parent.paddingBottomNum + let x = parent.rect.x + + parent.paddingLeftNum + + abs(parentW, this.rectInParent.x) + + abs(parentW, this.rectInParent.marginLeft) + let y = parent.rect.y + + parent.paddingTopNum + + abs(parentH, this.rectInParent.y) + + abs(parentW, this.rectInParent.marginTop) + const w = abs(parentW, this.rectInParent.width) + const h = abs(parentH, this.rectInParent.height) + if (this.rectInParent.marginLeft === undefined && + this.rectInParent.marginRight) { + x -= abs(parentW, this.rectInParent.marginRight) + } + if (this.rectInParent.marginTop === undefined && + this.rectInParent.marginBottom) { + y -= abs(parentW, this.rectInParent.marginBottom) + } + this.rect = new Rect(x, y, w, h) + if (!this.rectInParent.rotate) { + this.rectInParent.rotate = 0 + } + const offsetR = parent.rotate + parent.offsetRotate + this.rotate = this.rectInParent.rotate + offsetR + if (!this.rectInParent.rect) { + this.rectInParent.rect = this.rect.clone() + } + } + Node.prototype.calcChildrenRect = function () { + if (!this.children) { + return + } + for (let _i = 0, _a = this.children; _i < _a.length; _i++) { + const item = _a[_i] + item.calcRectByParent(this) + if (item.type === PenType.Node) { + item.init() + item.calcChildrenRect() + } + } + } + Node.prototype.calcRectInParent = function (parent) { + const parentW = parent.rect.width - parent.paddingLeftNum - parent.paddingRightNum + const parentH = parent.rect.height - parent.paddingTopNum - parent.paddingBottomNum + this.rectInParent = { + x: ((this.rect.x - parent.rect.x - parent.paddingLeftNum) * 100) / + parentW + + '%', + y: ((this.rect.y - parent.rect.y - parent.paddingTopNum) * 100) / parentH + + '%', + width: (this.rect.width * 100) / parentW + '%', + height: (this.rect.height * 100) / parentH + '%', + rotate: this.rectInParent + ? this.rectInParent.rotate || 0 + : this.rotate || 0, + rect: this.rect.clone() + } + } + // getDockWatchers() { + // this.dockWatchers = this.rect.toPoints(); + // this.dockWatchers.unshift(this.rect.center); + // } + Node.prototype.initAnimate = function () { + if (!this.animateFrames) { + return + } + let passed = 0 + for (let i = 0; i < this.animateFrames.length; ++i) { + this.animateFrames[i].start = passed + passed += this.animateFrames[i].duration + this.animateFrames[i].end = passed + this.animateFrames[i].initState = Node.cloneState(i ? this.animateFrames[i - 1].state : this) + this.animateFrames[i].offsetRect = new Rect(this.animateFrames[i].state.rect.x - + this.animateFrames[i].initState.rect.x, this.animateFrames[i].state.rect.y - + this.animateFrames[i].initState.rect.y, this.animateFrames[i].state.rect.width - + this.animateFrames[i].initState.rect.width, this.animateFrames[i].state.rect.height - + this.animateFrames[i].initState.rect.height) + } + this.animateDuration = passed + this.animateReady = Node.cloneState(this) + this.animatePos = 0 + this.animateFrame = 0 + } + Node.prototype.pauseAnimate = function () { + this.animateFrame = this._animateFrame + this.animatePos = this._animatePos + Store.set(this.generateStoreKey('LT:AnimatePlay'), { + pen: this, + stop: true + }) + } + Node.prototype.stopAnimate = function () { + this.animateStart = 0 + Store.set(this.generateStoreKey('LT:AnimatePlay'), { + pen: this, + stop: true + }) + this.restore() + this.initAnimate() + Store.set(this.generateStoreKey('LT:render'), { + pen: this, + stop: true + }) + } + Node.prototype.animate = function (now) { + const _this = this + if (this.animateStart < 1) { + return + } + let timeline = now - this.animateStart + if (this.animateFrame > 0) { + this.animateFrames.forEach(function (item, index) { + if (_this.animateFrame < index + 1) { + timeline += item.duration + } + }) + timeline += this.animatePos + } + // Finished on animate. + if (timeline > this.animateDuration) { + this.animatePos = 0 + this.animateFrame = 0 + this.restore() + if (this.animateCycle > 0 && + ++this.animateCycleIndex >= this.animateCycle) { + this.animateStart = 0 + this.animateCycleIndex = 0 + Store.set(this.generateStoreKey('animateEnd'), this) + if (!this.animateAlone) { + Store.set(this.generateStoreKey('LT:rectChanged'), this) + } + return + } + this.animateStart = now + timeline = 0 + } + let rectChanged = false + for (let i = 0; i < this.animateFrames.length; ++i) { + const item = this.animateFrames[i] + if (timeline >= item.start && timeline < item.end) { + item.state.dash && (this.dash = item.state.dash) + item.state.strokeStyle && (this.strokeStyle = item.state.strokeStyle) + item.state.fillStyle && (this.fillStyle = item.state.fillStyle) + item.state.text && (this.text = item.state.text) + item.state.fontColor && (this.fontColor = item.state.fontColor) + item.state.fontFamily && (this.fontFamily = item.state.fontFamily) + item.state.fontSize && (this.fontSize = item.state.fontSize) + item.state.lineHeight && (this.lineHeight = item.state.lineHeight) + item.state.fontStyle && (this.fontStyle = item.state.fontStyle) + item.state.fontWeight && (this.fontWeight = item.state.fontWeight) + item.state.textAlign && (this.textAlign = item.state.textAlign) + item.state.textBaseline && + (this.textBaseline = item.state.textBaseline) + item.state.textBackground && + (this.textBackground = item.state.textBackground) + item.state.iconFamily && (this.iconFamily = item.state.iconFamily) + item.state.icon && (this.icon = item.state.icon) + item.state.iconSize && (this.iconSize = item.state.iconSize) + item.state.iconColor && (this.iconColor = item.state.iconColor) + this.visible = item.state.visible + this._animateFrame = i + 1 + if (this._animateFrame > this.animateFrame) { + this.animateFrame = 0 + this.animatePos = 0 + } + this._animatePos = timeline - item.start + const rate = this._animatePos / item.duration + if (item.linear) { + if (item.state.rect.x !== item.initState.rect.x) { + this.rect.x = item.initState.rect.x + item.offsetRect.x * rate + rectChanged = true + } + if (item.state.rect.y !== item.initState.rect.y) { + this.rect.y = item.initState.rect.y + item.offsetRect.y * rate + rectChanged = true + } + if (item.state.rect.width !== item.initState.rect.width) { + this.rect.width = + item.initState.rect.width + item.offsetRect.width * rate + rectChanged = true + } + if (item.state.rect.height !== item.initState.rect.height) { + this.rect.height = + item.initState.rect.height + item.offsetRect.height * rate + rectChanged = true + } + this.rect.ex = this.rect.x + this.rect.width + this.rect.ey = this.rect.y + this.rect.height + this.rect.calcCenter() + if (item.initState.z !== undefined && + item.state.z !== item.initState.z) { + this.z = + item.initState.z + (item.state.z - item.initState.z) * rate + rectChanged = true + } + if (item.state.borderRadius !== item.initState.borderRadius) { + this.borderRadius = + item.initState.borderRadius + + (item.state.borderRadius - item.initState.borderRadius) * rate + } + if (item.state.lineWidth !== item.initState.lineWidth) { + this.lineWidth = + item.initState.lineWidth + + (item.state.lineWidth - item.initState.lineWidth) * rate + } + if (item.state.rotate !== item.initState.rotate) { + this.rotate = + item.initState.rotate + + (item.state.rotate - item.initState.rotate) * rate + rectChanged = true + } + if (item.state.globalAlpha !== item.initState.globalAlpha) { + this.globalAlpha = + item.initState.globalAlpha + + (item.state.globalAlpha - item.initState.globalAlpha) * rate + } + if (item.state.lineDashOffset) { + if (!this.lineDashOffset) { + this.lineDashOffset = item.state.lineDashOffset + } else { + this.lineDashOffset += item.state.lineDashOffset + } + } + if (item.state.value !== item.initState.value) { + this.value = + (item.initState.value || 0) + + ((item.state.value || 0) - (item.initState.value || 0)) * rate + } + if (item.state.num !== item.initState.num) { + this.num = + (item.initState.num || 0) + + ((item.state.num || 0) - (item.initState.num || 0)) * rate + } + if (item.state.num1 !== item.initState.num1) { + this.num1 = + (item.initState.num1 || 0) + + ((item.state.num1 || 0) - (item.initState.num1 || 0)) * rate + } + if (item.state.num2 !== item.initState.num2) { + this.num2 = + (item.initState.num2 || 0) + + ((item.state.num2 || 0) - (item.initState.num2 || 0)) * rate + } + if (item.state.num3 !== item.initState.num3) { + this.num3 = + (item.initState.num3 || 0) + + ((item.state.num3 || 0) - (item.initState.num3 || 0)) * rate + } + if (item.state.data) { + for (const key in item.state.data) { + if (typeof item.state.data[key] === 'number') { + this.data[key] = + (item.initState.data[key] || 0) + + ((item.state.data[key] || 0) - + (item.initState.data[key] || 0)) * + rate + } else if (item.state.data[key] !== undefined && + item.state.data[key] !== undefined) { + this.data[key] = item.state.data[key] + } + } + } + } else { + this.rect = item.state.rect + this.lineWidth = item.state.lineWidth + this.rotate = item.state.rotate + this.globalAlpha = item.state.globalAlpha + this.lineDashOffset = item.state.lineDashOffset + } + } + } + if (rectChanged) { + this.init(true) + if (!this.animateAlone) { + Store.set(this.generateStoreKey('LT:rectChanged'), this) + } + } + } + Node.prototype.scale = function (scale, center) { + if (!center) { + center = this.rect.center + } + this.oldRect = this.rect.clone() + this.rect.x = center.x - (center.x - this.rect.x) * scale + this.rect.y = center.y - (center.y - this.rect.y) * scale + this.textOffsetX *= scale + this.textOffsetY *= scale + this.z *= scale + this.rect.width *= scale + this.rect.height *= scale + this.rect.ex = this.rect.x + this.rect.width + this.rect.ey = this.rect.y + this.rect.height + this.lineWidth *= scale + if (this.imageWidth) { + this.imageWidth *= scale + } + if (this.imageHeight) { + this.imageHeight *= scale + } + this.lastImage = undefined + this.fontSize *= scale + this.iconSize *= scale + if (typeof this.paddingLeft === 'number') { + this.paddingLeft *= scale + } + if (typeof this.paddingTop === 'number') { + this.paddingTop *= scale + } + if (typeof this.paddingRight === 'number') { + this.paddingRight *= scale + } + if (typeof this.paddingBottom === 'number') { + this.paddingBottom *= scale + } + if (this.rectInParent) { + if (typeof this.rectInParent.x === 'number') { + this.rectInParent.x *= scale + } + if (typeof this.rectInParent.y === 'number') { + this.rectInParent.y *= scale + } + if (typeof this.rectInParent.width === 'number') { + this.rectInParent.width *= scale + } + if (typeof this.rectInParent.height === 'number') { + this.rectInParent.height *= scale + } + if (typeof this.rectInParent.marginLeft === 'number') { + this.rectInParent.marginLeft *= scale + } + if (typeof this.rectInParent.marginTop === 'number') { + this.rectInParent.marginTop *= scale + } + if (typeof this.rectInParent.marginRight === 'number') { + this.rectInParent.marginRight *= scale + } + if (typeof this.rectInParent.marginBottom === 'number') { + this.rectInParent.marginBottom *= scale + } + } + this.rect.calcCenter() + if (this.animateFrames && this.animateFrames.length) { + for (let _i = 0, _a = this.animateFrames; _i < _a.length; _i++) { + var item = _a[_i] + if (item.initState) { + if (!item.initState.scale) { + item.initState = new Node(item.initState) + } + item.initState.scale(scale, center) + } + if (item.state) { + if (!item.state.scale) { + item.state = new Node(item.state) + } + item.state.scale(scale, center) + } + if (item.initState && item.state) { + item.state.fontSize = item.initState.fontSize + } + } + } + this.scalePoints(scale, scale) + this.elementRendered = false + this.init() + if (this.children) { + for (let _b = 0, _c = this.children; _b < _c.length; _b++) { + var item = _c[_b] + item.scale(scale, center) + } + } + if (this.animateReady && this.animateReady.scale) { + this.animateReady.scale(scale, center) + } + } + Node.prototype.scalePoints = function (scaleX, scaleY) { + const _this = this + if ((this.points || this.manualAnchors) && this.oldRect) { + if (!scaleX) { + scaleX = this.rect.width / this.oldRect.width + } + if (!scaleY) { + scaleY = this.rect.height / this.oldRect.height + } + if (this.points) { + this.points.forEach(function (pt) { + pt.x = _this.rect.x + (pt.x - _this.oldRect.x) * scaleX + pt.y = _this.rect.y + (pt.y - _this.oldRect.y) * scaleY + }) + } + if (this.manualAnchors) { + this.manualAnchors.forEach(function (pt) { + pt.x = _this.rect.x + (pt.x - _this.oldRect.x) * scaleX + pt.y = _this.rect.y + (pt.y - _this.oldRect.y) * scaleY + }) + } + } + } + Node.prototype.translate = function (x, y) { + this.rect.x += x + this.rect.y += y + this.rect.ex = this.rect.x + this.rect.width + this.rect.ey = this.rect.y + this.rect.height + this.rect.calcCenter() + if (this.animateReady) { + this.animateReady.translate(x, y) + } + if (this.animateFrames && this.animateFrames.length) { + for (let _i = 0, _a = this.animateFrames; _i < _a.length; _i++) { + const frame = _a[_i] + const initState = frame.initState; const state = frame.state + if (initState && initState.translate) { + initState.translate(x, y) + } + if (state && state.translate) { + state.translate(x, y) + } + } + } + if (this.points) { + this.points.forEach(function (pt) { + pt.x += x + pt.y += y + }) + } + if (this.manualAnchors) { + this.manualAnchors.forEach(function (pt) { + pt.x += x + pt.y += y + }) + } + this.init() + if (this.children) { + for (let _b = 0, _c = this.children; _b < _c.length; _b++) { + const item = _c[_b] + item.translate(x, y) + } + } + } + Node.prototype.initRect = function () { + this.rect.init() + if (this.children) { + this.calcChildrenRect() + for (let _i = 0, _a = this.children; _i < _a.length; _i++) { + const item = _a[_i] + if (item instanceof Node) { + item.initRect() + } + } + } + } + Node.prototype.pushPoint = function (pt) { + const _this = this + this.points.push(pt) + if (!this.rect) { + this.rect = new Rect(0, 0, 0, 0) + } + this.points.forEach(function (p) { + if (!_this.rect.x || _this.rect.x > p.x) { + _this.rect.x = p.x + } + if (!_this.rect.y || _this.rect.y > p.y) { + _this.rect.y = p.y + } + if (_this.rect.ex < p.x) { + _this.rect.ex = p.x + } + if (_this.rect.ey < p.y) { + _this.rect.ey = p.y + } + }) + this.rect.width = this.rect.ex - this.rect.x + this.rect.height = this.rect.ey - this.rect.y + } + Node.prototype.nearestAnchor = function (pt) { + let dis = 99999 + let index = 0 + for (let i = 0; i < this.rotatedAnchors.length; ++i) { + const d = distance(pt, this.rotatedAnchors[i]) + if (dis > d) { + dis = d + index = i + } + } + return { + index: index, + direction: this.rotatedAnchors[index].direction + } + } + Node.prototype.hitInSelf = function (point, padding) { + if (padding === void 0) { padding = 0 } + if (this.rotate % 360 === 0) { + return this.rect.hit(point, padding) + } + const pts = this.rect.toPoints() + for (let _i = 0, pts_1 = pts; _i < pts_1.length; _i++) { + const pt = pts_1[_i] + pt.rotate(this.rotate, this.rect.center) + } + return pointInRect(point, pts) + } + Node.prototype.hit = function (pt, padding) { + if (padding === void 0) { padding = 0 } + let node + if (this.hitInSelf(pt, padding)) { + node = this + } + if (this.children) { + const len = this.children.length + for (let i = len - 1; i > -1; --i) { + const pen = this.children[i] + const p = pen.hit(pt, padding) + if (p) { + node = p + break + } + } + } + return node + } + Node.prototype.round = function () { + this.rect.round() + if (this.children) { + for (let _i = 0, _a = this.children; _i < _a.length; _i++) { + const item = _a[_i] + item.rect.round() + } + } + } + Node.prototype.clone = function () { + const n = new Node(this) + n.setTID(this.TID) + n.elementRendered = false + n.elementLoaded = false + if (this.name !== 'div') { + n.elementId = '' + } + return n + } + return Node +}(Pen)) +export { Node } +// # sourceMappingURL=node.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/node.js.map b/nezha-fronted/src/components/common/@topology/core/src/models/node.js.map new file mode 100644 index 000000000..3e5c5a706 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/node.js.map @@ -0,0 +1 @@ +{"version":3,"file":"node.js","sourceRoot":"","sources":["../../../../packages/core/src/models/node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,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AE,CAAC;SAClB;QACD,OAAO,CAAC,CAAC;IACX,CAAC;IACH,WAAC;AAAD,CAAC,AAvvCD,CAA0B,GAAG,GAuvC5B"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/pen.d.ts b/nezha-fronted/src/components/common/@topology/core/src/models/pen.d.ts new file mode 100644 index 000000000..caabf199b --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/pen.d.ts @@ -0,0 +1,172 @@ +import { Rect } from './rect'; +import { EventType, EventAction } from './event'; +import { Lock } from './status'; +export declare enum PenType { + Node = 0, + Line = 1 +} +export interface Action { + do?: string; + url?: string; + _blank?: string; + tag?: string; + fn?: string | Function; + params?: any; +} +export interface Event { + type: EventType; + action: EventAction; + value: string | Function; + params: string; + name?: string; +} +export interface Where { + key?: string; + comparison?: string; + value?: any; + fn?: string | Function; + actions?: Action[]; +} +export declare const images: { + [key: string]: { + img: HTMLImageElement; + }; +}; +export declare abstract class Pen { + TID: string; + id: string; + type: PenType; + name: string; + tags: string[]; + rect: Rect; + lineWidth: number; + rotate: number; + offsetRotate: number; + globalAlpha: number; + dash: number; + lineDash: number[]; + lineDashOffset: number; + strokeStyle: string; + fillStyle: string; + lineCap: string; + fontColor: string; + fontFamily: string; + fontSize: number; + lineHeight: number; + fontStyle: string; + fontWeight: string; + textAlign: string; + textBaseline: string; + textBackground: string; + text: string; + textMaxLine: number; + whiteSpace: string; + autoRect: boolean; + textRect: Rect; + fullTextRect: Rect; + textOffsetX: number; + textOffsetY: number; + shadowColor: string; + shadowBlur: number; + shadowOffsetX: number; + shadowOffsetY: number; + animateFn: string | Function; + animateType: string; + animateStart: number; + animateCycle: number; + animateCycleIndex: number; + nextAnimate: string; + animatePlay: boolean; + animatePos: number; + animateReverse: boolean; + locked: Lock; + stand: boolean; + hideInput: boolean; + hideRotateCP: boolean; + hideSizeCP: boolean; + hideAnchor: boolean; + markdown: string; + tipId: string; + title: string; + events: Event[]; + wheres: Where[]; + parentId: string; + rectInParent: { + x: number | string; + y: number | string; + width: number | string; + height: number | string; + marginTop?: number | string; + marginRight?: number | string; + marginBottom?: number | string; + marginLeft?: number | string; + rotate: number; + rect?: Rect; + }; + strokeType: number; + lineGradientFromColor: string; + lineGradientToColor: string; + lineGradientAngle: number; + paddingTopNum: number; + paddingBottomNum: number; + paddingLeftNum: number; + paddingRightNum: number; + visible: boolean; + fillImage: string; + strokeImage: string; + fillImg: HTMLImageElement; + strokeImg: HTMLImageElement; + lastFillImage: string; + lastStrokeImage: string; + children: Pen[]; + data: any; + value: number; + num: number; + num1: number; + num2: number; + num3: number; + fromData(defaultData: any, json: any): void; + render(ctx: CanvasRenderingContext2D): void; + loadFillImg(): void; + loadStrokeImg(): void; + click(): void; + dblclick(): void; + moveIn(): void; + moveOut(): void; + doWheres(): void; + doAction(action: any): void; + show(): this; + hide(): this; + isVisible(): boolean; + getTID(): string; + setTID(id: string): this; + startAnimate(): void; + play(pause?: boolean): void; + private link; + private doStartAnimate; + private doPauseAnimate; + private doStopAnimate; + private doFn; + private doWindowFn; + private doEmit; + generateStoreKey(key: any): string; + abstract getTextRect(): Rect; + abstract calcRectInParent(parent: Pen): void; + abstract calcRectByParent(parent: Pen): void; + abstract draw(ctx: CanvasRenderingContext2D): void; + abstract translate(x: number, y: number, noAnimate?: boolean): void; + abstract scale(scale: number, center?: { + x: number; + y: number; + }): void; + abstract hit(point: { + x: number; + y: number; + }, padding?: number): any; + abstract clone(): Pen; + abstract initAnimate(): void; + abstract animate(now: number): void; + abstract pauseAnimate(): void; + abstract stopAnimate(): void; + abstract strokeLinearGradient(ctx: CanvasRenderingContext2D): void; +} diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/pen.js b/nezha-fronted/src/components/common/@topology/core/src/models/pen.js new file mode 100644 index 000000000..4dc05fe2d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/pen.js @@ -0,0 +1,440 @@ +import { Store } from 'le5le-store' +import { s8 } from '../utils/uuid' +import { Rect } from './rect' +import { EventType } from './event' +import { deepClone } from '../utils/clone' +export var PenType; +(function (PenType) { + PenType[PenType.Node = 0] = 'Node' + PenType[PenType.Line = 1] = 'Line' +})(PenType || (PenType = {})) +const eventFns = [ + 'link', + 'doStartAnimate', + 'doFn', + 'doWindowFn', + '', + 'doPauseAnimate', + 'doStopAnimate', + 'doEmit' +] +const defaultPen = { + name: '', + tags: [], + visible: true, + rect: new Rect(0, 0, 0, 0), + fontColor: '', + fontFamily: '"Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial', + fontSize: 12, + lineHeight: 1.5, + fontStyle: 'normal', + fontWeight: 'normal', + textAlign: 'center', + textBaseline: 'middle', + textBackground: '', + animateCycleIndex: 0, + events: [], + dash: 0, + lineDashOffset: 0, + lineWidth: 1, + strokeStyle: '', + fillStyle: '', + globalAlpha: 1, + rotate: 0, + offsetRotate: 0, + textMaxLine: 0, + textOffsetX: 0, + textOffsetY: 0, + animatePos: 0 +} +export var images = {} +const Pen = /** @class */ (function () { + function Pen () { + } + Pen.prototype.fromData = function (defaultData, json) { + if (!json) { + json = {} + } else if (typeof json === 'string') { + json = JSON.parse(json) + } + defaultPen.id = s8() + defaultData = Object.assign({}, defaultPen, defaultData) + for (var key in defaultData) { + this[key] = defaultData[key] + } + for (var key in json) { + this[key] = json[key] + } + if (Array.isArray(this.tags)) { + this.tags = Object.assign([], this.tags) + } + if (this.rect) { + this.rect = new Rect(this.rect.x, this.rect.y, this.rect.width, this.rect.height) + } + this.lineWidth = this.lineWidth || 1 + // 兼容老格式 + if (!this.fontColor && json.font) { + this.fontColor = json.font.color || this.fontColor + this.fontFamily = json.font.fontFamily || this.fontFamily + this.fontSize = json.font.fontSize || this.fontSize + this.lineHeight = json.font.lineHeight || this.lineHeight + this.fontStyle = json.font.fontStyle || this.fontStyle + this.fontWeight = json.font.fontWeight || this.fontWeight + this.textAlign = json.font.textAlign || this.textAlign + this.textBaseline = json.font.textBaseline || this.textBaseline + this.textBackground = json.font.background || this.textBackground + delete this.font + } + // end + if (this.events) { + this.events = deepClone(this.events) + } + if (this.wheres) { + this.wheres = deepClone(this.wheres) + } + if (typeof this.data === 'object') { + this.data = JSON.parse(JSON.stringify(this.data)) + } + delete this.img + delete this.animateStart + delete this.animateReady + } + Pen.prototype.render = function (ctx) { + if (!this.visible) { + return + } + if (this.from && !this.to) { + if (this.children) { + for (let _i = 0, _a = this.children; _i < _a.length; _i++) { + var item = _a[_i] + item.render(ctx) + } + } + return + } + ctx.save() + // for canvas2svg + if (ctx.setAttrs) { + ctx.setAttrs(this) + } + // end + if (this.rotate || this.offsetRotate) { + ctx.translate(this.rect.center.x, this.rect.center.y) + ctx.rotate(((this.rotate + this.offsetRotate) * Math.PI) / 180) + ctx.translate(-this.rect.center.x, -this.rect.center.y) + } + if (this.lineWidth > 1) { + ctx.lineWidth = this.lineWidth + } + if (this.strokeImage) { + if (this.strokeImage === this.lastStrokeImage && this.strokeImg) { + ctx.strokeStyle = ctx.createPattern(this.strokeImg, 'repeat') + } else { + this.loadStrokeImg() + } + } else { + ctx.strokeStyle = + this.strokeStyle || Store.get(this.generateStoreKey('LT:color')) + } + if (this.fillImage) { + if (this.fillImage === this.lastFillImage && this.fillImg) { + ctx.fillStyle = ctx.createPattern(this.fillImg, 'repeat') + } else { + this.loadFillImg() + } + } else if (this.fillStyle) { + ctx.fillStyle = this.fillStyle + } + if (this.lineCap) { + ctx.lineCap = this.lineCap + } else if (this.type === PenType.Line) { + ctx.lineCap = 'round' + } + if (this.globalAlpha < 1) { + ctx.globalAlpha = this.globalAlpha + } + if (this.lineDash) { + ctx.setLineDash(this.lineDash) + } else { + switch (this.dash) { + case 1: + ctx.setLineDash([5, 5]) + break + case 2: + ctx.setLineDash([10, 10]) + break + case 3: + ctx.setLineDash([10, 10, 2, 10]) + break + case 4: + ctx.setLineDash([1, 16]) + break + } + } + if (this.lineDashOffset) { + ctx.lineDashOffset = this.lineDashOffset + } + if (this.shadowColor) { + ctx.shadowColor = this.shadowColor + ctx.shadowOffsetX = this.shadowOffsetX + ctx.shadowOffsetY = this.shadowOffsetY + ctx.shadowBlur = this.shadowBlur + } + this.draw(ctx) + ctx.restore() + if (this.children) { + for (let _b = 0, _c = this.children; _b < _c.length; _b++) { + var item = _c[_b] + item.render(ctx) + } + } + } + Pen.prototype.loadFillImg = function () { + const _this = this + if (!this.fillImage) { + return + } + let img = new Image() + img.crossOrigin = 'anonymous' + img.src = this.fillImage + img.onload = function () { + _this.lastFillImage = _this.fillImage + _this.fillImg = img + images[_this.fillImage] = { + img: img + } + Store.set(_this.generateStoreKey('LT:imageLoaded'), true) + img = null + } + } + Pen.prototype.loadStrokeImg = function () { + const _this = this + if (!this.strokeImage) { + return + } + let img = new Image() + img.crossOrigin = 'anonymous' + img.src = this.strokeImage + img.onload = function () { + _this.lastStrokeImage = _this.strokeImage + _this.strokeImg = img + images[_this.strokeImage] = { + img: img + } + Store.set(_this.generateStoreKey('LT:imageLoaded'), true) + img = null + } + } + Pen.prototype.click = function () { + if (!this.events) { + return + } + for (let _i = 0, _a = this.events; _i < _a.length; _i++) { + const item = _a[_i] + if (item.type !== EventType.Click) { + continue + } + this[eventFns[item.action]] && + this[eventFns[item.action]](item.value, item.params) + } + } + Pen.prototype.dblclick = function () { + if (!this.events) { + return + } + for (let _i = 0, _a = this.events; _i < _a.length; _i++) { + const item = _a[_i] + if (item.type !== EventType.DblClick) { + continue + } + this[eventFns[item.action]] && + this[eventFns[item.action]](item.value, item.params) + } + } + Pen.prototype.moveIn = function () { + if (!this.events) { + return + } + for (let _i = 0, _a = this.events; _i < _a.length; _i++) { + const item = _a[_i] + if (item.type !== EventType.MoveIn) { + continue + } + this[eventFns[item.action]] && + this[eventFns[item.action]](item.value, item.params) + } + } + Pen.prototype.moveOut = function () { + if (!this.events) { + return + } + for (let _i = 0, _a = this.events; _i < _a.length; _i++) { + const item = _a[_i] + if (item.type !== EventType.MoveOut) { + continue + } + this[eventFns[item.action]] && + this[eventFns[item.action]](item.value, item.params) + } + } + Pen.prototype.doWheres = function () { + const _this = this + if (!this.wheres) { + return + } + this.wheres.forEach(function (where) { + if (where.fn instanceof Function) { // 函数类型 fn + if (where.fn(_this)) { + where.actions && + where.actions.forEach(function (action) { + _this.doAction(action) + }) + } + } else if (where.fn && where.fn.trim()) { // 字符串类型 fn + var fn = new Function('pen', where.fn) + if (fn(_this)) { + where.actions && + where.actions.forEach(function (action) { + _this.doAction(action) + }) + } + } else { // fn 为空 + var fn = new Function('attr', 'return attr ' + where.comparison + ' ' + where.value) + if (fn(_this[where.key])) { + where.actions && + where.actions.forEach(function (action) { + _this.doAction(action) + }) + } + } + }) + } + Pen.prototype.doAction = function (action) { + switch (action.do || action.action) { + case 0: + case 'Link': + this.link(action.url || action.value, action._blank || action.params) + break + case 1: + case 'StartAnimate': + this.doStartAnimate(action.tag || action.value) + break + case 5: + case 'PauseAnimate': + this.doPauseAnimate(action.tag || action.value) + break + case 6: + case 'StopAnimate': + this.doStopAnimate(action.tag || action.value) + break + case 2: + case 'Function': + this.doFn(action.fn || action.value, action.params) + break + case 3: + case 'WindowFn': + this.doWindowFn(action.fn || action.value, action.params) + break + case 7: + case 'Emit': + this.doEmit(action.fn || action.value, action.params) + break + } + } + Pen.prototype.show = function () { + this.visible = true + return this + } + Pen.prototype.hide = function () { + this.visible = false + return this + } + Pen.prototype.isVisible = function () { + return this.visible + } + Pen.prototype.getTID = function () { + return this.TID + } + Pen.prototype.setTID = function (id) { + this.TID = id + if (this.children) { + for (let _i = 0, _a = this.children; _i < _a.length; _i++) { + const item = _a[_i] + item.setTID(id) + } + } + return this + } + Pen.prototype.startAnimate = function () { + this.animateStart = Date.now() + if (this.type === PenType.Node && !this.animateReady) { + this.initAnimate() + } + Store.set(this.generateStoreKey('LT:AnimatePlay'), { + pen: this + }) + // 跟随动画播放 + if (this.playType === 2) { + this.play() + } + } + Pen.prototype.play = function (pause) { + Store.set(this.generateStoreKey('LT:play'), { + pen: this, + pause: pause + }) + } + Pen.prototype.link = function (url, params) { + window.open(url, params === undefined ? '_blank' : params) + } + Pen.prototype.doStartAnimate = function (tag, params) { + if (tag) { + Store.set(this.generateStoreKey('LT:AnimatePlay'), { + tag: tag + }) + } else { + this.startAnimate() + } + } + Pen.prototype.doPauseAnimate = function (tag, params) { + if (tag) { + Store.set(this.generateStoreKey('LT:AnimatePlay'), { + tag: tag, + stop: true + }) + } else { + this.pauseAnimate() + } + } + Pen.prototype.doStopAnimate = function (tag, params) { + if (tag) { + Store.set(this.generateStoreKey('LT:AnimatePlay'), { + tag: tag, + stop: true + }) + } else { + this.stopAnimate() + } + } + Pen.prototype.doFn = function (fn, params) { + if (fn instanceof Function) { return fn(this, params) } + const func = new Function('pen', 'params', fn) + func(this, params) + } + Pen.prototype.doWindowFn = function (fn, params) { + window[fn](this, params) + } + Pen.prototype.doEmit = function (event, params) { + Store.set(this.generateStoreKey('LT:emit'), { + event: event, + params: params, + pen: this + }) + } + Pen.prototype.generateStoreKey = function (key) { + return this.TID + '-' + key + } + return Pen +}()) +export { Pen } +// # sourceMappingURL=pen.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/pen.js.map b/nezha-fronted/src/components/common/@topology/core/src/models/pen.js.map new file mode 100644 index 000000000..fa0145c8b --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/pen.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pen.js","sourceRoot":"","sources":["../../../../packages/core/src/models/pen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAe,MAAM,SAAS,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,MAAM,CAAN,IAAY,OAGX;AAHD,WAAY,OAAO;IACjB,qCAAI,CAAA;IACJ,qCAAI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IAAI,GAAa,IAAI,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;QACzD,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACrB,CAAC;IAEO,wBAAU,GAAlB,UAAmB,EAAU,EAAE,MAAc;QAC1C,MAAc,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACpC,CAAC;IAEO,oBAAM,GAAd,UAAe,KAAa,EAAE,MAAc;QAC1C,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE;YAC1C,KAAK,OAAA;YACL,MAAM,QAAA;YACN,GAAG,EAAE,IAAI;SACV,CAAC,CAAC;IACL,CAAC;IAED,8BAAgB,GAAhB,UAAiB,GAAG;QAClB,OAAU,IAAI,CAAC,GAAG,SAAI,GAAK,CAAC;IAC9B,CAAC;IAgBH,UAAC;AAAD,CAAC,AA5jBD,IA4jBC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/point.d.ts b/nezha-fronted/src/components/common/@topology/core/src/models/point.d.ts new file mode 100644 index 000000000..835b3f058 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/point.d.ts @@ -0,0 +1,29 @@ +import { Direction } from './direction'; +import { AnchorMode } from './status'; +export declare class Point { + x: number; + y: number; + id: number | string; + direction: Direction; + radius: number; + strokeStyle: string; + fillStyle: string; + anchorIndex: number; + autoAnchor: boolean; + hidden: boolean; + mode: AnchorMode; + data: any; + constructor(x: number, y: number, direction?: Direction, anchorIndex?: number, id?: number | string, hidden?: boolean, autoAnchor?: boolean); + floor(): void; + round(): void; + clone(): Point; + hit(pt: { + x: number; + y: number; + }, radius?: number): boolean; + rotate(angle: number, center: { + x: number; + y: number; + }): Point; + isSameAs(pt: Point): boolean; +} diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/point.js b/nezha-fronted/src/components/common/@topology/core/src/models/point.js new file mode 100644 index 000000000..a7bcfe7fb --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/point.js @@ -0,0 +1,53 @@ +const Point = /** @class */ (function () { + function Point (x, y, direction, anchorIndex, id, hidden, autoAnchor) { + this.x = x + this.y = y + this.direction = direction + this.anchorIndex = anchorIndex + this.id = id + this.hidden = hidden + this.autoAnchor = autoAnchor + } + Point.prototype.floor = function () { + this.x |= 0 + this.y |= 0 + } + Point.prototype.round = function () { + this.x = Math.round(this.x) + this.y = Math.round(this.y) + } + Point.prototype.clone = function () { + const pt = new Point(this.x, this.y, this.direction, this.anchorIndex, this.id, this.hidden, this.autoAnchor) + if (this.data) { + pt.data = this.data + } + if (this.mode) { + pt.mode = this.mode + } + return pt + } + Point.prototype.hit = function (pt, radius) { + if (radius === void 0) { radius = 5 } + return pt.x > this.x - radius && pt.x < this.x + radius && pt.y > this.y - radius && pt.y < this.y + radius + } + Point.prototype.rotate = function (angle, center) { + if (!angle || angle === 360) { + return this + } + angle *= Math.PI / 180 + const x = (this.x - center.x) * Math.cos(angle) - (this.y - center.y) * Math.sin(angle) + center.x + const y = (this.x - center.x) * Math.sin(angle) + (this.y - center.y) * Math.cos(angle) + center.y + this.x = x + this.y = y + return this + } + Point.prototype.isSameAs = function (pt) { + return this.anchorIndex === pt.anchorIndex && this.direction === pt.direction && this.id === pt.id + } + return Point +}()) +export { Point } +console.log(132123132123) +window.topologyPoint = Point +window.Le5leTopologyPoint = Point +// # sourceMappingURL=point.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/point.js.map b/nezha-fronted/src/components/common/@topology/core/src/models/point.js.map new file mode 100644 index 000000000..3eed3255e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/point.js.map @@ -0,0 +1 @@ +{"version":3,"file":"point.js","sourceRoot":"","sources":["../../../../packages/core/src/models/point.ts"],"names":[],"mappings":"AAGA;IAcE,eACS,CAAS,EACT,CAAS,EAChB,SAAqB,EACrB,WAAoB,EACpB,EAAoB,EACpB,MAA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C,aAAa,GAAG,KAAK,CAAC;AACrC,MAAc,CAAC,kBAAkB,GAAG,KAAK,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/rect.d.ts b/nezha-fronted/src/components/common/@topology/core/src/models/rect.d.ts new file mode 100644 index 000000000..5031bf89d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/rect.d.ts @@ -0,0 +1,31 @@ +import { Point } from './point'; +export declare class Rect { + x: number; + y: number; + width: number; + height: number; + ex: number; + ey: number; + center: Point; + constructor(x: number, y: number, width: number, height: number); + init(): void; + floor(): void; + round(): void; + clone(): Rect; + hit(pt: { + x: number; + y: number; + }, padding?: number): boolean; + hitByRect(rect: Rect): boolean; + hitRotate(point: { + x: number; + y: number; + }, rotate: number, center: Point): boolean; + calcCenter(): void; + toPoints(): Point[]; + translate(x: number, y: number): void; + scale(scale: number, center?: { + x: number; + y: number; + }, scaleY?: number): void; +} diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/rect.js b/nezha-fronted/src/components/common/@topology/core/src/models/rect.js new file mode 100644 index 000000000..ba64eb706 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/rect.js @@ -0,0 +1,94 @@ +import { Point } from './point' +import { pointInRect } from '../utils/canvas' +const Rect = /** @class */ (function () { + function Rect (x, y, width, height) { + this.x = x + this.y = y + this.width = width + this.height = height + this.center = new Point(0, 0) + if (width < 0) { + width = 0 + } + if (height < 0) { + height = 0 + } + this.init() + } + Rect.prototype.init = function () { + this.ex = this.x + this.width + this.ey = this.y + this.height + this.calcCenter() + } + Rect.prototype.floor = function () { + this.x |= 0 + this.y |= 0 + this.width |= 0 + this.height |= 0 + this.init() + } + Rect.prototype.round = function () { + this.x = Math.round(this.x) + this.y = Math.round(this.y) + this.width = Math.round(this.width) + this.height = Math.round(this.height) + this.init() + } + Rect.prototype.clone = function () { + return new Rect(this.x, this.y, this.width, this.height) + } + Rect.prototype.hit = function (pt, padding) { + if (padding === void 0) { padding = 0 } + return pt && pt.x > this.x - padding && pt.x < this.ex + padding && pt.y > this.y - padding && pt.y < this.ey + padding + } + Rect.prototype.hitByRect = function (rect) { + return ((rect.x > this.x && rect.x < this.ex && rect.y > this.y && rect.y < this.ey) || + (rect.ex > this.x && rect.ex < this.ex && rect.y > this.y && rect.y < this.ey) || + (rect.ex > this.x && rect.ex < this.ex && rect.ey > this.y && rect.ey < this.ey) || + (rect.x > this.x && rect.x < this.ex && rect.ey > this.y && rect.ey < this.ey)) + } + Rect.prototype.hitRotate = function (point, rotate, center) { + const pts = this.toPoints() + for (let _i = 0, pts_1 = pts; _i < pts_1.length; _i++) { + const pt = pts_1[_i] + pt.rotate(rotate, center) + } + return pointInRect(point, pts) + } + Rect.prototype.calcCenter = function () { + this.center.x = this.x + this.width / 2 + this.center.y = this.y + this.height / 2 + } + Rect.prototype.toPoints = function () { + return [ + new Point(this.x, this.y), + new Point(this.ex, this.y), + new Point(this.ex, this.ey), + new Point(this.x, this.ey) + ] + } + Rect.prototype.translate = function (x, y) { + this.x += x + this.y += y + this.ex += x + this.ey += y + this.calcCenter() + } + Rect.prototype.scale = function (scale, center, scaleY) { + if (!center) { + center = this.center + } + if (scaleY === undefined) { + scaleY = scale + } + this.x = center.x - (center.x - this.x) * scale + this.y = center.y - (center.y - this.y) * scaleY + this.width *= scale + this.height *= scaleY + this.init() + } + return Rect +}()) +export { Rect } +window.topologyRect = Rect +// # sourceMappingURL=rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/rect.js.map b/nezha-fronted/src/components/common/@topology/core/src/models/rect.js.map new file mode 100644 index 000000000..78289247c --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rect.js","sourceRoot":"","sources":["../../../../packages/core/src/models/rect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAA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AC,CAAC;QACZ,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;QACb,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;QACb,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAED,oBAAK,GAAL,UAAM,KAAa,EAAE,MAAkC,EAAE,MAAe;QACtE,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;SACtB;QAED,IAAI,MAAM,KAAK,SAAS,EAAE;YACxB,MAAM,GAAG,KAAK,CAAC;SAChB;QAED,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;QAChD,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;QACjD,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC;QACpB,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC;QACtB,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IACH,WAAC;AAAD,CAAC,AAnGD,IAmGC;;AAEA,MAAc,CAAC,YAAY,GAAG,IAAI,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/status.d.ts b/nezha-fronted/src/components/common/@topology/core/src/models/status.d.ts new file mode 100644 index 000000000..617a49a78 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/status.d.ts @@ -0,0 +1,11 @@ +export declare enum Lock { + None = 0, + Readonly = 1, + NoMove = 2, + NoEvent = 10 +} +export declare enum AnchorMode { + Default = 0, + In = 1, + Out = 2 +} diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/status.js b/nezha-fronted/src/components/common/@topology/core/src/models/status.js new file mode 100644 index 000000000..a449671f5 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/status.js @@ -0,0 +1,14 @@ +export var Lock; +(function (Lock) { + Lock[Lock.None = 0] = 'None' + Lock[Lock.Readonly = 1] = 'Readonly' + Lock[Lock.NoMove = 2] = 'NoMove' + Lock[Lock.NoEvent = 10] = 'NoEvent' +})(Lock || (Lock = {})) +export var AnchorMode; +(function (AnchorMode) { + AnchorMode[AnchorMode.Default = 0] = 'Default' + AnchorMode[AnchorMode.In = 1] = 'In' + AnchorMode[AnchorMode.Out = 2] = 'Out' +})(AnchorMode || (AnchorMode = {})) +// # sourceMappingURL=status.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/models/status.js.map b/nezha-fronted/src/components/common/@topology/core/src/models/status.js.map new file mode 100644 index 000000000..dce20eb24 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/models/status.js.map @@ -0,0 +1 @@ +{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../../packages/core/src/models/status.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,IAKX;AALD,WAAY,IAAI;IACd,+BAAI,CAAA;IACJ,uCAAQ,CAAA;IACR,mCAAM,CAAA;IACN,sCAAY,CAAA;AACd,CAAC,EALW,IAAI,KAAJ,IAAI,QAKf;AAED,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,iDAAO,CAAA;IACP,uCAAE,CAAA;IACF,yCAAG,CAAA;AACL,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/mqtt.d.ts b/nezha-fronted/src/components/common/@topology/core/src/mqtt.d.ts new file mode 100644 index 000000000..7089e1283 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/mqtt.d.ts @@ -0,0 +1,12 @@ +export declare class MQTT { + url: string; + options: any; + topics: string; + cb?: (topic: string, message: any) => void; + client: any; + fns: any; + constructor(url: string, options: any, topics: string, cb?: (topic: string, message: any) => void); + init(): void; + publish(topic: string, message: string): void; + close(): void; +} diff --git a/nezha-fronted/src/components/common/@topology/core/src/mqtt.js b/nezha-fronted/src/components/common/@topology/core/src/mqtt.js new file mode 100644 index 000000000..56806ee29 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/mqtt.js @@ -0,0 +1,27 @@ +import * as mqtt from 'mqtt/dist/mqtt.min.js' +const MQTT = /** @class */ (function () { + function MQTT (url, options, topics, cb) { + this.url = url + this.options = options + this.topics = topics + this.cb = cb + this.fns = {} + this.init() + } + MQTT.prototype.init = function () { + this.client = mqtt.connect(this.url, this.options) + this.client.on('message', this.cb) + if (this.topics) { + this.client.subscribe(this.topics.split(',')) + } + } + MQTT.prototype.publish = function (topic, message) { + this.client.publish(topic, message) + } + MQTT.prototype.close = function () { + this.client.end() + } + return MQTT +}()) +export { MQTT } +// # sourceMappingURL=mqtt.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/mqtt.js.map b/nezha-fronted/src/components/common/@topology/core/src/mqtt.js.map new file mode 100644 index 000000000..d03e6b660 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/mqtt.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mqtt.js","sourceRoot":"","sources":["../../../packages/core/src/mqtt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAE9C;IAGE,cAAmB,GAAW,EAAS,OAAY,EAAS,MAAc,EAAS,EAA0C;QAA1G,QAAG,GAAH,GAAG,CAAQ;QAAS,YAAO,GAAP,OAAO,CAAK;QAAS,WAAM,GAAN,MAAM,CAAQ;QAAS,OAAE,GAAF,EAAE,CAAwC;QAD7H,QAAG,GAAQ,EAAE,CAAC;QAEZ,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAED,mBAAI,GAAJ;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACnD,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QAEnC,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;SAC/C;IACH,CAAC;IAED,sBAAO,GAAP,UAAQ,KAAa,EAAE,OAAe;QACpC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IAED,oBAAK,GAAL;QACE,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;IACpB,CAAC;IACH,WAAC;AAAD,CAAC,AAvBD,IAuBC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/offscreen.d.ts b/nezha-fronted/src/components/common/@topology/core/src/offscreen.d.ts new file mode 100644 index 000000000..6eec612eb --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/offscreen.d.ts @@ -0,0 +1,14 @@ +import { Options } from './options'; +import { Canvas } from './canvas'; +import { ActiveLayer } from './activeLayer'; +import { HoverLayer } from './hoverLayer'; +import { AnimateLayer } from './animateLayer'; +export declare class Offscreen extends Canvas { + parentElem: HTMLElement; + options: Options; + activeLayer: ActiveLayer; + hoverLayer: HoverLayer; + animateLayer: AnimateLayer; + constructor(parentElem: HTMLElement, options: Options, TID: string); + render(): void; +} diff --git a/nezha-fronted/src/components/common/@topology/core/src/offscreen.js b/nezha-fronted/src/components/common/@topology/core/src/offscreen.js new file mode 100644 index 000000000..3c7e85f86 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/offscreen.js @@ -0,0 +1,54 @@ +import { Store } from 'le5le-store' +import { Canvas } from './canvas' +import { rectInRect } from './utils/rect' +import { Rect, PenType } from './models' +const __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b }) || + function (d, b) { for (const p in b) if (b.hasOwnProperty(p)) d[p] = b[p] } + return extendStatics(d, b) + } + return function (d, b) { + extendStatics(d, b) + function __ () { this.constructor = d } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()) + } +})() +const Offscreen = /** @class */ (function (_super) { + __extends(Offscreen, _super) + function Offscreen (parentElem, options, TID) { + if (options === void 0) { options = {} } + const _this = _super.call(this, parentElem, options, TID) || this + _this.parentElem = parentElem + _this.options = options + _this.activeLayer = Store.get(_this.generateStoreKey('LT:ActiveLayer')) + _this.hoverLayer = Store.get(_this.generateStoreKey('LT:HoverLayer')) + _this.animateLayer = Store.get(_this.generateStoreKey('LT:AnimateLayer')) + Store.set(_this.generateStoreKey('LT:offscreen'), _this.canvas) + return _this + } + Offscreen.prototype.render = function () { + _super.prototype.render.call(this) + const ctx = this.canvas.getContext('2d') + ctx.strokeStyle = this.options.color + const canvasRect = new Rect(-this.data.x, -this.data.y, this.width, this.height) + for (let _i = 0, _a = this.data.pens; _i < _a.length; _i++) { + const item = _a[_i] + if (!item.getTID()) { + item.setTID(this.TID) + } + // 连线类型没有 rect,必渲染 + if (!rectInRect(item.rect, canvasRect) && item.type === PenType.Node) { + continue + } + item.render(ctx) + } + this.activeLayer.render(ctx) + this.animateLayer.render(ctx) + this.hoverLayer.render(ctx) + } + return Offscreen +}(Canvas)) +export { Offscreen } +// # sourceMappingURL=offscreen.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/offscreen.js.map b/nezha-fronted/src/components/common/@topology/core/src/offscreen.js.map new file mode 100644 index 000000000..fe55c7ac5 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/offscreen.js.map @@ -0,0 +1 @@ +{"version":3,"file":"offscreen.js","sourceRoot":"","sources":["../../../packages/core/src/offscreen.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAA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CAAC,IAAI,CAAC,IAAI,EAAd,cAAc,EAAd,IAAc,EAAE;YAA9B,IAAM,IAAI,SAAA;YACb,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE;gBAClB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aACvB;YACD,kBAAkB;YAClB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI,EAAE;gBACpE,SAAS;aACV;YACD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SAClB;QAED,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC7B,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IACH,gBAAC;AAAD,CAAC,AAjCD,CAA+B,MAAM,GAiCpC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/options.d.ts b/nezha-fronted/src/components/common/@topology/core/src/options.d.ts new file mode 100644 index 000000000..69dece464 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/options.d.ts @@ -0,0 +1,72 @@ +export declare enum KeyType { + Any = -1, + CtrlOrAlt = 0, + Ctrl = 1, + Shift = 2, + Alt = 3, + Right = 4 +} +export declare enum KeydownType { + None = -1, + Document = 0, + Canvas = 1 +} +export declare type Padding = number | string | number[]; +export interface Options { + cacheLen?: number; + extDpiRatio?: number; + width?: string | number; + height?: string | number; + color?: string; + activeColor?: string; + hoverColor?: string; + anchorRadius?: number; + anchorFillStyle?: string; + dockStrokeStyle?: string; + dockFillStyle?: string; + dragColor?: string; + animateColor?: string; + fontColor?: string; + fontFamily?: string; + fontSize?: number; + lineHeight?: number; + textAlign?: string; + textBaseline?: string; + rotateCursor?: string; + hoverCursor?: string; + hideInput?: boolean; + hideRotateCP?: boolean; + hideSizeCP?: boolean; + hideAnchor?: boolean; + disableSizeX?: boolean; + disableSizeY?: boolean; + anchorSize?: number; + alwaysAnchor?: boolean; + autoAnchor?: boolean; + disableEmptyLine?: boolean; + disableRepeatLine?: boolean; + disableScale?: boolean; + disableTranslate?: boolean; + disableMoveOutParent?: boolean; + disableDockLine?: boolean; + playIcon?: string; + pauseIcon?: string; + fullScreenIcon?: string; + loopIcon?: string; + translateKey?: KeyType; + scaleKey?: KeyType; + minScale?: number; + maxScale?: number; + keydown?: KeydownType; + viewPadding?: Padding; + bkColor?: string; + grid?: boolean; + gridColor?: string; + gridSize?: number; + rule?: boolean; + ruleColor?: string; + refresh?: number; + on?: (event: string, data: any) => void; +} +export declare const fontKeys: string[]; +export declare const DefalutOptions: Options; diff --git a/nezha-fronted/src/components/common/@topology/core/src/options.js b/nezha-fronted/src/components/common/@topology/core/src/options.js new file mode 100644 index 000000000..07415d062 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/options.js @@ -0,0 +1,45 @@ +export var KeyType; +(function (KeyType) { + KeyType[KeyType.Any = -1] = 'Any' + KeyType[KeyType.CtrlOrAlt = 0] = 'CtrlOrAlt' + KeyType[KeyType.Ctrl = 1] = 'Ctrl' + KeyType[KeyType.Shift = 2] = 'Shift' + KeyType[KeyType.Alt = 3] = 'Alt' + KeyType[KeyType.Right = 4] = 'Right' +})(KeyType || (KeyType = {})) +export var KeydownType; +(function (KeydownType) { + KeydownType[KeydownType.None = -1] = 'None' + KeydownType[KeydownType.Document = 0] = 'Document' + KeydownType[KeydownType.Canvas = 1] = 'Canvas' +})(KeydownType || (KeydownType = {})) +export var fontKeys = ['fontColor', 'fontFamily', 'fontSize', 'lineHeight', 'textAlign', 'textBaseline'] +export var DefalutOptions = { + cacheLen: 30, + refresh: 30, + fontColor: '#222222', + fontFamily: '"Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial', + fontSize: 12, + lineHeight: 1.5, + textAlign: 'center', + textBaseline: 'middle', + color: '#222222', + activeColor: '#1890ff', + hoverColor: '#fa541c', + anchorRadius: 4, + anchorFillStyle: '#fff', + dockStrokeStyle: '#fa541c', + dockFillStyle: '#fa541c', + dragColor: '#1890ff', + rotateCursor: '/assets/img/rotate.cur', + hoverCursor: 'pointer', + minScale: 0.3, + maxScale: 5, + anchorSize: 5, + keydown: KeydownType.Document, + viewPadding: 0, + gridSize: 10, + gridColor: '#f3f3f3', + ruleColor: '#888888' +} +// # sourceMappingURL=options.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/options.js.map b/nezha-fronted/src/components/common/@topology/core/src/options.js.map new file mode 100644 index 000000000..e93c16a75 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/options.js.map @@ -0,0 +1 @@ +{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../packages/core/src/options.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,OAOX;AAPD,WAAY,OAAO;IACjB,oCAAQ,CAAA;IACR,+CAAS,CAAA;IACT,qCAAI,CAAA;IACJ,uCAAK,CAAA;IACL,mCAAG,CAAA;IACH,uCAAK,CAAA;AACP,CAAC,EAPW,OAAO,KAAP,OAAO,QAOlB;AAED,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,8CAAS,CAAA;IACT,qDAAQ,CAAA;IACR,iDAAM,CAAA;AACR,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB;AA6DD,MAAM,CAAC,IAAM,QAAQ,GAAG,CAAC,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;AAE3G,MAAM,CAAC,IAAM,cAAc,GAAY;IACrC,QAAQ,EAAE,EAAE;IACZ,OAAO,EAAE,EAAE;IACX,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,2EAA2E;IACvF,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,GAAG;IACf,SAAS,EAAE,QAAQ;IACnB,YAAY,EAAE,QAAQ;IACtB,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,SAAS;IACtB,UAAU,EAAE,SAAS;IACrB,YAAY,EAAE,CAAC;IACf,eAAe,EAAE,MAAM;IACvB,eAAe,EAAE,SAAS;IAC1B,aAAa,EAAE,SAAS;IACxB,SAAS,EAAE,SAAS;IACpB,YAAY,EAAE,wBAAwB;IACtC,WAAW,EAAE,SAAS;IACtB,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,CAAC;IACX,UAAU,EAAE,CAAC;IACb,OAAO,EAAE,WAAW,CAAC,QAAQ;IAC7B,WAAW,EAAE,CAAC;IACd,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;CACrB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/renderLayer.d.ts b/nezha-fronted/src/components/common/@topology/core/src/renderLayer.d.ts new file mode 100644 index 000000000..ccf218836 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/renderLayer.d.ts @@ -0,0 +1,16 @@ +import { Options } from './options'; +import { Canvas } from './canvas'; +import { TopologyData } from './models/data'; +export declare class RenderLayer extends Canvas { + parentElem: HTMLElement; + options: Options; + offscreen: any; + data: TopologyData; + bkImg: HTMLImageElement; + constructor(parentElem: HTMLElement, options: Options, TID: string); + loadBkImg(cb?: any): void; + clearBkImg(): void; + render: () => void; + rule(): void; + grid(): void; +} diff --git a/nezha-fronted/src/components/common/@topology/core/src/renderLayer.js b/nezha-fronted/src/components/common/@topology/core/src/renderLayer.js new file mode 100644 index 000000000..a59d4ea06 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/renderLayer.js @@ -0,0 +1,134 @@ +import { Store } from 'le5le-store' +import { Canvas } from './canvas' +import { rgba } from './utils/math' +import { Rect } from './models' +const __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b }) || + function (d, b) { for (const p in b) if (b.hasOwnProperty(p)) d[p] = b[p] } + return extendStatics(d, b) + } + return function (d, b) { + extendStatics(d, b) + function __ () { this.constructor = d } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()) + } +})() +const RenderLayer = /** @class */ (function (_super) { + __extends(RenderLayer, _super) + function RenderLayer (parentElem, options, TID) { + if (options === void 0) { options = {} } + const _this = _super.call(this, parentElem, options, TID) || this + _this.parentElem = parentElem + _this.options = options + _this.render = function () { + if (_this.data && _this.data.bkImage && !_this.bkImg) { + _this.loadBkImg(_this) + return + } + if (!_this.width || !_this.height || !_this.offscreen) { + return + } + const ctx = _this.canvas.getContext('2d') + ctx.clearRect(0, 0, _this.canvas.width, _this.canvas.height) + if (_this.data.bkColor || _this.options.bkColor) { + ctx.fillStyle = _this.data.bkColor || _this.options.bkColor + ctx.fillRect(0, 0, _this.width, _this.height) + } + if (_this.bkImg && _this.data.bkImageRect) { + ctx.drawImage(_this.bkImg, _this.data.bkImageRect.x, _this.data.bkImageRect.y, _this.data.bkImageRect.width, _this.data.bkImageRect.height) + } + if (_this.data.grid || _this.options.grid) { + _this.grid() + } + if (_this.data.rule || _this.options.rule) { + _this.rule() + } + ctx.drawImage(_this.offscreen, 0, 0, _this.width, _this.height) + } + _this.offscreen = Store.get(_this.generateStoreKey('LT:offscreen')) + _this.parentElem.appendChild(_this.canvas) + _this.data = Store.get(_this.generateStoreKey('topology-data')) + return _this + } + RenderLayer.prototype.loadBkImg = function (cb) { + const _this = this + if (!this.data.bkImage) { + return + } + this.bkImg = new Image() + this.bkImg.crossOrigin = 'anonymous' + this.bkImg.src = this.data.bkImage + this.bkImg.onload = function () { + if (!_this.data.bkImageRect) { + _this.data.bkImageRect = new Rect(0, 0, _this.bkImg.naturalWidth, _this.bkImg.naturalHeight) + } + if (cb) { + cb() + } + } + } + RenderLayer.prototype.clearBkImg = function () { + this.bkImg = undefined + } + RenderLayer.prototype.rule = function () { + const ctx = this.canvas.getContext('2d') + ctx.save() + ctx.lineWidth = 1 + ctx.strokeStyle = rgba(0.7, this.data.ruleColor || this.options.ruleColor || '#888') + ctx.beginPath() + for (var i = 10; i < this.width; i += 10) { + ctx.moveTo(i, 0) + ctx.lineTo(i, 5) + } + for (var i = 10; i < this.height; i += 10) { + ctx.moveTo(0, i) + ctx.lineTo(5, i) + } + ctx.stroke() + ctx.beginPath() + ctx.strokeStyle = this.data.ruleColor || this.options.ruleColor || '#888' + ctx.fillStyle = ctx.strokeStyle + for (var i = 100; i < this.width; i += 100) { + ctx.moveTo(i, 0) + ctx.lineTo(i, 10) + ctx.fillText(i.toString(), i + 4, 16) + } + for (var i = 100; i < this.height; i += 100) { + ctx.moveTo(0, i) + ctx.lineTo(10, i) + } + ctx.stroke() + for (var i = 100; i < this.height; i += 100) { + ctx.save() + ctx.beginPath() + ctx.translate(16, i - 4) + ctx.rotate((270 * Math.PI) / 180) + ctx.fillText(i.toString(), 0, 0) + ctx.restore() + } + ctx.restore() + } + RenderLayer.prototype.grid = function () { + const ctx = this.canvas.getContext('2d') + ctx.save() + ctx.lineWidth = 1 + ctx.strokeStyle = this.data.gridColor || this.options.gridColor || '#f3f3f3' + ctx.beginPath() + const size = this.data.gridSize || this.options.gridSize + for (var i = size; i < this.width; i += size) { + ctx.moveTo(i, 0) + ctx.lineTo(i, this.height) + } + for (var i = size; i < this.height; i += size) { + ctx.moveTo(0, i) + ctx.lineTo(this.width, i) + } + ctx.stroke() + ctx.restore() + } + return RenderLayer +}(Canvas)) +export { RenderLayer } +// # sourceMappingURL=renderLayer.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/renderLayer.js.map b/nezha-fronted/src/components/common/@topology/core/src/renderLayer.js.map new file mode 100644 index 000000000..d30e234e9 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/renderLayer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"renderLayer.js","sourceRoot":"","sources":["../../../packages/core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CAAC;QAEb,GAAG,CAAC,OAAO,EAAE,CAAC;IAChB,CAAC;IACH,kBAAC;AAAD,CAAC,AA/HD,CAAiC,MAAM,GA+HtC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/socket.d.ts b/nezha-fronted/src/components/common/@topology/core/src/socket.d.ts new file mode 100644 index 000000000..22278dac4 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/socket.d.ts @@ -0,0 +1,9 @@ +export declare class Socket { + url: string; + cb?: (e: any) => void; + socket: WebSocket; + fns: any; + constructor(url: string, cb?: (e: any) => void); + init(): void; + close(): void; +} diff --git a/nezha-fronted/src/components/common/@topology/core/src/socket.js b/nezha-fronted/src/components/common/@topology/core/src/socket.js new file mode 100644 index 000000000..19f2b8c44 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/socket.js @@ -0,0 +1,24 @@ +const Socket = /** @class */ (function () { + function Socket (url, cb) { + this.url = url + this.cb = cb + this.fns = {} + this.init() + } + Socket.prototype.init = function () { + const _this = this + this.socket = new WebSocket(this.url) + this.socket.onmessage = this.cb + this.socket.onclose = function () { + console.info('Canvas websocket closed and reconneting...') + _this.init() + } + } + Socket.prototype.close = function () { + this.socket.onclose = undefined + this.socket.close() + } + return Socket +}()) +export { Socket } +// # sourceMappingURL=socket.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/socket.js.map b/nezha-fronted/src/components/common/@topology/core/src/socket.js.map new file mode 100644 index 000000000..b5c0f1d9a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/socket.js.map @@ -0,0 +1 @@ +{"version":3,"file":"socket.js","sourceRoot":"","sources":["../../../packages/core/src/socket.ts"],"names":[],"mappings":"AAAA;IAGE,gBAAmB,GAAW,EAAS,EAAqB;QAAzC,QAAG,GAAH,GAAG,CAAQ;QAAS,OAAE,GAAF,EAAE,CAAmB;QAD5D,QAAG,GAAQ,EAAE,CAAC;QAEZ,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAED,qBAAI,GAAJ;QAAA,iBAQC;QAPC,IAAI,CAAC,MAAM,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtC,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,EAAE,CAAC;QAEhC,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG;YACpB,OAAO,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;YAC3D,KAAI,CAAC,IAAI,EAAE,CAAC;QACd,CAAC,CAAC;IACJ,CAAC;IAED,sBAAK,GAAL;QACE,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC;QAChC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;IACH,aAAC;AAAD,CAAC,AArBD,IAqBC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/browser.d.ts b/nezha-fronted/src/components/common/@topology/core/src/utils/browser.d.ts new file mode 100644 index 000000000..c2a694890 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/browser.d.ts @@ -0,0 +1 @@ +export declare function isMobile(): boolean; diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/browser.js b/nezha-fronted/src/components/common/@topology/core/src/utils/browser.js new file mode 100644 index 000000000..a7463d06b --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/browser.js @@ -0,0 +1,4 @@ +export function isMobile () { + return /Android|webOS|iPad|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) +} +// # sourceMappingURL=browser.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/browser.js.map b/nezha-fronted/src/components/common/@topology/core/src/utils/browser.js.map new file mode 100644 index 000000000..905523eb5 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../../../packages/core/src/utils/browser.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ;IACtB,OAAO,4CAA4C,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;AAChF,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/cacheDB.d.ts b/nezha-fronted/src/components/common/@topology/core/src/utils/cacheDB.d.ts new file mode 100644 index 000000000..1f559a0b1 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/cacheDB.d.ts @@ -0,0 +1,5 @@ +import { TopologyData } from '@topology/core'; +export declare function createCacheTable(): void; +export declare function spliceCache(index: number): void; +export declare function pushCache(data: TopologyData | any, index: number, length: number): void; +export declare function getCache(index: number): Promise; diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/cacheDB.js b/nezha-fronted/src/components/common/@topology/core/src/utils/cacheDB.js new file mode 100644 index 000000000..4f6cc526a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/cacheDB.js @@ -0,0 +1,103 @@ +export function createCacheTable () { + const request = indexedDB.open('topology-caches') // 默认版本 1 + request.onupgradeneeded = function (e) { + // 建表 + const db = e.target.result + if (db.objectStoreNames.contains('caches')) { + db.deleteObjectStore('caches') + } + db.createObjectStore('caches', { + keyPath: 'dbIndex' + }) + } + request.onsuccess = function (event) { + const db = request.result + if (!db.objectStoreNames.contains('caches')) { + return + } + const get = db.transaction(['caches'], 'readwrite').objectStore('caches') + get.clear() // 创建表格同时清空 + } + request.onerror = function (e) { + console.warn('数据库打开失败' + e) + } +} +export function spliceCache (index) { + const request = indexedDB.open('topology-caches') // 默认版本 1 + request.onsuccess = function (event) { + const db = request.result + if (!db.objectStoreNames.contains('caches')) { + return + } + const get = db.transaction(['caches'], 'readwrite').objectStore('caches') + get.delete(IDBKeyRange.lowerBound(index)) + } + request.onupgradeneeded = function (e) { + // 建表 + const db = e.target.result + if (db.objectStoreNames.contains('caches')) { + db.deleteObjectStore('caches') + } + db.createObjectStore('caches', { + keyPath: 'dbIndex' + }) + } +} +export function pushCache (data, index, length) { + const request = indexedDB.open('topology-caches') // 默认版本 1 + request.onsuccess = function (event) { + const db = request.result + if (!db.objectStoreNames.contains('caches')) { + return + } + const push = db.transaction(['caches'], 'readwrite').objectStore('caches') + data.dbIndex = index + push.add(data) + const result = push.count() + result.onsuccess = function () { + if (result.result > length) { + // 把最前面的一个扔出去 + push.delete(index - length) + } + } + } + request.onupgradeneeded = function (e) { + // 建表 + const db = e.target.result + if (db.objectStoreNames.contains('caches')) { + db.deleteObjectStore('caches') + } + db.createObjectStore('caches', { + keyPath: 'dbIndex' + }) + } +} +export function getCache (index) { + return new Promise(function (resolve, reject) { + const request = indexedDB.open('topology-caches') // 默认版本 1 + request.onsuccess = function (event) { + const db = request.result + if (!db.objectStoreNames.contains('caches')) { + resolve(null) + return + } + const objectStore = db.transaction(['caches']).objectStore('caches') + const get = objectStore.get(index) + get.onsuccess = function () { + // undefined 也传出去 + resolve(get.result) + } + } + request.onupgradeneeded = function (e) { + // 建表 + const db = e.target.result + if (db.objectStoreNames.contains('caches')) { + db.deleteObjectStore('caches') + } + db.createObjectStore('caches', { + keyPath: 'dbIndex' + }) + } + }) +} +// # sourceMappingURL=cacheDB.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/cacheDB.js.map b/nezha-fronted/src/components/common/@topology/core/src/utils/cacheDB.js.map new file mode 100644 index 000000000..5fbf2d515 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/cacheDB.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cacheDB.js","sourceRoot":"","sources":["../../../../packages/core/src/utils/cacheDB.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,gBAAgB;IAC9B,IAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS;IAC5D,OAAO,CAAC,eAAe,GAAG,UAAC,CAAM;QAC/B,KAAK;QACL,IAAM,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,MAAqB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AC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;aAChC;YACD,EAAE,CAAC,iBAAiB,CAAC,QAAQ,EAAE;gBAC7B,OAAO,EAAE,SAAS;aACnB,CAAC,CAAC;QACL,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/canvas.d.ts b/nezha-fronted/src/components/common/@topology/core/src/utils/canvas.d.ts new file mode 100644 index 000000000..7ea380552 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/canvas.d.ts @@ -0,0 +1,18 @@ +import { Point } from '../models/point'; +import { Pen } from '../models/pen'; +import { Node } from '../models/node'; +import { Line } from '../models/line'; +export declare function flatNodes(nodes: Pen[]): { + nodes: Node[]; + lines: Line[]; +}; +export declare function find(idOrTag: string, pens: Pen[]): Pen[]; +export declare function del(idOrTag: string, pens: Pen[]): Pen[]; +export declare function getParent(pens: Pen[], child: Pen): Node; +export declare function pointInRect(point: { + x: number; + y: number; +}, vertices: Point[]): boolean; +export declare function pointInLine(point: Point, from: Point, to: Point, padding?: number): boolean; +export declare function lineLen(from: Point, to: Point): number; +export declare function curveLen(from: Point, cp1: Point, cp2: Point, to: Point): number; diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/canvas.js b/nezha-fronted/src/components/common/@topology/core/src/utils/canvas.js new file mode 100644 index 000000000..75a46430e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/canvas.js @@ -0,0 +1,114 @@ +import { Point } from '../models/point' +export function flatNodes (nodes) { + const result = { + nodes: [], + lines: [] + } + for (let _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { + const item = nodes_1[_i] + if (item.type) { + result.lines.push(item) + continue + } + result.nodes.push(item) + if (item.children) { + result.nodes.push.apply(result.nodes, flatNodes(item.children).nodes) + result.lines.push.apply(result.lines, flatNodes(item.children).lines) + } + } + return result +} +export function find (idOrTag, pens) { + const result = [] + pens.forEach(function (item) { + if (item.id === idOrTag || item.tags.indexOf(idOrTag) > -1) { + result.push(item) + } + if (item.children) { + result.push.apply(result, find(idOrTag, item.children)) + } + }) + return result +} +export function del (idOrTag, pens) { + const deleted = [] + for (let i = 0; i < pens.length; i++) { + if (pens[i].id === idOrTag || pens[i].tags.indexOf(idOrTag) > -1) { + deleted.push(pens[i]) + pens.splice(i, 1) + --i + } else if (pens[i].children) { + deleted.push.apply(deleted, del(idOrTag, pens[i].children)) + } + } + return deleted +} +export function getParent (pens, child) { + let parent + for (let _i = 0, pens_1 = pens; _i < pens_1.length; _i++) { + const item = pens_1[_i] + if (item.type) { + continue + } + if (!item.children) { + continue + } + for (let _a = 0, _b = item.children; _a < _b.length; _a++) { + const subItem = _b[_a] + if (subItem.id === child.id) { + return item + } + if (subItem.type) { + continue + } + if (subItem.children) { + parent = getParent(subItem.children, child) + if (parent) { + return parent + } + } + } + } + return parent +} +export function pointInRect (point, vertices) { + if (vertices.length < 3) { + return false + } + let isIn = false + let last = vertices[vertices.length - 1] + for (let _i = 0, vertices_1 = vertices; _i < vertices_1.length; _i++) { + const item = vertices_1[_i] + if (((last.y > point.y) !== (item.y > point.y))) { + if (item.x + ((point.y - item.y) * (last.x - item.x)) / (last.y - item.y) > point.x) { + isIn = !isIn + } + } + last = item + } + return isIn +} +export function pointInLine (point, from, to, padding) { + if (padding === void 0) { padding = 1 } + const angle = Math.atan2(from.y - to.y, to.x - from.x) + padding = padding > 5 ? padding : 5 + const x = Math.sin(angle) * padding + const y = Math.cos(angle) * padding + const points = [ + new Point(from.x - x, from.y - y), + new Point(to.x - x, to.y - y), + new Point(to.x + x, to.y + y), + new Point(from.x + x, from.y + y) + ] + return pointInRect(point, points) +} +export function lineLen (from, to) { + const len = Math.sqrt(Math.pow(Math.abs(from.x - to.x), 2) + Math.pow(Math.abs(from.y - to.y), 2)) + return len | 0 +} +export function curveLen (from, cp1, cp2, to) { + const path = document.createElementNS('http://www.w3.org/2000/svg', 'path') + path.setAttribute('d', 'M' + from.x + ' ' + from.y + ' C' + cp1.x + ' ' + cp1.y + ' ' + cp2.x + ' ' + cp2.y + ' ' + to.x + ' ' + to.y) + return path.getTotalLength() | 0 +} +// # sourceMappingURL=canvas.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/canvas.js.map b/nezha-fronted/src/components/common/@topology/core/src/utils/canvas.js.map new file mode 100644 index 000000000..53ca5172d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/canvas.js.map @@ -0,0 +1 @@ +{"version":3,"file":"canvas.js","sourceRoot":"","sources":["../../../../packages/core/src/utils/canvas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAKxC,MAAM,UAAU,SAAS,CACvB,KAAY;IAKZ,IAAM,MAAM,GAAG;QACb,KAAK,EAAE,EAAE;QACT,KAAK,EAAE,EAAE;KACV,CAAC;IAEF,KAAmB,UAAK,EAAL,eAAK,EAAL,mBAAK,EAAL,IAAK,EAAE;QAArB,IAAM,IAAI,cAAA;QACb,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACxB,SAAS;SACV;QACD,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxB,IAAK,IAAa,CAAC,QAAQ,EAAE;YAC3B,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAE,IAAa,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC;YAChF,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAE,IAAa,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC;SACjF;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,OAAe,EAAE,IAAW;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CAAC;IAEF,OAAO,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,IAAW,EAAE,EAAS;IAC5C,IAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACnG,OAAO,GAAG,GAAG,CAAC,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,IAAW,EAAE,GAAU,EAAE,GAAU,EAAE,EAAS;IACrE,IAAM,IAAI,GAAG,QAAQ,CAAC,eAAe,CAAC,4BAA4B,EAAE,MAAM,CAAC,CAAC;IAC5E,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,MAAI,IAAI,CAAC,CAAC,SAAI,IAAI,CAAC,CAAC,UAAK,GAAG,CAAC,CAAC,SAAI,GAAG,CAAC,CAAC,SAAI,GAAG,CAAC,CAAC,SAAI,GAAG,CAAC,CAAC,SAAI,EAAE,CAAC,CAAC,SAAI,EAAE,CAAC,CAAG,CAAC,CAAC;IACpG,OAAO,IAAI,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;AACnC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/clone.d.ts b/nezha-fronted/src/components/common/@topology/core/src/utils/clone.d.ts new file mode 100644 index 000000000..16c2580b6 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/clone.d.ts @@ -0,0 +1 @@ +export declare function deepClone(o?: any): any; diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/clone.js b/nezha-fronted/src/components/common/@topology/core/src/utils/clone.js new file mode 100644 index 000000000..b267f2ec1 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/clone.js @@ -0,0 +1,22 @@ +export function deepClone (o) { + if (Array.isArray(o)) { + const arr_1 = [] + o.forEach(function (item) { + arr_1.push(deepClone(item)) + }) + return arr_1 + } else if (typeof o === 'object') { + if (o === null) { + return null + } else if (o.constructor === RegExp) { + return o + } + const _o = {} + for (const key in o) { + _o[key] = deepClone(o[key]) + } + return _o + } + return o +} +// # sourceMappingURL=clone.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/clone.js.map b/nezha-fronted/src/components/common/@topology/core/src/utils/clone.js.map new file mode 100644 index 000000000..8a5e9a3d6 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/clone.js.map @@ -0,0 +1 @@ +{"version":3,"file":"clone.js","sourceRoot":"","sources":["../../../../packages/core/src/utils/clone.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAC,CAAO;IAC/B,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QACpB,IAAM,KAAG,GAAG,EAAE,CAAC;QACf,CAAC,CAAC,OAAO,CAAC,UAAC,IAAI;YACb,KAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;QACH,OAAO,KAAG,CAAC;KACZ;SAAM,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;QAChC,IAAI,CAAC,KAAK,IAAI,EAAE;YACd,OAAO,IAAI,CAAC;SACb;aAAM,IAAI,CAAC,CAAC,WAAW,KAAK,MAAM,EAAE;YACnC,OAAO,CAAC,CAAC;SACV;QACD,IAAM,EAAE,GAAG,EAAE,CAAC;QACd,KAAK,IAAI,GAAG,IAAI,CAAC,EAAE;YACjB,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;SAC7B;QACD,OAAO,EAAE,CAAC;KACX;IAED,OAAO,CAAC,CAAC;AACX,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/dom.d.ts b/nezha-fronted/src/components/common/@topology/core/src/utils/dom.d.ts new file mode 100644 index 000000000..bc2b159db --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/dom.d.ts @@ -0,0 +1,4 @@ +import { Node } from '../models/node'; +export declare function createDiv(node: Node): HTMLDivElement; +export declare function createInput(node: Node): HTMLInputElement; +export declare function loadJS(url: string, callback?: () => void, render?: boolean): void; diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/dom.js b/nezha-fronted/src/components/common/@topology/core/src/utils/dom.js new file mode 100644 index 000000000..2a32279c8 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/dom.js @@ -0,0 +1,45 @@ +import { Store } from 'le5le-store' +export function createDiv (node) { + const div = document.createElement('div') + div.style.position = 'absolute' + div.style.outline = 'none' + div.style.left = '-9999px' + div.style.bottom = '-9999px' + div.style.width = node.rect.width + 'px' + div.style.height = node.rect.height + 'px' + if (node.elementId) { + div.id = node.elementId + } + return div +} +export function createInput (node) { + const input = document.createElement('input') + input.style.position = 'absolute' + input.style.outline = 'none' + input.style.left = '-9999px' + input.style.bottom = '-9999px' + input.style.width = node.rect.width + 'px' + input.style.height = node.rect.height + 'px' + input.style.border = '1px solid #cdcdcd' + input.classList.add('set-text-input') + if (node.elementId) { + input.id = node.elementId + } + return input +} +export function loadJS (url, callback, render) { + const loaderScript = document.createElement('script') + loaderScript.type = 'text/javascript' + loaderScript.src = url + loaderScript.addEventListener('load', function () { + if (callback) { + callback() + } + // how to do + if (render) { + Store.set('LT:render', true) + } + }) + document.body.appendChild(loaderScript) +} +// # sourceMappingURL=dom.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/dom.js.map b/nezha-fronted/src/components/common/@topology/core/src/utils/dom.js.map new file mode 100644 index 000000000..df2240d40 --- /dev/null +++ b/nezha-fronted/src/components/common/@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AAK,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IAC7C,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,mBAAmB,CAAC;IACzC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACtC,IAAI,IAAI,CAAC,SAAS,EAAE;QAClB,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;KAC3B;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,GAAW,EAAE,QAAqB,EAAE,MAAgB;IACzE,IAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACtD,YAAY,CAAC,IAAI,GAAG,iBAAiB,CAAC;IACtC,YAAY,CAAC,GAAG,GAAG,GAAG,CAAC;IACvB,YAAY,CAAC,gBAAgB,CAAC,MAAM,EAAE;QACpC,IAAI,QAAQ,EAAE;YACZ,QAAQ,EAAE,CAAC;SACZ;QACD,YAAY;QACZ,IAAI,MAAM,EAAE;YACV,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;SAC9B;IACH,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;AAC1C,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/index.d.ts b/nezha-fronted/src/components/common/@topology/core/src/utils/index.d.ts new file mode 100644 index 000000000..e1689307a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/index.d.ts @@ -0,0 +1,8 @@ +export * from './canvas'; +export * from './dom'; +export * from './math'; +export * from './rect'; +export * from './uuid'; +export * from './browser'; +export * from './clone'; +export * from './cacheDB'; diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/index.js b/nezha-fronted/src/components/common/@topology/core/src/utils/index.js new file mode 100644 index 000000000..b0972851c --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/index.js @@ -0,0 +1,9 @@ +export * from './canvas' +export * from './dom' +export * from './math' +export * from './rect' +export * from './uuid' +export * from './browser' +export * from './clone' +export * from './cacheDB' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/index.js.map b/nezha-fronted/src/components/common/@topology/core/src/utils/index.js.map new file mode 100644 index 000000000..bc5de691e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/core/src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/math.d.ts b/nezha-fronted/src/components/common/@topology/core/src/utils/math.d.ts new file mode 100644 index 000000000..77345aea4 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/math.d.ts @@ -0,0 +1,11 @@ +export declare function pSBCr(d: any): any; +export declare function pSBC(p: any, c0: any, c1?: any, l?: any): string; +export declare function rgba(p: number, c: string): string; +export declare function abs(num: number, percent: number | string): number; +export declare function distance(pt1: { + x: number; + y: number; +}, pt2: { + x: number; + y: number; +}): number; diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/math.js b/nezha-fronted/src/components/common/@topology/core/src/utils/math.js new file mode 100644 index 000000000..93a4ff52a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/math.js @@ -0,0 +1,63 @@ +// pSBC - Shade Blend Convert - Version 4.0 - 02/18/2019 +// https://github.com/PimpTrizkit/PJs/edit/master/pSBC.js +export function pSBCr (d) { + const i = parseInt; const m = Math.round + let n = d.length; const x = {} + if (n > 9) { + const _a = (d = d.split(',')); const r = _a[0]; const g = _a[1]; const b = _a[2]; const a = _a[3] + n = d.length + if (n < 3 || n > 4) { return null } + (x.r = i(r[3] == 'a' ? r.slice(5) : r.slice(4))), (x.g = i(g)), (x.b = i(b)), (x.a = a ? parseFloat(a) : -1) + } else { + if (n == 8 || n == 6 || n < 4) { return null } + if (n < 6) { d = '#' + d[1] + d[1] + d[2] + d[2] + d[3] + d[3] + (n > 4 ? d[4] + d[4] : '') } + d = i(d.slice(1), 16) + if (n == 9 || n == 5) { (x.r = (d >> 24) & 255), (x.g = (d >> 16) & 255), (x.b = (d >> 8) & 255), (x.a = m((d & 255) / 0.255) / 1000) } else { (x.r = d >> 16), (x.g = (d >> 8) & 255), (x.b = d & 255), (x.a = -1) } + } + return x +} +export function pSBC (p, c0, c1, l) { + let r; let g; let b; let P; let f; let t; let h; const m = Math.round; let a = typeof c1 == 'string' + if (typeof p != 'number' || p < -1 || p > 1 || typeof c0 != 'string' || (c0[0] != 'r' && c0[0] != '#') || (c1 && !a)) { return null } + (h = c0.length > 9), + (h = a ? (c1.length > 9 ? true : c1 == 'c' ? !h : false) : h), + (f = pSBCr(c0)), + (P = p < 0), + (t = c1 && c1 != 'c' ? pSBCr(c1) : P ? { r: 0, g: 0, b: 0, a: -1 } : { r: 255, g: 255, b: 255, a: -1 }), + (p = P ? p * -1 : p), + (P = 1 - p) + if (!f || !t) { return null } + if (l) { (r = m(P * f.r + p * t.r)), (g = m(P * f.g + p * t.g)), (b = m(P * f.b + p * t.b)) } else { + (r = m(Math.pow((P * Math.pow(f.r, 2) + p * Math.pow(t.r, 2)), 0.5))), + (g = m(Math.pow((P * Math.pow(f.g, 2) + p * Math.pow(t.g, 2)), 0.5))), + (b = m(Math.pow((P * Math.pow(f.b, 2) + p * Math.pow(t.b, 2)), 0.5))) + } + (a = f.a), (t = t.a), (f = a >= 0 || t >= 0), (a = f ? (a < 0 ? t : t < 0 ? a : a * P + t * p) : 0) + if (h) { return 'rgb' + (f ? 'a(' : '(') + r + ',' + g + ',' + b + (f ? ',' + m(a * 1000) / 1000 : '') + ')' } else { + return ('#' + + (4294967296 + r * 16777216 + g * 65536 + b * 256 + (f ? m(a * 255) : 0)).toString(16).slice(1, f ? undefined : -2)) + } +} +export function rgba (p, c) { + const f = pSBCr(c) || { r: 0, g: 0, b: 0 } + if (f.a < 0) { + return 'rgba(' + f.r + ',' + f.g + ',' + f.b + ',' + p + ')' + } + return 'rgba(' + f.r + ',' + f.g + ',' + f.b + ',' + (p + f.a) + ')' +} +export function abs (num, percent) { + if (+percent) { + return +percent + } + if (!percent || percent[percent.length - 1] !== '%') { + return 0 + } + percent = percent.substr(0, percent.length - 1) + return (num * +percent) / 100 +} +export function distance (pt1, pt2) { + const x = pt1.x - pt2.x + const y = pt1.y - pt2.y + return Math.sqrt(x * x + y * y) +} +// # sourceMappingURL=math.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/math.js.map b/nezha-fronted/src/components/common/@topology/core/src/utils/math.js.map new file mode 100644 index 000000000..ddeef3770 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/math.js.map @@ -0,0 +1 @@ +{"version":3,"file":"math.js","sourceRoot":"","sources":["../../../../packages/core/src/utils/math.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yDAAyD;AAEzD,MAAM,UAAU,KAAK,CAAC,CAAC;IACrB,IAAM,CAAC,GAAG,QAAQ,EAChB,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;IACjB,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,EACd,CAAC,GAAQ,EAAE,CAAC;IACd,IAAI,CAAC,GAAG,CAAC,EAAE;QACH,IAAA,uBAAiC,EAAhC,SAAC,EAAE,SAAC,EAAE,SAAC,EAAE,SAAuB,CAAC;QACxC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC;Y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AAkB,CAAC,MAAM,CAAC,CAAC,EAAG,OAAkB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAExE,OAAO,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,GAA6B,EAAE,GAA6B;IACnF,IAAM,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IACxB,IAAM,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IACxB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAClC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/padding.d.ts b/nezha-fronted/src/components/common/@topology/core/src/utils/padding.d.ts new file mode 100644 index 000000000..cf74940fd --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/padding.d.ts @@ -0,0 +1,7 @@ +import { Padding } from '../options'; +/** + * turn padding into [top, right, bottom, left] + * @param {Number|Array} padding input padding + * @return {array} output + */ +export declare const formatPadding: (padding: Padding) => number[]; diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/padding.js b/nezha-fronted/src/components/common/@topology/core/src/utils/padding.js new file mode 100644 index 000000000..175af0e24 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/padding.js @@ -0,0 +1,45 @@ +/** + * turn padding into [top, right, bottom, left] + * @param {Number|Array} padding input padding + * @return {array} output + */ +export var formatPadding = function (padding) { + let top = 0 + let left = 0 + let right = 0 + let bottom = 0 + if (typeof padding === 'number') { + top = left = right = bottom = padding + } else if (typeof padding === 'string') { + const intPadding = parseInt(padding, 10) + top = left = right = bottom = intPadding + } else if (Array.isArray(padding)) { + top = padding[0] + right = !isNil(padding[1]) ? padding[1] : padding[0] + bottom = !isNil(padding[2]) ? padding[2] : padding[0] + left = !isNil(padding[3]) ? padding[3] : right + } + return [top, right, bottom, left] +} +/** + * Checks if `value` is `null` or `undefined`. + * + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @example + * + * isNil(null) + * // => true + * + * isNil(void 0) + * // => true + * + * isNil(NaN) + * // => false + */ +function isNil (value) { + return value == null +} +// # sourceMappingURL=padding.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/padding.js.map b/nezha-fronted/src/components/common/@topology/core/src/utils/padding.js.map new file mode 100644 index 000000000..f214b0a4d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/padding.js.map @@ -0,0 +1 @@ +{"version":3,"file":"padding.js","sourceRoot":"","sources":["../../../../packages/core/src/utils/padding.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,IAAM,aAAa,GAAG,UAAC,OAAgB;IAC5C,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,GAAG,GAAG,IAAI,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;KACvC;SAAM,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QACtC,IAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QACzC,GAAG,GAAG,IAAI,GAAG,KAAK,GAAG,MAAM,GAAG,UAAU,CAAC;KAC1C;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QACjC,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACjB,KAAK,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACrD,MAAM,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACtD,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;KAChD;IACD,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAS,KAAK,CAAC,KAAU;IACvB,OAAO,KAAK,IAAI,IAAI,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/rect.d.ts b/nezha-fronted/src/components/common/@topology/core/src/utils/rect.d.ts new file mode 100644 index 000000000..93247b9d3 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/rect.d.ts @@ -0,0 +1,18 @@ +import { Point } from '../models/point'; +import { Pen } from '../models/pen'; +import { Rect } from '../models/rect'; +/** + * 不包含画布偏移量 + * */ +export declare function getRect(pens: Pen[]): Rect; +export declare function getBboxOfPoints(points: Point[]): { + x1: number; + y1: number; + x2: number; + y2: number; +}; +export declare function rectInRect(source: Rect, target: Rect): boolean; +/** + * 合并大小全部传入的 rects + * */ +export declare function getMoreRect(...rects: Rect[]): Rect; diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/rect.js b/nezha-fronted/src/components/common/@topology/core/src/utils/rect.js new file mode 100644 index 000000000..b21f73816 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/rect.js @@ -0,0 +1,93 @@ +import { Node } from '../models/node' +import { Line } from '../models/line' +import { getBezierPoint } from '../middles/lines/curve' +import { Rect } from '../models/rect' +/** + * 不包含画布偏移量 + * */ +export function getRect (pens) { + const points = [] + for (let _i = 0, pens_1 = pens; _i < pens_1.length; _i++) { + const item = pens_1[_i] + if (item instanceof Node) { + const pts = item.rect.toPoints() + if (item.rotate) { + for (let _a = 0, pts_1 = pts; _a < pts_1.length; _a++) { + const pt = pts_1[_a] + pt.rotate(item.rotate, item.rect.center) + } + } + points.push.apply(points, pts) + } else if (item instanceof Line) { + if (item.children) { + item.children.forEach(function (child) { + points.push(child.from) + points.push(child.to) + if (Array.isArray(child.controlPoints)) { + points.push.apply(points, child.controlPoints) + } + if (child.name === 'curve') { + for (let i = 0.01; i < 1; i += 0.02) { + points.push(getBezierPoint(i, child.from, child.controlPoints[0], child.controlPoints[1], child.to)) + } + } + }) + } else if (item.from) { + points.push(item.from) + points.push(item.to) + if (Array.isArray(item.controlPoints)) { + points.push.apply(points, item.controlPoints) + } + if (item.name === 'curve') { + for (let i = 0.01; i < 1; i += 0.02) { + points.push(getBezierPoint(i, item.from, item.controlPoints[0], item.controlPoints[1], item.to)) + } + } + } + } + } + const _b = getBboxOfPoints(points); const x1 = _b.x1; const y1 = _b.y1; const x2 = _b.x2; const y2 = _b.y2 + return new Rect(x1, y1, x2 - x1, y2 - y1) +} +export function getBboxOfPoints (points) { + let x1 = Infinity + let y1 = Infinity + let x2 = -Infinity + let y2 = -Infinity + for (let _i = 0, points_1 = points; _i < points_1.length; _i++) { + const item = points_1[_i] + const x = item.x; const y = item.y + if (isNaN(x) || isNaN(y)) { continue } + x1 = Math.min(x1, x) + y1 = Math.min(y1, y) + x2 = Math.max(x2, x) + y2 = Math.max(y2, y) + } + return { x1: x1, y1: y1, x2: x2, y2: y2 } +} +export function rectInRect (source, target) { + return !( + // 括号内表明 在范围外的 四个区域 + source.x > target.ex || source.ex < target.x || source.ey < target.y || source.y > target.ey) +} +/** + * 合并大小全部传入的 rects + * */ +export function getMoreRect () { + const rects = [] + for (let _i = 0; _i < arguments.length; _i++) { + rects[_i] = arguments[_i] + } + const rect = new Rect(rects[0].x, rects[0].y, rects[0].width, rects[0].height) + for (let i = 1; i < rects.length; i++) { + const currentRect = rects[i] + if (currentRect) { + rect.x > currentRect.x && (rect.x = currentRect.x) + rect.y > currentRect.y && (rect.y = currentRect.y) + rect.ex < currentRect.ex && (rect.ex = currentRect.ex) + rect.ey < currentRect.ey && (rect.ey = currentRect.ey) + } + } + return new Rect(rect.x, rect.y, rect.ex - rect.x, rect.ey - rect.y) +} +// # sourceMappingURL=rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/rect.js.map b/nezha-fronted/src/components/common/@topology/core/src/utils/rect.js.map new file mode 100644 index 000000000..6bef02400 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rect.js","sourceRoot":"","sources":["../../../../packages/core/src/utils/rect.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC;;KAEK;AACL,MAAM,UAAU,OAAO,CAAC,IAAW;IAEjC,IAAM,MAAM,GAAY,EAAE,CAAC;IAC3B,KAAmB,UAAI,EAAJ,aAAI,EAAJ,kBAAI,EAAJ,IAAI,EAAE;QAApB,IAAM,IAAI,aAAA;QACb,IAAI,IAAI,YAAY,IAAI,EAAE;YACxB,IAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACjC,IAAI,IAAI,CAAC,MAAM,EAAE;gBACf,KAAiB,UAAG,EAAH,WAAG,EAAH,iBAAG,EAAH,IAAG,EAAE;oBAAjB,IAAM,EAAE,YAAA;oBACX,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CA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,EAAE,CAAC,CAAC;YACvD,IAAI,CAAC,EAAE,GAAG,WAAW,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC;SACxD;KACF;IAED,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACtE,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/uuid.d.ts b/nezha-fronted/src/components/common/@topology/core/src/utils/uuid.d.ts new file mode 100644 index 000000000..802d67846 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/uuid.d.ts @@ -0,0 +1,4 @@ +export declare function s4(): string; +export declare function s8(): string; +export declare function s12(): string; +export declare function s16(): string; diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/uuid.js b/nezha-fronted/src/components/common/@topology/core/src/utils/uuid.js new file mode 100644 index 000000000..3af14ec44 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/uuid.js @@ -0,0 +1,13 @@ +export function s4 () { + return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1) +} +export function s8 () { + return (((1 + Math.random()) * 0x100000000) | 0).toString(16).substring(1) +} +export function s12 () { + return s4() + s8() +} +export function s16 () { + return s8() + s8() +} +// # sourceMappingURL=uuid.js.map diff --git a/nezha-fronted/src/components/common/@topology/core/src/utils/uuid.js.map b/nezha-fronted/src/components/common/@topology/core/src/utils/uuid.js.map new file mode 100644 index 000000000..6ffe7787e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/core/src/utils/uuid.js.map @@ -0,0 +1 @@ +{"version":3,"file":"uuid.js","sourceRoot":"","sources":["../../../../packages/core/src/utils/uuid.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,EAAE;IAChB,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,EAAE;IAChB,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/index.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/index.d.ts new file mode 100644 index 000000000..2644cea16 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/index.d.ts @@ -0,0 +1,12 @@ +export * from './src/data'; +export * from './src/subprocess'; +export * from './src/db'; +export * from './src/document'; +export * from './src/internalStorage'; +export * from './src/externStorage'; +export * from './src/queue'; +export * from './src/manually'; +export * from './src/display'; +export * from './src/parallel'; +export * from './src/comment'; +export * from './src/register'; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/index.js b/nezha-fronted/src/components/common/@topology/flow-diagram/index.js new file mode 100644 index 000000000..f20e77a90 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/index.js @@ -0,0 +1,13 @@ +export * from './src/data' +export * from './src/subprocess' +export * from './src/db' +export * from './src/document' +export * from './src/internalStorage' +export * from './src/externStorage' +export * from './src/queue' +export * from './src/manually' +export * from './src/display' +export * from './src/parallel' +export * from './src/comment' +export * from './src/register' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/index.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/index.js.map new file mode 100644 index 000000000..34aca40a5 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../packages/flow-diagram/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/package.json b/nezha-fronted/src/components/common/@topology/flow-diagram/package.json new file mode 100644 index 000000000..155d1e7ea --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/package.json @@ -0,0 +1,65 @@ +{ + "_args": [ + [ + "@topology/flow-diagram@0.3.0", + "D:\\a\\nezha-fronted\\nezha-fronted" + ] + ], + "_from": "@topology/flow-diagram@0.3.0", + "_id": "@topology/flow-diagram@0.3.0", + "_inBundle": false, + "_integrity": "sha512-GPV+CIbclzYgCO/lMePDfLY0OzAr1+7nyzMOVdABXezvlIw/zm59+2/KYQu5XGUqBoqjvjdrd4hbN8eYAKWZQw==", + "_location": "/@topology/flow-diagram", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@topology/flow-diagram@0.3.0", + "name": "@topology/flow-diagram", + "escapedName": "@topology%2fflow-diagram", + "scope": "@topology", + "rawSpec": "0.3.0", + "saveSpec": null, + "fetchSpec": "0.3.0" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/@topology/flow-diagram/-/flow-diagram-0.3.0.tgz", + "_spec": "0.3.0", + "_where": "D:\\a\\nezha-fronted\\nezha-fronted", + "author": { + "name": "alsmile123@qq.com" + }, + "bugs": { + "url": "https://github.com/le5le-com/topology/issues" + }, + "description": "A flow diagram tool using le5le-topology.", + "gitHead": "78f2a53ca1839c89b56e2e498d17ba4eb987ad14", + "homepage": "https://github.com/le5le-com/topology#readme", + "keywords": [ + "topology", + "flow", + "diagram", + "canvas" + ], + "license": "ISC", + "main": "index.js", + "name": "@topology/flow-diagram", + "peerDependencies": { + "@topology/core": "^0.3.0" + }, + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/le5le-com/topology.git" + }, + "scripts": { + "build": "tsc && npm run copy", + "copy": "copyfiles package.json ../../dist/flow-diagram/" + }, + "types": "index.d.ts", + "version": "0.3.0" +} diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/comment.anchor.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/comment.anchor.d.ts new file mode 100644 index 000000000..cc747b06d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/comment.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function flowCommentAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/comment.anchor.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/comment.anchor.js new file mode 100644 index 000000000..9f8c65502 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/comment.anchor.js @@ -0,0 +1,5 @@ +import { Point, Direction } from '@topology/core' +export function flowCommentAnchors (node) { + node.anchors.push(new Point(node.rect.x, node.rect.y + node.rect.height / 2, Direction.Left)) +} +// # sourceMappingURL=comment.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/comment.anchor.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/comment.anchor.js.map new file mode 100644 index 000000000..7555ce4da --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/comment.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"comment.anchor.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/comment/comment.anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAQ,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,UAAU,kBAAkB,CAAC,IAAU;IAC3C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;AAChG,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/comment.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/comment.d.ts new file mode 100644 index 000000000..f22004ac6 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/comment.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function flowComment(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/comment.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/comment.js new file mode 100644 index 000000000..7312fdc77 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/comment.js @@ -0,0 +1,10 @@ +export function flowComment (ctx, node) { + ctx.beginPath() + const offsetX = node.rect.width / 4 + ctx.moveTo(node.rect.x + offsetX, node.rect.y) + ctx.lineTo(node.rect.x, node.rect.y) + ctx.lineTo(node.rect.x, node.rect.ey) + ctx.lineTo(node.rect.x + offsetX, node.rect.ey) + ctx.stroke() +} +// # sourceMappingURL=comment.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/comment.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/comment.js.map new file mode 100644 index 000000000..8a7fb246e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/comment.js.map @@ -0,0 +1 @@ +{"version":3,"file":"comment.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/comment/comment.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,WAAW,CAAC,GAA6B,EAAE,IAAU;IACnE,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,IAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACpC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/C,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACrC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChD,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/index.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/index.d.ts new file mode 100644 index 000000000..ecc460847 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/index.d.ts @@ -0,0 +1,2 @@ +export * from './comment'; +export * from './comment.anchor'; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/index.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/index.js new file mode 100644 index 000000000..1d7326487 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/index.js @@ -0,0 +1,3 @@ +export * from './comment' +export * from './comment.anchor' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/index.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/index.js.map new file mode 100644 index 000000000..fc213ba9a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/comment/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/comment/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.anchor.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.anchor.d.ts new file mode 100644 index 000000000..d47987ead --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function flowDataAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.anchor.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.anchor.js new file mode 100644 index 000000000..cac00c481 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.anchor.js @@ -0,0 +1,8 @@ +import { Point, Direction } from '@topology/core' +export function flowDataAnchors (node) { + node.anchors.push(new Point(node.rect.x + node.rect.width / 14, node.rect.y + node.rect.height / 2, Direction.Left)) + node.anchors.push(new Point(node.rect.x + (node.rect.width * 4) / 7, node.rect.y, Direction.Up)) + node.anchors.push(new Point(node.rect.x + (node.rect.width * 13) / 14, node.rect.y + node.rect.height / 2, Direction.Right)) + node.anchors.push(new Point(node.rect.x + (node.rect.width * 3) / 7, node.rect.ey, Direction.Bottom)) +} +// # sourceMappingURL=data.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.anchor.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.anchor.js.map new file mode 100644 index 000000000..ab251c2b0 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"data.anchor.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/data/data.anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAQ,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,UAAU,eAAe,CAAC,IAAU;IACxC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACrH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IACjG,IAAI,CAAC,OAAO,CAAC,IAAI,CACf,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAC1G,CAAC;IAEF,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;AACxG,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.d.ts new file mode 100644 index 000000000..010ef3c6e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function flowData(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.js new file mode 100644 index 000000000..eacfedc2d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.js @@ -0,0 +1,12 @@ +export function flowData (ctx, node) { + ctx.beginPath() + const offsetX = node.rect.width / 7 + ctx.moveTo(node.rect.x + offsetX, node.rect.y) + ctx.lineTo(node.rect.ex, node.rect.y) + ctx.lineTo(node.rect.x + node.rect.width - offsetX, node.rect.ey) + ctx.lineTo(node.rect.x, node.rect.ey) + ctx.closePath(); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=data.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.js.map new file mode 100644 index 000000000..4119fe9c1 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.js.map @@ -0,0 +1 @@ +{"version":3,"file":"data.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/data/data.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,QAAQ,CAAC,GAA6B,EAAE,IAAU;IAChE,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,IAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACpC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/C,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACtC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtC,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.rect.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.rect.d.ts new file mode 100644 index 000000000..d2ccfabe2 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '@topology/core'; +export declare function flowDataIconRect(node: Node): void; +export declare function flowDataTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.rect.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.rect.js new file mode 100644 index 000000000..1f6358943 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.rect.js @@ -0,0 +1,9 @@ +import { Rect } from '@topology/core' +export function flowDataIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function flowDataTextRect (node) { + node.textRect = new Rect(node.rect.x + node.rect.width / 7, node.rect.y, (node.rect.width * 5) / 7, node.rect.height) + node.fullTextRect = node.textRect +} +// # sourceMappingURL=data.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.rect.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.rect.js.map new file mode 100644 index 000000000..f9d483372 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/data.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"data.rect.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/data/data.rect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,gBAAgB,CAAC,IAAU;IACzC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAU;IACzC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CACtB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EACjC,IAAI,CAAC,IAAI,CAAC,CAAC,EACX,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,EACzB,IAAI,CAAC,IAAI,CAAC,MAAM,CACjB,CAAC;IACF,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/index.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/index.d.ts new file mode 100644 index 000000000..53d614425 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/index.d.ts @@ -0,0 +1,3 @@ +export * from './data'; +export * from './data.anchor'; +export * from './data.rect'; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/index.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/index.js new file mode 100644 index 000000000..6c4fdde38 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/index.js @@ -0,0 +1,4 @@ +export * from './data' +export * from './data.anchor' +export * from './data.rect' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/index.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/index.js.map new file mode 100644 index 000000000..5a8ca8df7 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/data/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/data/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/db.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/db.d.ts new file mode 100644 index 000000000..e885c08bd --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/db.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function flowDb(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/db.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/db.js new file mode 100644 index 000000000..1818fca6e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/db.js @@ -0,0 +1,14 @@ +export function flowDb (ctx, node) { + ctx.beginPath() + const offsetY = node.rect.height / 7 + ctx.moveTo(node.rect.x, node.rect.y + offsetY) + ctx.bezierCurveTo(node.rect.x, (node.rect.y - offsetY / 2) | 0, node.rect.ex, (node.rect.y - offsetY / 2) | 0, node.rect.ex, node.rect.y + offsetY) + ctx.lineTo(node.rect.ex, node.rect.ey - offsetY) + ctx.bezierCurveTo(node.rect.ex, (node.rect.ey + offsetY / 2) | 0, node.rect.x, (node.rect.ey + offsetY / 2) | 0, node.rect.x, node.rect.ey - offsetY) + ctx.closePath() + ctx.moveTo(node.rect.x, node.rect.ey - offsetY) + ctx.bezierCurveTo(node.rect.x, (node.rect.ey - offsetY * 2) | 0, node.rect.ex, (node.rect.ey - offsetY * 2) | 0, node.rect.ex, node.rect.ey - offsetY); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=db.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/db.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/db.js.map new file mode 100644 index 000000000..7213e9e0c --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/db.js.map @@ -0,0 +1 @@ +{"version":3,"file":"db.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/db/db.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,MAAM,CAAC,GAA6B,EAAE,IAAU;IAC9D,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,IAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACrC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;IAC/C,GAAG,CAAC,aAAa,CACf,IAAI,CAAC,IAAI,CAAC,CAAC,EACX,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,EAC/B,IAAI,CAAC,I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AC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/db.rect.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/db.rect.d.ts new file mode 100644 index 000000000..db5025bd8 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/db.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '@topology/core'; +export declare function flowDbIconRect(node: Node): void; +export declare function flowDbTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/db.rect.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/db.rect.js new file mode 100644 index 000000000..c241436eb --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/db.rect.js @@ -0,0 +1,9 @@ +import { Rect } from '@topology/core' +export function flowDbIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function flowDbTextRect (node) { + node.textRect = new Rect(node.rect.x, node.rect.y + node.rect.height / 8, node.rect.width, (node.rect.height * 5) / 8) + node.fullTextRect = node.textRect +} +// # sourceMappingURL=db.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/db.rect.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/db.rect.js.map new file mode 100644 index 000000000..f806be644 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/db.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"db.rect.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/db/db.rect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,cAAc,CAAC,IAAU;IACvC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAU;IACvC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CACtB,IAAI,CAAC,IAAI,CAAC,CAAC,EACX,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAClC,IAAI,CAAC,IAAI,CAAC,KAAK,EACf,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAC3B,CAAC;IACF,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/index.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/index.d.ts new file mode 100644 index 000000000..5042e91e4 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/index.d.ts @@ -0,0 +1,2 @@ +export * from './db'; +export * from './db.rect'; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/index.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/index.js new file mode 100644 index 000000000..ebd9d9b2d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/index.js @@ -0,0 +1,3 @@ +export * from './db' +export * from './db.rect' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/index.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/index.js.map new file mode 100644 index 000000000..6c5f705a8 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/db/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/db/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC;AACrB,cAAc,WAAW,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.anchor.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.anchor.d.ts new file mode 100644 index 000000000..52eaa9612 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function flowDisplayAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.anchor.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.anchor.js new file mode 100644 index 000000000..1ac171af7 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.anchor.js @@ -0,0 +1,8 @@ +import { Point, Direction } from '@topology/core' +export function flowDisplayAnchors (node) { + node.anchors.push(new Point(node.rect.x, node.rect.y + node.rect.height / 2, Direction.Left)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y, Direction.Up)) + node.anchors.push(new Point(node.rect.x + node.rect.width, node.rect.y + node.rect.height / 2, Direction.Right)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y + node.rect.height, Direction.Bottom)) +} +// # sourceMappingURL=display.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.anchor.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.anchor.js.map new file mode 100644 index 000000000..1d0df95fb --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"display.anchor.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/display/display.anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAQ,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,UAAU,kBAAkB,CAAC,IAAU;IAC3C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9F,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3F,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IACjH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;AACpH,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.d.ts new file mode 100644 index 000000000..09a760cd6 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function flowDisplay(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.js new file mode 100644 index 000000000..8b95f257f --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.js @@ -0,0 +1,13 @@ +export function flowDisplay (ctx, node) { + ctx.beginPath() + const offsetX = node.rect.width / 8 + ctx.moveTo(node.rect.x + offsetX, node.rect.y) + ctx.lineTo(node.rect.ex - offsetX, node.rect.y) + ctx.bezierCurveTo(node.rect.ex + offsetX / 3, node.rect.y, node.rect.ex + offsetX / 3, node.rect.ey, node.rect.ex - offsetX, node.rect.ey) + ctx.lineTo(node.rect.x + offsetX, node.rect.ey) + ctx.lineTo(node.rect.x, node.rect.y + node.rect.height / 2) + ctx.closePath(); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=display.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.js.map new file mode 100644 index 000000000..5d14791bd --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.js.map @@ -0,0 +1 @@ +{"version":3,"file":"display.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/display/display.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,WAAW,CAAC,GAA6B,EAAE,IAAU;IACnE,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,IAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACpC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/C,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChD,GAAG,CAAC,aAAa,CACf,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,GAAG,CAAC,EAC1B,IAAI,CAAC,IAAI,CAAC,CAAC,EACX,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,GAAG,CAAC,EAC1B,IAAI,CAAC,IAAI,CAAC,EAAE,EACZ,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,EACtB,IAAI,CAAC,IAAI,CAAC,EAAE,CACb,CAAC;IACF,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChD,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC5D,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.rect.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.rect.d.ts new file mode 100644 index 000000000..fb7ea8cdc --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '@topology/core'; +export declare function flowDisplayIconRect(node: Node): void; +export declare function flowDisplayTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.rect.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.rect.js new file mode 100644 index 000000000..04489b05e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.rect.js @@ -0,0 +1,9 @@ +import { Rect } from '@topology/core' +export function flowDisplayIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function flowDisplayTextRect (node) { + node.textRect = new Rect(node.rect.x + node.rect.width / 8, node.rect.y, (node.rect.width * 3) / 4, node.rect.height) + node.fullTextRect = node.textRect +} +// # sourceMappingURL=display.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.rect.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.rect.js.map new file mode 100644 index 000000000..e73c39d2e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/display.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"display.rect.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/display/display.rect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,mBAAmB,CAAC,IAAU;IAC5C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,IAAU;IAC5C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CACtB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EACjC,IAAI,CAAC,IAAI,CAAC,CAAC,EACX,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,EACzB,IAAI,CAAC,IAAI,CAAC,MAAM,CACjB,CAAC;IACF,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/index.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/index.d.ts new file mode 100644 index 000000000..ebb5bde05 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/index.d.ts @@ -0,0 +1,3 @@ +export * from './display'; +export * from './display.anchor'; +export * from './display.rect'; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/index.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/index.js new file mode 100644 index 000000000..a5fde552c --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/index.js @@ -0,0 +1,4 @@ +export * from './display' +export * from './display.anchor' +export * from './display.rect' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/index.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/index.js.map new file mode 100644 index 000000000..afed6e476 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/display/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/display/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.anchor.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.anchor.d.ts new file mode 100644 index 000000000..b851e2532 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function flowDocumentAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.anchor.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.anchor.js new file mode 100644 index 000000000..7e07066f4 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.anchor.js @@ -0,0 +1,8 @@ +import { Point, Direction } from '@topology/core' +export function flowDocumentAnchors (node) { + node.anchors.push(new Point(node.rect.x, node.rect.y + node.rect.height / 2, Direction.Left)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y, Direction.Up)) + node.anchors.push(new Point(node.rect.x + node.rect.width, node.rect.y + node.rect.height / 2, Direction.Right)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y + (node.rect.height * 6) / 7, Direction.Bottom)) +} +// # sourceMappingURL=document.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.anchor.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.anchor.js.map new file mode 100644 index 000000000..36018cb64 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"document.anchor.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/document/document.anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,UAAU,mBAAmB,CAAC,IAAU;IAC5C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9F,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3F,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IACjH,IAAI,CAAC,OAAO,CAAC,IAAI,CACf,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CACzG,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.d.ts new file mode 100644 index 000000000..8dd15fbf8 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function flowDocument(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.js new file mode 100644 index 000000000..612e57baf --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.js @@ -0,0 +1,15 @@ +export function flowDocument (ctx, node) { + ctx.beginPath() + const x = node.rect.x + node.rect.width / 2 + const y = node.rect.y + (node.rect.height * 6) / 7 + const offsetY = node.rect.height / 6 + ctx.moveTo(node.rect.x, node.rect.y) + ctx.lineTo(node.rect.ex, node.rect.y) + ctx.lineTo(node.rect.ex, y) + ctx.bezierCurveTo(node.rect.ex - 20, y - offsetY, x + node.rect.width / 5, y - offsetY, x, y) + ctx.bezierCurveTo(x - node.rect.width / 5, y + offsetY, node.rect.x, y + offsetY, node.rect.x, y) + ctx.closePath(); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=document.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.js.map new file mode 100644 index 000000000..f2cec39d8 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.js.map @@ -0,0 +1 @@ +{"version":3,"file":"document.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/document/document.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,YAAY,CAAC,GAA6B,EAAE,IAAU;IACpE,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,IAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IAC5C,IAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACnD,IAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACrC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACrC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACtC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAC5B,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9F,GAAG,CAAC,aAAa,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAClG,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.rect.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.rect.d.ts new file mode 100644 index 000000000..fd0c9f339 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '@topology/core'; +export declare function flowDocumentIconRect(node: Node): void; +export declare function flowDocumentTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.rect.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.rect.js new file mode 100644 index 000000000..cc14b8847 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.rect.js @@ -0,0 +1,9 @@ +import { Rect } from '@topology/core' +export function flowDocumentIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function flowDocumentTextRect (node) { + node.textRect = new Rect(node.rect.x, node.rect.y, node.rect.width, (node.rect.height * 5) / 7) + node.fullTextRect = node.textRect +} +// # sourceMappingURL=document.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.rect.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.rect.js.map new file mode 100644 index 000000000..373a1119d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/document.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"document.rect.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/document/document.rect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,oBAAoB,CAAC,IAAU;IAC7C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,IAAU;IAC7C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAChG,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/index.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/index.d.ts new file mode 100644 index 000000000..8458b15e3 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/index.d.ts @@ -0,0 +1,3 @@ +export * from './document'; +export * from './document.anchor'; +export * from './document.rect'; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/index.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/index.js new file mode 100644 index 000000000..259555a06 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/index.js @@ -0,0 +1,4 @@ +export * from './document' +export * from './document.anchor' +export * from './document.rect' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/index.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/index.js.map new file mode 100644 index 000000000..3e06a1527 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/document/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/document/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.anchor.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.anchor.d.ts new file mode 100644 index 000000000..a2659f6d0 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function flowExternStorageAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.anchor.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.anchor.js new file mode 100644 index 000000000..49dc9757e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.anchor.js @@ -0,0 +1,8 @@ +import { Point, Direction } from '@topology/core' +export function flowExternStorageAnchors (node) { + node.anchors.push(new Point(node.rect.x, node.rect.y + node.rect.height / 2, Direction.Left)) + node.anchors.push(new Point(node.rect.x + (node.rect.width * 8) / 15, node.rect.y, Direction.Up)) + node.anchors.push(new Point(node.rect.x + (node.rect.width * 13) / 14, node.rect.y + node.rect.height / 2, Direction.Right)) + node.anchors.push(new Point(node.rect.x + (node.rect.width * 8) / 15, node.rect.ey, Direction.Bottom)) +} +// # sourceMappingURL=externStorage.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.anchor.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.anchor.js.map new file mode 100644 index 000000000..12acc4ab8 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"externStorage.anchor.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/externStorage/externStorage.anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,UAAU,wBAAwB,CAAC,IAAU;IACjD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9F,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IAClG,IAAI,CAAC,OAAO,CAAC,IAAI,CACf,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAC1G,CAAC;IAEF,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;AACzG,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.d.ts new file mode 100644 index 000000000..c2530d3a4 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function flowExternStorage(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.js new file mode 100644 index 000000000..ebf2d07fa --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.js @@ -0,0 +1,12 @@ +export function flowExternStorage (ctx, node) { + ctx.beginPath() + const offsetX = node.rect.width / 10 + ctx.moveTo(node.rect.x + offsetX * 2, node.rect.y) + ctx.bezierCurveTo(node.rect.x - (offsetX * 2) / 3, node.rect.y, node.rect.x - (offsetX * 2) / 3, node.rect.ey, node.rect.x + offsetX * 2, node.rect.ey) + ctx.lineTo(node.rect.ex, node.rect.ey) + ctx.bezierCurveTo(node.rect.ex - offsetX, node.rect.ey, node.rect.ex - offsetX, node.rect.y, node.rect.ex, node.rect.y) + ctx.closePath(); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=externStorage.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.js.map new file mode 100644 index 000000000..013d68710 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.js.map @@ -0,0 +1 @@ +{"version":3,"file":"externStorage.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/externStorage/externStorage.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,iBAAiB,CAAC,GAA6B,EAAE,IAAU;IACzE,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,IAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IACrC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnD,GAAG,CAAC,aAAa,CACf,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,EAC/B,IAAI,CAAC,IAAI,CAAC,CAAC,EACX,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,EAC/B,IAAI,CAAC,IAAI,CAAC,EAAE,EACZ,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,GAAG,CAAC,EACzB,IAAI,CAAC,IAAI,CAAC,EAAE,CACb,CAAC;IACF,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACvC,GAAG,CAAC,aAAa,CACf,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,EACtB,IAAI,CAAC,IAAI,CAAC,EAAE,EACZ,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,EACtB,IAAI,CAAC,IAAI,CAAC,CAAC,EACX,IAAI,CAAC,IAAI,CAAC,EAAE,EACZ,IAAI,CAAC,IAAI,CAAC,CAAC,CACZ,CAAC;IACF,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.rect.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.rect.d.ts new file mode 100644 index 000000000..8194d4d4a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '@topology/core'; +export declare function flowExternStorageIconRect(node: Node): void; +export declare function flowExternStorageTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.rect.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.rect.js new file mode 100644 index 000000000..f5d27824a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.rect.js @@ -0,0 +1,9 @@ +import { Rect } from '@topology/core' +export function flowExternStorageIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function flowExternStorageTextRect (node) { + node.textRect = new Rect(node.rect.x + node.rect.width / 6, node.rect.y, (node.rect.width * 3) / 4, node.rect.height) + node.fullTextRect = node.textRect +} +// # sourceMappingURL=externStorage.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.rect.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.rect.js.map new file mode 100644 index 000000000..6fad73f98 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/externStorage.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"externStorage.rect.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/externStorage/externStorage.rect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,yBAAyB,CAAC,IAAU;IAClD,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,IAAU;IAClD,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CACtB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EACjC,IAAI,CAAC,IAAI,CAAC,CAAC,EACX,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,EACzB,IAAI,CAAC,IAAI,CAAC,MAAM,CACjB,CAAC;IACF,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/index.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/index.d.ts new file mode 100644 index 000000000..c3e378bdf --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/index.d.ts @@ -0,0 +1,3 @@ +export * from './externStorage'; +export * from './externStorage.anchor'; +export * from './externStorage.rect'; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/index.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/index.js new file mode 100644 index 000000000..c6855e19b --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/index.js @@ -0,0 +1,4 @@ +export * from './externStorage' +export * from './externStorage.anchor' +export * from './externStorage.rect' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/index.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/index.js.map new file mode 100644 index 000000000..aa95d54a3 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/externStorage/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/externStorage/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/index.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/index.d.ts new file mode 100644 index 000000000..db5fc08da --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/index.d.ts @@ -0,0 +1,2 @@ +export * from './internalStorage'; +export * from './internalStorage.rect'; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/index.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/index.js new file mode 100644 index 000000000..48dd8d514 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/index.js @@ -0,0 +1,3 @@ +export * from './internalStorage' +export * from './internalStorage.rect' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/index.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/index.js.map new file mode 100644 index 000000000..dc6643831 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/internalStorage/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/internalStorage.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/internalStorage.d.ts new file mode 100644 index 000000000..4da9832a5 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/internalStorage.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function flowInternalStorage(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/internalStorage.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/internalStorage.js new file mode 100644 index 000000000..242b1d4e5 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/internalStorage.js @@ -0,0 +1,16 @@ +export function flowInternalStorage (ctx, node) { + ctx.beginPath() + ctx.moveTo(node.rect.x, node.rect.y) + ctx.lineTo(node.rect.ex, node.rect.y) + ctx.lineTo(node.rect.ex, node.rect.ey) + ctx.lineTo(node.rect.x, node.rect.ey) + ctx.closePath() + const offset = node.rect.width / 7 + ctx.moveTo(node.rect.x, node.rect.y + offset) + ctx.lineTo(node.rect.ex, node.rect.y + offset) + ctx.moveTo(node.rect.x + offset, node.rect.y) + ctx.lineTo(node.rect.x + offset, node.rect.ey); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=internalStorage.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/internalStorage.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/internalStorage.js.map new file mode 100644 index 000000000..42984007e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/internalStorage.js.map @@ -0,0 +1 @@ +{"version":3,"file":"internalStorage.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/internalStorage/internalStorage.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,mBAAmB,CAAC,GAA6B,EAAE,IAAU;IAC3E,GAAG,CAAC,SAAS,EAAE,CAAC;IAEhB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACrC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACtC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACvC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtC,GAAG,CAAC,SAAS,EAAE,CAAC;IAEhB,IAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACnC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;IAC9C,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;IAE/C,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9C,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAE/C,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/internalStorage.rect.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/internalStorage.rect.d.ts new file mode 100644 index 000000000..215a3c0ab --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/internalStorage.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '@topology/core'; +export declare function flowInternalStorageIconRect(node: Node): void; +export declare function flowInternalStorageTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/internalStorage.rect.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/internalStorage.rect.js new file mode 100644 index 000000000..b4fd53aa2 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/internalStorage.rect.js @@ -0,0 +1,10 @@ +import { Rect } from '@topology/core' +export function flowInternalStorageIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function flowInternalStorageTextRect (node) { + const offset = node.rect.width / 7 + node.textRect = new Rect(node.rect.x + offset, node.rect.y + offset, node.rect.width - offset, node.rect.height - offset) + node.fullTextRect = node.textRect +} +// # sourceMappingURL=internalStorage.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/internalStorage.rect.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/internalStorage.rect.js.map new file mode 100644 index 000000000..6708819fc --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/internalStorage/internalStorage.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"internalStorage.rect.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/internalStorage/internalStorage.rect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,2BAA2B,CAAC,IAAU;IACpD,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,IAAU;IACpD,IAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACnC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CACtB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,EACpB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,EACpB,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,MAAM,EACxB,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,CAC1B,CAAC;IACF,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/index.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/index.d.ts new file mode 100644 index 000000000..025fbbb0a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/index.d.ts @@ -0,0 +1,3 @@ +export * from './manually'; +export * from './manually.anchor'; +export * from './manually.rect'; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/index.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/index.js new file mode 100644 index 000000000..e6364e0ce --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/index.js @@ -0,0 +1,4 @@ +export * from './manually' +export * from './manually.anchor' +export * from './manually.rect' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/index.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/index.js.map new file mode 100644 index 000000000..31dfada45 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/manually/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.anchor.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.anchor.d.ts new file mode 100644 index 000000000..d76656471 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function flowManuallyAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.anchor.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.anchor.js new file mode 100644 index 000000000..e3826e953 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.anchor.js @@ -0,0 +1,8 @@ +import { Point, Direction } from '@topology/core' +export function flowManuallyAnchors (node) { + node.anchors.push(new Point(node.rect.x, node.rect.y + (node.rect.height * 5) / 8, Direction.Left)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y + node.rect.height / 8, Direction.Up)) + node.anchors.push(new Point(node.rect.ex, node.rect.y + node.rect.height / 2, Direction.Right)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.ey, Direction.Bottom)) +} +// # sourceMappingURL=manually.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.anchor.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.anchor.js.map new file mode 100644 index 000000000..066a73f8b --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"manually.anchor.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/manually/manually.anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAQ,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,UAAU,mBAAmB,CAAC,IAAU;IAC5C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACpG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IAClH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IAChG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;AAClG,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.d.ts new file mode 100644 index 000000000..ea4b7215f --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function flowManually(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.js new file mode 100644 index 000000000..f3a21b25b --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.js @@ -0,0 +1,12 @@ +export function flowManually (ctx, node) { + ctx.beginPath() + const offsetY = node.rect.height / 4 + ctx.moveTo(node.rect.x, node.rect.y + offsetY) + ctx.lineTo(node.rect.ex, node.rect.y) + ctx.lineTo(node.rect.ex, node.rect.ey) + ctx.lineTo(node.rect.x, node.rect.ey) + ctx.closePath(); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=manually.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.js.map new file mode 100644 index 000000000..afe6fd78a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.js.map @@ -0,0 +1 @@ +{"version":3,"file":"manually.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/manually/manually.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,YAAY,CAAC,GAA6B,EAAE,IAAU;IACpE,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,IAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACrC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;IAC/C,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACtC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACvC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtC,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.rect.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.rect.d.ts new file mode 100644 index 000000000..e34febc4c --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '@topology/core'; +export declare function flowManuallyIconRect(node: Node): void; +export declare function flowManuallyTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.rect.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.rect.js new file mode 100644 index 000000000..6dd5d4ad5 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.rect.js @@ -0,0 +1,9 @@ +import { Rect } from '@topology/core' +export function flowManuallyIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function flowManuallyTextRect (node) { + node.textRect = new Rect(node.rect.x, node.rect.y + node.rect.height / 4, node.rect.width, (node.rect.height * 3) / 4) + node.fullTextRect = node.textRect +} +// # sourceMappingURL=manually.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.rect.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.rect.js.map new file mode 100644 index 000000000..e45ec0b24 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/manually/manually.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"manually.rect.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/manually/manually.rect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,oBAAoB,CAAC,IAAU;IAC7C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,IAAU;IAC7C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CACtB,IAAI,CAAC,IAAI,CAAC,CAAC,EACX,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAClC,IAAI,CAAC,IAAI,CAAC,KAAK,EACf,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAC3B,CAAC;IACF,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/index.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/index.d.ts new file mode 100644 index 000000000..339d24c49 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/index.d.ts @@ -0,0 +1,2 @@ +export * from './parallel'; +export * from './parallel.anchor'; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/index.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/index.js new file mode 100644 index 000000000..f3a02216a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/index.js @@ -0,0 +1,3 @@ +export * from './parallel' +export * from './parallel.anchor' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/index.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/index.js.map new file mode 100644 index 000000000..c8786b516 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/parallel/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/parallel.anchor.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/parallel.anchor.d.ts new file mode 100644 index 000000000..4730803a4 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/parallel.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function flowParallelAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/parallel.anchor.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/parallel.anchor.js new file mode 100644 index 000000000..c2f5e9da3 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/parallel.anchor.js @@ -0,0 +1,6 @@ +import { Point, Direction } from '@topology/core' +export function flowParallelAnchors (node) { + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y, Direction.Up)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y + node.rect.height, Direction.Bottom)) +} +// # sourceMappingURL=parallel.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/parallel.anchor.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/parallel.anchor.js.map new file mode 100644 index 000000000..655a361e4 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/parallel.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parallel.anchor.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/parallel/parallel.anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAQ,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,UAAU,mBAAmB,CAAC,IAAU;IAC5C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3F,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;AACpH,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/parallel.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/parallel.d.ts new file mode 100644 index 000000000..49c4f6a22 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/parallel.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function flowParallel(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/parallel.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/parallel.js new file mode 100644 index 000000000..860ed8de2 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/parallel.js @@ -0,0 +1,9 @@ +export function flowParallel (ctx, node) { + ctx.beginPath() + ctx.moveTo(node.rect.x, node.rect.y) + ctx.lineTo(node.rect.ex, node.rect.y) + ctx.moveTo(node.rect.x, node.rect.ey) + ctx.lineTo(node.rect.ex, node.rect.ey) + ctx.stroke() +} +// # sourceMappingURL=parallel.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/parallel.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/parallel.js.map new file mode 100644 index 000000000..bb2efe3bb --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/parallel/parallel.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parallel.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/parallel/parallel.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,YAAY,CAAC,GAA6B,EAAE,IAAU;IACpE,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACrC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACtC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACvC,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/index.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/index.d.ts new file mode 100644 index 000000000..35772455c --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/index.d.ts @@ -0,0 +1,2 @@ +export * from './queue'; +export * from './queue.rect'; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/index.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/index.js new file mode 100644 index 000000000..f0abcee58 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/index.js @@ -0,0 +1,3 @@ +export * from './queue' +export * from './queue.rect' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/index.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/index.js.map new file mode 100644 index 000000000..7998c777a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/queue/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/queue.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/queue.d.ts new file mode 100644 index 000000000..361cce71a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/queue.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function flowQueue(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/queue.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/queue.js new file mode 100644 index 000000000..fa2d90ac7 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/queue.js @@ -0,0 +1,9 @@ +export function flowQueue (ctx, node) { + ctx.beginPath() + ctx.ellipse(node.rect.x + node.rect.width / 2, node.rect.y + node.rect.height / 2, node.rect.width / 2, node.rect.height / 2, 0, 0, Math.PI * 2) + ctx.moveTo(node.rect.x + node.rect.width / 2, node.rect.ey) + ctx.lineTo(node.rect.ex, node.rect.ey); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=queue.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/queue.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/queue.js.map new file mode 100644 index 000000000..06aa64fa1 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/queue.js.map @@ -0,0 +1 @@ +{"version":3,"file":"queue.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/queue/queue.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,SAAS,CAAC,GAA6B,EAAE,IAAU;IACjE,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,OAAO,CACT,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EACjC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAClC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EACnB,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EACpB,CAAC,EACD,CAAC,EACD,IAAI,CAAC,EAAE,GAAG,CAAC,CACZ,CAAC;IAEF,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5D,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEvC,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/queue.rect.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/queue.rect.d.ts new file mode 100644 index 000000000..c5c414480 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/queue.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '@topology/core'; +export declare function flowQueueIconRect(node: Node): void; +export declare function flowQueueTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/queue.rect.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/queue.rect.js new file mode 100644 index 000000000..385fbe67e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/queue.rect.js @@ -0,0 +1,11 @@ +import { Rect } from '@topology/core' +export function flowQueueIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function flowQueueTextRect (node) { + const w = (node.rect.width * 5) / 7 + const h = (node.rect.height * 5) / 7 + node.textRect = new Rect(node.rect.x + (node.rect.width - w) / 2, node.rect.y + (node.rect.height - h) / 2, w, h) + node.fullTextRect = node.textRect +} +// # sourceMappingURL=queue.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/queue.rect.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/queue.rect.js.map new file mode 100644 index 000000000..bd3d8ad05 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/queue/queue.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"queue.rect.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/queue/queue.rect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,iBAAiB,CAAC,IAAU;IAC1C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAU;IAC1C,IAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACpC,IAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAClH,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/register.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/register.d.ts new file mode 100644 index 000000000..bf35c08a1 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/register.d.ts @@ -0,0 +1 @@ +export declare function register(): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/register.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/register.js new file mode 100644 index 000000000..c5bd4ad4a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/register.js @@ -0,0 +1,26 @@ +import { registerNode } from '@topology/core' +import { flowData, flowDataAnchors, flowDataIconRect, flowDataTextRect } from './data' +import { flowSubprocess, flowSubprocessIconRect, flowSubprocessTextRect } from './subprocess' +import { flowDb, flowDbIconRect, flowDbTextRect } from './db' +import { flowDocument, flowDocumentAnchors, flowDocumentIconRect, flowDocumentTextRect } from './document' +import { flowInternalStorage, flowInternalStorageIconRect, flowInternalStorageTextRect } from './internalStorage' +import { flowExternStorage, flowExternStorageAnchors, flowExternStorageIconRect, flowExternStorageTextRect } from './externStorage' +import { flowQueue, flowQueueIconRect, flowQueueTextRect } from './queue' +import { flowManually, flowManuallyAnchors, flowManuallyIconRect, flowManuallyTextRect } from './manually' +import { flowDisplay, flowDisplayAnchors, flowDisplayIconRect, flowDisplayTextRect } from './display' +import { flowParallel, flowParallelAnchors } from './parallel' +import { flowComment, flowCommentAnchors } from './comment' +export function register () { + registerNode('flowData', flowData, flowDataAnchors, flowDataIconRect, flowDataTextRect) + registerNode('flowSubprocess', flowSubprocess, null, flowSubprocessIconRect, flowSubprocessTextRect) + registerNode('flowDb', flowDb, null, flowDbIconRect, flowDbTextRect) + registerNode('flowDocument', flowDocument, flowDocumentAnchors, flowDocumentIconRect, flowDocumentTextRect) + registerNode('flowInternalStorage', flowInternalStorage, null, flowInternalStorageIconRect, flowInternalStorageTextRect) + registerNode('flowExternStorage', flowExternStorage, flowExternStorageAnchors, flowExternStorageIconRect, flowExternStorageTextRect) + registerNode('flowQueue', flowQueue, null, flowQueueIconRect, flowQueueTextRect) + registerNode('flowManually', flowManually, flowManuallyAnchors, flowManuallyIconRect, flowManuallyTextRect) + registerNode('flowDisplay', flowDisplay, flowDisplayAnchors, flowDisplayIconRect, flowDisplayTextRect) + registerNode('flowParallel', flowParallel, flowParallelAnchors, null, null) + registerNode('flowComment', flowComment, flowCommentAnchors, null, null) +} +// # sourceMappingURL=register.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/register.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/register.js.map new file mode 100644 index 000000000..071739e9f --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/register.js.map @@ -0,0 +1 @@ +{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../packages/flow-diagram/src/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC9F,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC3G,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAClH,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EAC1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,mB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aAAa,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAC3E,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/index.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/index.d.ts new file mode 100644 index 000000000..ee9f9c495 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/index.d.ts @@ -0,0 +1,2 @@ +export * from './subprocess'; +export * from './subprocess.rect'; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/index.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/index.js new file mode 100644 index 000000000..83655bd9d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/index.js @@ -0,0 +1,3 @@ +export * from './subprocess' +export * from './subprocess.rect' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/index.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/index.js.map new file mode 100644 index 000000000..d8d57cbbe --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/subprocess/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/subprocess.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/subprocess.d.ts new file mode 100644 index 000000000..6fe4241ae --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/subprocess.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function flowSubprocess(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/subprocess.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/subprocess.js new file mode 100644 index 000000000..43f61baca --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/subprocess.js @@ -0,0 +1,16 @@ +export function flowSubprocess (ctx, node) { + ctx.beginPath() + const offsetX = node.rect.width / 7 + ctx.moveTo(node.rect.x, node.rect.y) + ctx.lineTo(node.rect.ex, node.rect.y) + ctx.lineTo(node.rect.ex, node.rect.ey) + ctx.lineTo(node.rect.x, node.rect.ey) + ctx.closePath() + ctx.moveTo(node.rect.x + offsetX, node.rect.y) + ctx.lineTo(node.rect.x + offsetX, node.rect.ey) + ctx.moveTo(node.rect.ex - offsetX, node.rect.y) + ctx.lineTo(node.rect.ex - offsetX, node.rect.ey); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=subprocess.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/subprocess.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/subprocess.js.map new file mode 100644 index 000000000..beea510ff --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/subprocess.js.map @@ -0,0 +1 @@ +{"version":3,"file":"subprocess.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/subprocess/subprocess.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,cAAc,CAAC,GAA6B,EAAE,IAAU;IACtE,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,IAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACpC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACrC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACtC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACvC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtC,GAAG,CAAC,SAAS,EAAE,CAAC;IAEhB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/C,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEhD,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChD,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEjD,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/subprocess.rect.d.ts b/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/subprocess.rect.d.ts new file mode 100644 index 000000000..8c5ecda0a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/subprocess.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '@topology/core'; +export declare function flowSubprocessIconRect(node: Node): void; +export declare function flowSubprocessTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/subprocess.rect.js b/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/subprocess.rect.js new file mode 100644 index 000000000..61d6ec549 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/subprocess.rect.js @@ -0,0 +1,9 @@ +import { Rect } from '@topology/core' +export function flowSubprocessIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function flowSubprocessTextRect (node) { + node.textRect = new Rect(node.rect.x + node.rect.width / 7, node.rect.y, (node.rect.width * 5) / 7, node.rect.height) + node.fullTextRect = node.textRect +} +// # sourceMappingURL=subprocess.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/subprocess.rect.js.map b/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/subprocess.rect.js.map new file mode 100644 index 000000000..a4956ef19 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/flow-diagram/src/subprocess/subprocess.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"subprocess.rect.js","sourceRoot":"","sources":["../../../../packages/flow-diagram/src/subprocess/subprocess.rect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,sBAAsB,CAAC,IAAU;IAC/C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,IAAU;IAC/C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CACtB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EACjC,IAAI,CAAC,IAAI,CAAC,CAAC,EACX,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,EACzB,IAAI,CAAC,IAAI,CAAC,MAAM,CACjB,CAAC;IACF,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/layout/index.d.ts b/nezha-fronted/src/components/common/@topology/layout/index.d.ts new file mode 100644 index 000000000..5d6d2291e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/layout/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/align'; +export * from './src/layout'; diff --git a/nezha-fronted/src/components/common/@topology/layout/index.js b/nezha-fronted/src/components/common/@topology/layout/index.js new file mode 100644 index 000000000..d07c49563 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/layout/index.js @@ -0,0 +1,3 @@ +export * from './src/align' +export * from './src/layout' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/layout/index.js.map b/nezha-fronted/src/components/common/@topology/layout/index.js.map new file mode 100644 index 000000000..10627e8a4 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/layout/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../packages/layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/layout/package.json b/nezha-fronted/src/components/common/@topology/layout/package.json new file mode 100644 index 000000000..83c1435b6 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/layout/package.json @@ -0,0 +1,64 @@ +{ + "_args": [ + [ + "@topology/layout@0.3.0", + "D:\\a\\nezha-fronted\\nezha-fronted" + ] + ], + "_from": "@topology/layout@0.3.0", + "_id": "@topology/layout@0.3.0", + "_inBundle": false, + "_integrity": "sha512-t9SSU7RroRfnKO3K5cfsB7eIfE2jW/t7O+79nVGgNqQljxaCSG8wQPWw6BqnmYJ072uHf85z1QUIjjboSEHupg==", + "_location": "/@topology/layout", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@topology/layout@0.3.0", + "name": "@topology/layout", + "escapedName": "@topology%2flayout", + "scope": "@topology", + "rawSpec": "0.3.0", + "saveSpec": null, + "fetchSpec": "0.3.0" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/@topology/layout/-/layout-0.3.0.tgz", + "_spec": "0.3.0", + "_where": "D:\\a\\nezha-fronted\\nezha-fronted", + "author": { + "name": "alsmile123@qq.com" + }, + "bugs": { + "url": "https://github.com/le5le-com/topology/issues" + }, + "description": "A layout tool for le5le-topology.", + "gitHead": "78f2a53ca1839c89b56e2e498d17ba4eb987ad14", + "homepage": "https://github.com/le5le-com/topology#readme", + "keywords": [ + "topology", + "chart", + "canvas" + ], + "license": "ISC", + "main": "index.js", + "name": "@topology/layout", + "peerDependencies": { + "@topology/core": "^0.3.0" + }, + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/le5le-com/topology.git" + }, + "scripts": { + "build": "tsc && npm run copy", + "copy": "copyfiles package.json ../../dist/layout/" + }, + "types": "index.d.ts", + "version": "0.3.0" +} diff --git a/nezha-fronted/src/components/common/@topology/layout/src/align.d.ts b/nezha-fronted/src/components/common/@topology/layout/src/align.d.ts new file mode 100644 index 000000000..c2a79a39b --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/layout/src/align.d.ts @@ -0,0 +1,3 @@ +import { Pen, Rect } from '@topology/core'; +export declare function alignNodes(pens: Pen[], rect: Rect, align: string): void; +export declare function spaceBetween(pens: Pen[], width: number): void; diff --git a/nezha-fronted/src/components/common/@topology/layout/src/align.js b/nezha-fronted/src/components/common/@topology/layout/src/align.js new file mode 100644 index 000000000..c0f44db3e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/layout/src/align.js @@ -0,0 +1,63 @@ +import { Node } from '@topology/core' +export function alignNodes (pens, rect, align) { + for (let _i = 0, pens_1 = pens; _i < pens_1.length; _i++) { + const item = pens_1[_i] + if (!(item instanceof Node)) { + continue + } + switch (align) { + case 'left': + item.rect.x = rect.x + break + case 'right': + item.rect.x = rect.ex - item.rect.width + break + case 'top': + item.rect.y = rect.y + break + case 'bottom': + item.rect.y = rect.ey - item.rect.height + break + case 'center': + item.rect.x = rect.center.x - item.rect.width / 2 + break + case 'middle': + item.rect.y = rect.center.y - item.rect.height / 2 + break + } + item.rect.floor() + item.rect.calcCenter() + item.init() + item.calcChildrenRect() + } +} +export function spaceBetween (pens, width) { + let space = 0 + let cnt = 0 + for (let _i = 0, pens_2 = pens; _i < pens_2.length; _i++) { + var item = pens_2[_i] + if (!(item instanceof Node)) { + continue + } + space += item.rect.width + ++cnt + } + space = (width - space) / (cnt - 1) + let left = 0 + for (let _a = 0, pens_3 = pens; _a < pens_3.length; _a++) { + var item = pens_3[_a] + if (!(item instanceof Node)) { + continue + } + if (!left) { + left = item.rect.x + } + item.rect.x = left + left += item.rect.width + space + item.rect.floor() + item.rect.calcCenter() + item.init() + item.calcChildrenRect() + } +} +// # sourceMappingURL=align.js.map diff --git a/nezha-fronted/src/components/common/@topology/layout/src/align.js.map b/nezha-fronted/src/components/common/@topology/layout/src/align.js.map new file mode 100644 index 000000000..b67fc609b --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/layout/src/align.js.map @@ -0,0 +1 @@ +{"version":3,"file":"align.js","sourceRoot":"","sources":["../../../packages/layout/src/align.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,IAAI,EAAQ,MAAM,gBAAgB,CAAC;AAEjD,MAAM,UAAU,UAAU,CAAC,IAAW,EAAE,IAAU,EAAE,KAAa;IAC/D,KAAmB,UAAI,EAAJ,aAAI,EAAJ,kBAAI,EAAJ,IAAI,EAAE;QAApB,IAAM,IAAI,aAAA;QACb,IAAI,CAAC,CAAC,IAAI,YAAY,IAAI,CAAC,EAAE;YAC3B,SAAS;SACV;QACD,QAAQ,KAAK,EAAE;YACb,KAAK,MAAM;gBACT,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;gBACrB,MAAM;YACR,K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K,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IAEpC,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAmB,UAAI,EAAJ,aAAI,EAAJ,kBAAI,EAAJ,IAAI,EAAE;QAApB,IAAM,IAAI,aAAA;QACb,IAAI,CAAC,CAAC,IAAI,YAAY,IAAI,CAAC,EAAE;YAC3B,SAAS;SACV;QAED,IAAI,CAAC,IAAI,EAAE;YACT,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;SACpB;QACD,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;QACnB,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEhC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;QACvB,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,IAAI,CAAC,gBAAgB,EAAE,CAAC;KACzB;AACH,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/layout/src/layout.d.ts b/nezha-fronted/src/components/common/@topology/layout/src/layout.d.ts new file mode 100644 index 000000000..6eaf0b60c --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/layout/src/layout.d.ts @@ -0,0 +1,9 @@ +import { Pen } from '@topology/core'; +export declare function layout(pens: Pen[], params: { + maxWidth: number; + nodeWidth?: number; + nodeHeight?: number; + maxCount?: number; + spaceWidth?: number; + spaceHeight?: number; +}): void; diff --git a/nezha-fronted/src/components/common/@topology/layout/src/layout.js b/nezha-fronted/src/components/common/@topology/layout/src/layout.js new file mode 100644 index 000000000..3c953d0ad --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/layout/src/layout.js @@ -0,0 +1,50 @@ +import { PenType, getRect } from '@topology/core' +import { alignNodes, spaceBetween } from './align' +export function layout (pens, params) { + const spaceWidth = params.spaceWidth || 30 + const spaceHeight = params.spaceHeight || 30 + const rect = getRect(pens) + let left = rect.x + let top = rect.y + const rows = [] + let row = [] + let maxHeight = 0 + for (let _i = 0, pens_1 = pens; _i < pens_1.length; _i++) { + var item = pens_1[_i] + if (item.type === PenType.Line) { + continue + } + if (params.nodeWidth > 0) { + item.rect.width = params.nodeWidth + } + if (params.nodeHeight > 0) { + item.rect.height = params.nodeHeight + } + if (item.rect.height > maxHeight) { + maxHeight = item.rect.height + } + item.rect.x = left + item.rect.y = top + item.rect.init() + row.push(item) + left += item.rect.width + spaceWidth + if (left > params.maxWidth || (params.maxCount > 0 && row.length >= params.maxCount)) { + rows.push(row) + row = [] + left = rect.x + top += maxHeight + spaceHeight + maxHeight = 0 + } + } + rows.push(row) + for (let _a = 0, rows_1 = rows; _a < rows_1.length; _a++) { + var item = rows_1[_a] + const r = getRect(item) + r.width = params.maxWidth + alignNodes(item, r, 'middle') + if (params.maxCount > 0) { + spaceBetween(item, params.maxWidth) + } + } +} +// # sourceMappingURL=layout.js.map diff --git a/nezha-fronted/src/components/common/@topology/layout/src/layout.js.map b/nezha-fronted/src/components/common/@topology/layout/src/layout.js.map new file mode 100644 index 000000000..37cc999dd --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/layout/src/layout.js.map @@ -0,0 +1 @@ +{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../packages/layout/src/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnD,MAAM,UAAU,MAAM,CAAC,IAAW,EAAE,MAOnC;IACC,IAAM,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;IAC3C,IAAM,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,EAAE,CAAC;IAE7C,IAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3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I,GAAG,IAAI,CAAC,CAAC,CAAC;YACd,GAAG,IAAI,SAAS,GAAG,WAAW,CAAC;YAC/B,SAAS,GAAG,CAAC,CAAC;SACf;KACF;IACD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEf,KAAmB,UAAI,EAAJ,aAAI,EAAJ,kBAAI,EAAJ,IAAI,EAAE;QAApB,IAAM,IAAI,aAAA;QACb,IAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC,CAAC,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC1B,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;QAC9B,IAAI,MAAM,CAAC,QAAQ,GAAG,CAAC,EAAE;YACvB,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;SACrC;KACF;AACH,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/index.d.ts b/nezha-fronted/src/components/common/@topology/sequence-diagram/index.d.ts new file mode 100644 index 000000000..a36f9e6e1 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/lifeline'; +export * from './src/focus'; +export * from './src/register'; diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/index.js b/nezha-fronted/src/components/common/@topology/sequence-diagram/index.js new file mode 100644 index 000000000..da99c0d5b --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/index.js @@ -0,0 +1,4 @@ +export * from './src/lifeline' +export * from './src/focus' +export * from './src/register' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/index.js.map b/nezha-fronted/src/components/common/@topology/sequence-diagram/index.js.map new file mode 100644 index 000000000..c7ff2b261 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../packages/sequence-diagram/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/package.json b/nezha-fronted/src/components/common/@topology/sequence-diagram/package.json new file mode 100644 index 000000000..cfd280ad0 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/package.json @@ -0,0 +1,65 @@ +{ + "_args": [ + [ + "@topology/sequence-diagram@0.3.0", + "D:\\a\\nezha-fronted\\nezha-fronted" + ] + ], + "_from": "@topology/sequence-diagram@0.3.0", + "_id": "@topology/sequence-diagram@0.3.0", + "_inBundle": false, + "_integrity": "sha512-qSLXKd//lW5jb/e7nMRwxRWz/bXmkourVHBmZ2cRulZPe0KTeLiE/LkYJ+ffDFNDdCIYedHBC+CeQc3PULCqRQ==", + "_location": "/@topology/sequence-diagram", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@topology/sequence-diagram@0.3.0", + "name": "@topology/sequence-diagram", + "escapedName": "@topology%2fsequence-diagram", + "scope": "@topology", + "rawSpec": "0.3.0", + "saveSpec": null, + "fetchSpec": "0.3.0" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/@topology/sequence-diagram/-/sequence-diagram-0.3.0.tgz", + "_spec": "0.3.0", + "_where": "D:\\a\\nezha-fronted\\nezha-fronted", + "author": { + "name": "alsmile123@qq.com" + }, + "bugs": { + "url": "https://github.com/le5le-com/topology/issues" + }, + "description": "A sequence diagram tool using le5le-topology.", + "gitHead": "78f2a53ca1839c89b56e2e498d17ba4eb987ad14", + "homepage": "https://github.com/le5le-com/topology#readme", + "keywords": [ + "topology", + "sequence", + "diagram", + "canvas" + ], + "license": "ISC", + "main": "index.js", + "name": "@topology/sequence-diagram", + "peerDependencies": { + "@topology/core": "^0.3.0" + }, + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/le5le-com/topology.git" + }, + "scripts": { + "build": "tsc && npm run copy", + "copy": "copyfiles package.json ../../dist/sequence-diagram/" + }, + "types": "index.d.ts", + "version": "0.3.0" +} diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.anchor.d.ts b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.anchor.d.ts new file mode 100644 index 000000000..4f729537d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function sequenceFocusAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.anchor.js b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.anchor.js new file mode 100644 index 000000000..17f24b4d7 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.anchor.js @@ -0,0 +1,15 @@ +import { Point, Direction } from '@topology/core' +export function sequenceFocusAnchors (node) { + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y, Direction.Up)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.ey, Direction.Bottom)) + const dis = 5 + for (let i = dis; node.rect.y + i < node.rect.ey; i = i + dis) { + const pt1 = new Point(node.rect.x, node.rect.y + i, Direction.Left) + const pt2 = new Point(node.rect.ex, node.rect.y + i, Direction.Right) + pt1.hidden = true + pt2.hidden = true + node.anchors.push(pt1) + node.anchors.push(pt2) + } +} +// # sourceMappingURL=focus.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.anchor.js.map b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.anchor.js.map new file mode 100644 index 000000000..f7bc48a9d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"focus.anchor.js","sourceR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CAAC,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACxB;AACH,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.d.ts b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.d.ts new file mode 100644 index 000000000..717cd1508 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function sequenceFocus(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.js b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.js new file mode 100644 index 000000000..d8aa56ed7 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.js @@ -0,0 +1,12 @@ +export function sequenceFocus (ctx, node) { + ctx.beginPath() + ctx.rect(node.rect.x, node.rect.y, node.rect.width, node.rect.height) + if (this.fillStyle) { + ctx.fillStyle = this.fillStyle + } else { + ctx.fillStyle = '#fff' + } + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() +} +// # sourceMappingURL=focus.js.map diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.js.map b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.js.map new file mode 100644 index 000000000..7c71257de --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.js.map @@ -0,0 +1 @@ +{"version":3,"file":"focus.js","sourceRoot":"","sources":["../../../../packages/sequence-diagram/src/focus/focus.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,aAAa,CAAC,GAA6B,EAAE,IAAU;IACrE,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACtE,IAAI,IAAI,CAAC,SAAS,EAAE;QAClB,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;KAChC;SAAM;QACL,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC;KACxB;IACD,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9C,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.rect.d.ts b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.rect.d.ts new file mode 100644 index 000000000..a6e5fd145 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '@topology/core'; +export declare function sequenceFocusIconRect(node: Node): void; +export declare function sequenceFocusTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.rect.js b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.rect.js new file mode 100644 index 000000000..5434e23f1 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.rect.js @@ -0,0 +1,9 @@ +import { Rect } from '@topology/core' +export function sequenceFocusIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function sequenceFocusTextRect (node) { + node.textRect = new Rect(0, 0, 0, 0) + node.fullTextRect = node.textRect +} +// # sourceMappingURL=focus.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.rect.js.map b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.rect.js.map new file mode 100644 index 000000000..0d9b4720f --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/focus.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"focus.rect.js","sourceRoot":"","sources":["../../../../packages/sequence-diagram/src/focus/focus.rect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,qBAAqB,CAAC,IAAU;IAC9C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAU;IAC9C,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACrC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/index.d.ts b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/index.d.ts new file mode 100644 index 000000000..8ade17270 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/index.d.ts @@ -0,0 +1,3 @@ +export * from './focus'; +export * from './focus.rect'; +export * from './focus.anchor'; diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/index.js b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/index.js new file mode 100644 index 000000000..1c21a9d54 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/index.js @@ -0,0 +1,4 @@ +export * from './focus' +export * from './focus.rect' +export * from './focus.anchor' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/index.js.map b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/index.js.map new file mode 100644 index 000000000..95b00cc5d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/focus/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/sequence-diagram/src/focus/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/index.d.ts b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/index.d.ts new file mode 100644 index 000000000..99c8484d9 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/index.d.ts @@ -0,0 +1,3 @@ +export * from './lifeline'; +export * from './lifeline.rect'; +export * from './lifeline.anchor'; diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/index.js b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/index.js new file mode 100644 index 000000000..bf8f1dc44 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/index.js @@ -0,0 +1,4 @@ +export * from './lifeline' +export * from './lifeline.rect' +export * from './lifeline.anchor' +// # sourceMappingURL=index.js.map diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/index.js.map b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/index.js.map new file mode 100644 index 000000000..5c7c6540e --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/sequence-diagram/src/lifeline/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.anchor.d.ts b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.anchor.d.ts new file mode 100644 index 000000000..ce6ec4d1b --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.anchor.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function lifelineAnchors(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.anchor.js b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.anchor.js new file mode 100644 index 000000000..c6b16c787 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.anchor.js @@ -0,0 +1,9 @@ +import { Point, Direction } from '@topology/core' +export function lifelineAnchors (node) { + node.anchors.push(new Point(node.rect.x, node.rect.y + 25, Direction.Left)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y, Direction.Up)) + node.anchors.push(new Point(node.rect.x + node.rect.width, node.rect.y + 25, Direction.Right)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y + 50, Direction.Bottom)) + node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.ey, Direction.Bottom)) +} +// # sourceMappingURL=lifeline.anchor.js.map diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.anchor.js.map b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.anchor.js.map new file mode 100644 index 000000000..493688974 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.anchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"lifeline.anchor.js","sourceRoot":"","sources":["../../../../packages/sequence-diagram/src/lifeline/lifeline.anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAQ,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,UAAU,eAAe,CAAC,IAAU;IACxC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5E,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3F,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/F,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IACpG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;AAClG,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.d.ts b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.d.ts new file mode 100644 index 000000000..effa23643 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.d.ts @@ -0,0 +1,2 @@ +import { Node } from '@topology/core'; +export declare function lifeline(ctx: CanvasRenderingContext2D, node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.js b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.js new file mode 100644 index 000000000..868b57cae --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.js @@ -0,0 +1,35 @@ +export function lifeline (ctx, node) { + const height = 50 + let wr = node.borderRadius + let hr = node.borderRadius + if (node.borderRadius < 1) { + wr = node.rect.width * node.borderRadius + hr = node.rect.height * node.borderRadius + } + let r = wr < hr ? wr : hr + if (node.rect.width < 2 * r) { + r = node.rect.width / 2 + } + if (height < 2 * r) { + r = height / 2 + } + ctx.beginPath() + ctx.moveTo(node.rect.x + r, node.rect.y) + ctx.arcTo(node.rect.x + node.rect.width, node.rect.y, node.rect.x + node.rect.width, node.rect.y + height, r) + ctx.arcTo(node.rect.x + node.rect.width, node.rect.y + height, node.rect.x, node.rect.y + height, r) + ctx.arcTo(node.rect.x, node.rect.y + height, node.rect.x, node.rect.y, r) + ctx.arcTo(node.rect.x, node.rect.y, node.rect.x + node.rect.width, node.rect.y, r) + ctx.closePath(); + (node.fillStyle || node.bkType) && ctx.fill() + ctx.stroke() + ctx.save() + ctx.beginPath() + ctx.lineWidth = 1 + ctx.setLineDash([7, 7]) + const middle = node.rect.x + node.rect.width / 2 + ctx.moveTo(middle, node.rect.y + height + 1) + ctx.lineTo(middle, node.rect.ey) + ctx.stroke() + ctx.restore() +} +// # sourceMappingURL=lifeline.js.map diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.js.map b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.js.map new file mode 100644 index 000000000..777512f0f --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.js.map @@ -0,0 +1 @@ +{"version":3,"file":"lifeline.js","sourceRoot":"","sources":["../../../../packages/sequence-diagram/src/lifeline/lifeline.ts"],"names":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C,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjC,GAAG,CAAC,MAAM,EAAE,CAAC;IACb,GAAG,CAAC,OAAO,EAAE,CAAC;AAChB,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.rect.d.ts b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.rect.d.ts new file mode 100644 index 000000000..2d59e441a --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.rect.d.ts @@ -0,0 +1,3 @@ +import { Node } from '@topology/core'; +export declare function lifelineIconRect(node: Node): void; +export declare function lifelineTextRect(node: Node): void; diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.rect.js b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.rect.js new file mode 100644 index 000000000..e233c04e5 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.rect.js @@ -0,0 +1,9 @@ +import { Rect } from '@topology/core' +export function lifelineIconRect (node) { + node.iconRect = new Rect(0, 0, 0, 0) +} +export function lifelineTextRect (node) { + node.textRect = new Rect(node.rect.x, node.rect.y, node.rect.width, 50) + node.fullTextRect = node.textRect +} +// # sourceMappingURL=lifeline.rect.js.map diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.rect.js.map b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.rect.js.map new file mode 100644 index 000000000..8a6fcc170 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/lifeline/lifeline.rect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"lifeline.rect.js","sourceRoot":"","sources":["../../../../packages/sequence-diagram/src/lifeline/lifeline.rect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,gBAAgB,CAAC,IAAU;IACzC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAU;IACzC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACxE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/register.d.ts b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/register.d.ts new file mode 100644 index 000000000..bf35c08a1 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/register.d.ts @@ -0,0 +1 @@ +export declare function register(): void; diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/register.js b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/register.js new file mode 100644 index 000000000..78c9a74b7 --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/register.js @@ -0,0 +1,8 @@ +import { registerNode } from '@topology/core' +import { lifeline, lifelineAnchors, lifelineIconRect, lifelineTextRect } from './lifeline' +import { sequenceFocus, sequenceFocusAnchors, sequenceFocusIconRect, sequenceFocusTextRect } from './focus' +export function register () { + registerNode('lifeline', lifeline, lifelineAnchors, lifelineIconRect, lifelineTextRect) + registerNode('sequenceFocus', sequenceFocus, sequenceFocusAnchors, sequenceFocusIconRect, sequenceFocusTextRect) +} +// # sourceMappingURL=register.js.map diff --git a/nezha-fronted/src/components/common/@topology/sequence-diagram/src/register.js.map b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/register.js.map new file mode 100644 index 000000000..374440c2d --- /dev/null +++ b/nezha-fronted/src/components/common/@topology/sequence-diagram/src/register.js.map @@ -0,0 +1 @@ +{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../packages/sequence-diagram/src/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAE5G,MAAM,UAAU,QAAQ;IACtB,YAAY,CAAC,UAAU,EAAE,QAAQ,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;IACxF,YAAY,CAAC,eAAe,EAAE,aAAa,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,qBAAqB,CAAC,CAAC;AACnH,CAAC"} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/ChartDiagram/diagram.vue b/nezha-fronted/src/components/common/ChartDiagram/diagram.vue index b0f56262b..41eed90e5 100644 --- a/nezha-fronted/src/components/common/ChartDiagram/diagram.vue +++ b/nezha-fronted/src/components/common/ChartDiagram/diagram.vue @@ -313,7 +313,7 @@